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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_
6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual void StartListeningForUpdates(const base::Closure& callback) = 0; 74 virtual void StartListeningForUpdates(const base::Closure& callback) = 0;
75 virtual void StopListeningForUpdates() = 0; 75 virtual void StopListeningForUpdates() = 0;
76 }; 76 };
77 77
78 // Create an instance of the HttpServerPropertiesManager. 78 // Create an instance of the HttpServerPropertiesManager.
79 // 79 //
80 // Ownership of the PrefDelegate pointer is taken by this class. This is 80 // Ownership of the PrefDelegate pointer is taken by this class. This is
81 // passed as a raw pointer rather than a scoped_refptr currently because 81 // passed as a raw pointer rather than a scoped_refptr currently because
82 // the test uses gmock and it doesn't forward move semantics properly. 82 // the test uses gmock and it doesn't forward move semantics properly.
83 // 83 //
84 // Must be constructed on the Pref thread. 84 // Must be constructed on the Pref thread.
brettw 2016/12/13 23:26:13 Can you add a description here of the two task run
Zhongyi Shi 2016/12/14 19:47:24 Sorry about the confusion. I have updated the CL d
brettw 2016/12/14 23:16:54 Thanks for the description update. But I think we
Zhongyi Shi 2016/12/14 23:36:58 Oh, sorry that I miss the comments in the headers
85 HttpServerPropertiesManager( 85 HttpServerPropertiesManager(
86 PrefDelegate* pref_delegate, 86 PrefDelegate* pref_delegate,
87 scoped_refptr<base::SingleThreadTaskRunner> pref_task_runner,
87 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner); 88 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
88 ~HttpServerPropertiesManager() override; 89 ~HttpServerPropertiesManager() override;
89 90
90 // Initialize on Network thread. 91 // Initialize on Network thread.
91 void InitializeOnNetworkThread(); 92 void InitializeOnNetworkThread();
92 93
93 // Prepare for shutdown. Must be called on the Pref thread before destruction. 94 // Prepare for shutdown. Must be called on the Pref thread before destruction.
94 void ShutdownOnPrefThread(); 95 void ShutdownOnPrefThread();
95 96
96 // Helper function for unit tests to set the version in the dictionary. 97 // Helper function for unit tests to set the version in the dictionary.
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // Used to get |weak_ptr_| to self on the network thread. 306 // Used to get |weak_ptr_| to self on the network thread.
306 std::unique_ptr<base::WeakPtrFactory<HttpServerPropertiesManager>> 307 std::unique_ptr<base::WeakPtrFactory<HttpServerPropertiesManager>>
307 network_weak_ptr_factory_; 308 network_weak_ptr_factory_;
308 309
309 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); 310 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager);
310 }; 311 };
311 312
312 } // namespace net 313 } // namespace net
313 314
314 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ 315 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698