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

Unified Diff: net/http/http_server_properties_manager.h

Issue 2567893002: Pass pref_task_runner through HttpServerPropertiesManager's cxtor so that tests could inject a Test… (Closed)
Patch Set: add comments to HttpServerPropertiesManager Created 4 years 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: net/http/http_server_properties_manager.h
diff --git a/net/http/http_server_properties_manager.h b/net/http/http_server_properties_manager.h
index e1c47ff913daa3d72a5e848cc3e17f88dc215d68..e20ef59db1c16c1e221103184d6c15942037d791 100644
--- a/net/http/http_server_properties_manager.h
+++ b/net/http/http_server_properties_manager.h
@@ -40,8 +40,14 @@ class IPAddress;
// changes are received from, and the network thread, which owns it, and it
// persists the changes from network stack whether server supports SPDY or not.
//
-// It must be constructed on the pref thread, to set up |pref_task_runner_| and
-// the prefs listeners.
+// There are two SingleThreadTaskRunners:
+// |pref_task_runner_| should be bound with the pref thread and is used to post
+// cache update to the pref thread;
+// |network_task_runner_| should be bound with the network thread and is used
+// to post pref update to the cache thread.
+//
+// It must be constructed with correct task runners passed in to set up
+// |pref_task_runner_| and |network_task_runner| as well as the prefs listeners.
//
// ShutdownOnPrefThread must be called from pref thread before destruction, to
// release the prefs listeners on the pref thread.
@@ -81,9 +87,14 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
// passed as a raw pointer rather than a scoped_refptr currently because
// the test uses gmock and it doesn't forward move semantics properly.
//
- // Must be constructed on the Pref thread.
+ // There are two SingleThreadTaskRunners:
+ // |pref_task_runner| should be bound with the pref thread and is used to post
+ // cache update to the pref thread;
+ // |network_task_runner| should be bound with the network thread and is used
+ // to post pref update to the cache thread.
HttpServerPropertiesManager(
PrefDelegate* pref_delegate,
+ scoped_refptr<base::SingleThreadTaskRunner> pref_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
~HttpServerPropertiesManager() override;
« no previous file with comments | « ios/chrome/browser/net/http_server_properties_manager_factory.cc ('k') | net/http/http_server_properties_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698