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

Side by Side Diff: chrome/browser/net/http_server_properties_manager.h

Issue 11238034: Added completion notification to Profile's ClearNetworkingHistorySince. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Increased similarity threshold... Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ 5 #ifndef CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_
6 #define CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ 6 #define CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // thread. It also posts a task to UI thread to get SPDY Server preferences 60 // thread. It also posts a task to UI thread to get SPDY Server preferences
61 // from |pref_service_|. 61 // from |pref_service_|.
62 void InitializeOnIOThread(); 62 void InitializeOnIOThread();
63 63
64 // Prepare for shutdown. Must be called on the UI thread, before destruction. 64 // Prepare for shutdown. Must be called on the UI thread, before destruction.
65 void ShutdownOnUIThread(); 65 void ShutdownOnUIThread();
66 66
67 // Register |prefs| for properties managed here. 67 // Register |prefs| for properties managed here.
68 static void RegisterPrefs(PrefService* prefs); 68 static void RegisterPrefs(PrefService* prefs);
69 69
70 // Deletes all data. Works asynchronously, but if a |completion| callback is
71 // provided, it will be fired on the UI thread when everything is done.
72 void Clear(const base::Closure& completion);
73
70 // ---------------------------------- 74 // ----------------------------------
71 // net::HttpServerProperties methods: 75 // net::HttpServerProperties methods:
72 // ---------------------------------- 76 // ----------------------------------
73 77
74 // Deletes all data. 78 // Deletes all data. Works asynchronously.
75 virtual void Clear() OVERRIDE; 79 virtual void Clear() OVERRIDE;
76 80
77 // Returns true if |server| supports SPDY. Should only be called from IO 81 // Returns true if |server| supports SPDY. Should only be called from IO
78 // thread. 82 // thread.
79 virtual bool SupportsSpdy(const net::HostPortPair& server) const OVERRIDE; 83 virtual bool SupportsSpdy(const net::HostPortPair& server) const OVERRIDE;
80 84
81 // Add |server| as the SPDY server which supports SPDY protocol into the 85 // Add |server| as the SPDY server which supports SPDY protocol into the
82 // persisitent store. Should only be called from IO thread. 86 // persisitent store. Should only be called from IO thread.
83 virtual void SetSupportsSpdy(const net::HostPortPair& server, 87 virtual void SetSupportsSpdy(const net::HostPortPair& server,
84 bool support_spdy) OVERRIDE; 88 bool support_spdy) OVERRIDE;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // simultaneous spdy_servers or spdy_settings or alternate_protocol changes. 171 // simultaneous spdy_servers or spdy_settings or alternate_protocol changes.
168 void ScheduleUpdatePrefsOnIO(); 172 void ScheduleUpdatePrefsOnIO();
169 173
170 // Starts the timers to update the prefs from cache. This are overridden in 174 // Starts the timers to update the prefs from cache. This are overridden in
171 // tests to prevent the delay. 175 // tests to prevent the delay.
172 virtual void StartPrefsUpdateTimerOnIO(base::TimeDelta delay); 176 virtual void StartPrefsUpdateTimerOnIO(base::TimeDelta delay);
173 177
174 // Update prefs::kHttpServerProperties in preferences with the cached data 178 // Update prefs::kHttpServerProperties in preferences with the cached data
175 // from |http_server_properties_impl_|. This gets the data on IO thread and 179 // from |http_server_properties_impl_|. This gets the data on IO thread and
176 // posts a task (UpdatePrefsOnUI) to update the preferences UI thread. 180 // posts a task (UpdatePrefsOnUI) to update the preferences UI thread.
177 // Virtual for testing. 181 void UpdatePrefsFromCacheOnIO();
178 virtual void UpdatePrefsFromCacheOnIO();
179 182
180 // Update prefs::kHttpServerProperties preferences on UI thread. Protected for 183 // Same as above, but fires an optional |completion| callback on the UI thread
181 // testing. 184 // when finished. Virtual for testing.
185 virtual void UpdatePrefsFromCacheOnIO(const base::Closure& completion);
186
187 // Update prefs::kHttpServerProperties preferences on UI thread. Executes an
188 // optional |completion| callback when finished. Protected for testing.
182 void UpdatePrefsOnUI( 189 void UpdatePrefsOnUI(
183 base::ListValue* spdy_server_list, 190 base::ListValue* spdy_server_list,
184 net::SpdySettingsMap* spdy_settings_map, 191 net::SpdySettingsMap* spdy_settings_map,
185 net::AlternateProtocolMap* alternate_protocol_map, 192 net::AlternateProtocolMap* alternate_protocol_map,
186 net::PipelineCapabilityMap* pipeline_capability_map); 193 net::PipelineCapabilityMap* pipeline_capability_map,
194 const base::Closure& completion);
187 195
188 private: 196 private:
189 // Callback for preference changes. 197 // Callback for preference changes.
190 virtual void Observe(int type, 198 virtual void Observe(int type,
191 const content::NotificationSource& source, 199 const content::NotificationSource& source,
192 const content::NotificationDetails& details) OVERRIDE; 200 const content::NotificationDetails& details) OVERRIDE;
193 201
194 // --------- 202 // ---------
195 // UI thread 203 // UI thread
196 // --------- 204 // ---------
(...skipping 22 matching lines...) Expand all
219 io_prefs_update_timer_; 227 io_prefs_update_timer_;
220 228
221 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_impl_; 229 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_impl_;
222 230
223 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); 231 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager);
224 }; 232 };
225 233
226 } // namespace chrome_browser_net 234 } // namespace chrome_browser_net
227 235
228 #endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ 236 #endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698