Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: net/proxy/proxy_service.h

Issue 14142: Start using the proxy resolve IPC for plugins.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/unit/unittests.vcproj ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.h
===================================================================
--- net/proxy/proxy_service.h (revision 8931)
+++ net/proxy/proxy_service.h (working copy)
@@ -13,6 +13,7 @@
#include "base/string_util.h"
#include "base/thread.h"
#include "base/time.h"
+#include "base/waitable_event.h"
#include "googleurl/src/gurl.h"
#include "net/base/completion_callback.h"
@@ -312,6 +313,31 @@
ProxyInfo* results) = 0;
};
+// Wrapper for invoking methods on a ProxyService synchronously.
+class SyncProxyServiceHelper
+ : public base::RefCountedThreadSafe<SyncProxyServiceHelper> {
+ public:
+ SyncProxyServiceHelper(MessageLoop* io_message_loop,
+ ProxyService* proxy_service);
+
+ int ResolveProxy(const GURL& url, ProxyInfo* proxy_info);
+ int ReconsiderProxyAfterError(const GURL& url, ProxyInfo* proxy_info);
+
+ private:
+ void StartAsyncResolve(const GURL& url);
+ void StartAsyncReconsider(const GURL& url);
+
+ void OnCompletion(int result);
+
+ MessageLoop* io_message_loop_;
+ ProxyService* proxy_service_;
+
+ base::WaitableEvent event_;
+ CompletionCallbackImpl<SyncProxyServiceHelper> callback_;
+ ProxyInfo proxy_info_;
+ int result_;
+};
+
} // namespace net
#endif // NET_PROXY_PROXY_SERVICE_H_
« no previous file with comments | « chrome/test/unit/unittests.vcproj ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698