AU: Make proxy resolution asynchronous.

This doesn't change proxy resolution overall (we still use settings
stored in the session manager), but it changes the implementation in
the updater to be asynchronous. The clients of the proxy resolver now
give a callback to be called when the proxies are known.

This is anticipation of a switch to using Chrome to resolve proxies,
which will need to be asynchronous.

BUG=chromium-os:12079
TEST=unittests; tested update on device w/ and w/o proxy settings

Review URL: http://codereview.chromium.org/6516026

Change-Id: Icc5c08e3abf4381be55d8d555020d4c630a07fd6
diff --git a/http_fetcher_unittest.cc b/http_fetcher_unittest.cc
index ccda0b6..8170b7b 100644
--- a/http_fetcher_unittest.cc
+++ b/http_fetcher_unittest.cc
@@ -316,15 +316,12 @@
 
     typename TestFixture::HttpServer server;
     ASSERT_TRUE(server.started_);
-    GSource* timeout_source_;
-    timeout_source_ = g_timeout_source_new(0);  // ms
-    g_source_set_callback(timeout_source_, UnpausingTimeoutCallback, &delegate,
-                          NULL);
-    g_source_attach(timeout_source_, NULL);
+
+    guint callback_id = g_timeout_add(500, UnpausingTimeoutCallback, &delegate);
     fetcher->BeginTransfer(this->BigUrl());
 
     g_main_loop_run(loop);
-    g_source_destroy(timeout_source_);
+    g_source_remove(callback_id);
   }
   g_main_loop_unref(loop);
 }