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

Unified Diff: chromeos/dbus/services/proxy_resolution_service_provider.h

Issue 2786103002: chromeos: Avoid DCHECK in ProxyResolutionServiceProvider. (Closed)
Patch Set: merge with change to create net::ProxyService in tests Created 3 years, 9 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
Index: chromeos/dbus/services/proxy_resolution_service_provider.h
diff --git a/chromeos/dbus/services/proxy_resolution_service_provider.h b/chromeos/dbus/services/proxy_resolution_service_provider.h
index 244994d347e16ca3aa76f796a1f8b3d514cb0d81..781ccea6b07b0518129b27868b369bd40f873817 100644
--- a/chromeos/dbus/services/proxy_resolution_service_provider.h
+++ b/chromeos/dbus/services/proxy_resolution_service_provider.h
@@ -103,12 +103,23 @@ class CHROMEOS_EXPORT ProxyResolutionServiceProvider
void ResolveProxy(dbus::MethodCall* method_call,
dbus::ExportedObject::ResponseSender response_sender);
+ // Callback passed to network thread static methods to run
+ // NotifyProxyResolved() on |origin_thread_|.
+ using NotifyCallback = base::Callback<void(std::unique_ptr<Request>)>;
+
// Helper method for ResolveProxy() that runs on network thread.
- void ResolveProxyOnNetworkThread(std::unique_ptr<Request> request);
+ static void ResolveProxyOnNetworkThread(
+ std::unique_ptr<Request> request,
+ scoped_refptr<base::SingleThreadTaskRunner> notify_thread,
+ NotifyCallback notify_callback);
James Cook 2017/04/03 15:30:23 I really appreciate your consistent naming of thin
// Callback on network thread for when net::ProxyService::ResolveProxy()
// completes, synchronously or asynchronously.
- void OnResolutionComplete(std::unique_ptr<Request> request, int result);
+ static void OnResolutionComplete(
+ std::unique_ptr<Request> request,
+ scoped_refptr<base::SingleThreadTaskRunner> notify_thread,
+ NotifyCallback notify_callback,
+ int result);
// Called on UI thread from OnResolutionComplete() to pass the resolved proxy
// information to the client over D-Bus.

Powered by Google App Engine
This is Rietveld 408576698