OLD | NEW |
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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/prefs/pref_change_registrar.h" | 14 #include "base/prefs/pref_change_registrar.h" |
15 #include "base/timer.h" | 15 #include "base/timer.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "net/base/host_port_pair.h" | 17 #include "net/base/host_port_pair.h" |
18 #include "net/http/http_pipelined_host_capability.h" | 18 #include "net/http/http_pipelined_host_capability.h" |
19 #include "net/http/http_server_properties.h" | 19 #include "net/http/http_server_properties.h" |
20 #include "net/http/http_server_properties_impl.h" | 20 #include "net/http/http_server_properties_impl.h" |
21 | 21 |
22 class PrefService; | 22 class PrefService; |
| 23 |
| 24 namespace user_prefs { |
23 class PrefRegistrySyncable; | 25 class PrefRegistrySyncable; |
| 26 } |
24 | 27 |
25 namespace chrome_browser_net { | 28 namespace chrome_browser_net { |
26 | 29 |
27 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
28 // HttpServerPropertiesManager | 31 // HttpServerPropertiesManager |
29 | 32 |
30 // The manager for creating and updating an HttpServerProperties (for example it | 33 // The manager for creating and updating an HttpServerProperties (for example it |
31 // tracks if a server supports SPDY or not). | 34 // tracks if a server supports SPDY or not). |
32 // | 35 // |
33 // This class interacts with both the UI thread, where notifications of pref | 36 // This class interacts with both the UI thread, where notifications of pref |
(...skipping 23 matching lines...) Expand all Loading... |
57 | 60 |
58 // Initialize |http_server_properties_impl_| and |io_method_factory_| on IO | 61 // Initialize |http_server_properties_impl_| and |io_method_factory_| on IO |
59 // thread. It also posts a task to UI thread to get SPDY Server preferences | 62 // thread. It also posts a task to UI thread to get SPDY Server preferences |
60 // from |pref_service_|. | 63 // from |pref_service_|. |
61 void InitializeOnIOThread(); | 64 void InitializeOnIOThread(); |
62 | 65 |
63 // Prepare for shutdown. Must be called on the UI thread, before destruction. | 66 // Prepare for shutdown. Must be called on the UI thread, before destruction. |
64 void ShutdownOnUIThread(); | 67 void ShutdownOnUIThread(); |
65 | 68 |
66 // Register |prefs| for properties managed here. | 69 // Register |prefs| for properties managed here. |
67 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 70 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
68 | 71 |
69 // Deletes all data. Works asynchronously, but if a |completion| callback is | 72 // Deletes all data. Works asynchronously, but if a |completion| callback is |
70 // provided, it will be fired on the UI thread when everything is done. | 73 // provided, it will be fired on the UI thread when everything is done. |
71 void Clear(const base::Closure& completion); | 74 void Clear(const base::Closure& completion); |
72 | 75 |
73 // ---------------------------------- | 76 // ---------------------------------- |
74 // net::HttpServerProperties methods: | 77 // net::HttpServerProperties methods: |
75 // ---------------------------------- | 78 // ---------------------------------- |
76 | 79 |
77 // Deletes all data. Works asynchronously. | 80 // Deletes all data. Works asynchronously. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 io_prefs_update_timer_; | 230 io_prefs_update_timer_; |
228 | 231 |
229 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_impl_; | 232 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_impl_; |
230 | 233 |
231 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); | 234 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); |
232 }; | 235 }; |
233 | 236 |
234 } // namespace chrome_browser_net | 237 } // namespace chrome_browser_net |
235 | 238 |
236 #endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 239 #endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
OLD | NEW |