OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHROME_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 public: | 247 public: |
248 // Constructs a ChromeURLRequestContextGetter that will use |factory| to | 248 // Constructs a ChromeURLRequestContextGetter that will use |factory| to |
249 // create the ChromeURLRequestContext. If |profile| is non-NULL, then the | 249 // create the ChromeURLRequestContext. If |profile| is non-NULL, then the |
250 // ChromeURLRequestContextGetter will additionally watch the preferences for | 250 // ChromeURLRequestContextGetter will additionally watch the preferences for |
251 // changes to charset/language and CleanupOnUIThread() will need to be | 251 // changes to charset/language and CleanupOnUIThread() will need to be |
252 // called to unregister. | 252 // called to unregister. |
253 ChromeURLRequestContextGetter(Profile* profile, | 253 ChromeURLRequestContextGetter(Profile* profile, |
254 ChromeURLRequestContextFactory* factory); | 254 ChromeURLRequestContextFactory* factory); |
255 | 255 |
256 // Note that GetURLRequestContext() can only be called from the IO | 256 // Note that GetURLRequestContext() can only be called from the IO |
257 // thread (it will assert otherwise). GetCookieStore() however can | 257 // thread (it will assert otherwise). GetCookieStore() and |
258 // be called from any thread. | 258 // GetIOMessageLoopProxy however can be called from any thread. |
259 // | 259 // |
260 // URLRequestContextGetter implementation. | 260 // URLRequestContextGetter implementation. |
261 virtual URLRequestContext* GetURLRequestContext(); | 261 virtual URLRequestContext* GetURLRequestContext(); |
262 virtual net::CookieStore* GetCookieStore(); | 262 virtual net::CookieStore* GetCookieStore(); |
| 263 virtual scoped_refptr<MessageLoopProxy> GetIOMessageLoopProxy(); |
263 | 264 |
264 // Convenience overload of GetURLRequestContext() that returns a | 265 // Convenience overload of GetURLRequestContext() that returns a |
265 // ChromeURLRequestContext* rather than a URLRequestContext*. | 266 // ChromeURLRequestContext* rather than a URLRequestContext*. |
266 ChromeURLRequestContext* GetIOContext() { | 267 ChromeURLRequestContext* GetIOContext() { |
267 return reinterpret_cast<ChromeURLRequestContext*>(GetURLRequestContext()); | 268 return reinterpret_cast<ChromeURLRequestContext*>(GetURLRequestContext()); |
268 } | 269 } |
269 | 270 |
270 // Create an instance for use with an 'original' (non-OTR) profile. This is | 271 // Create an instance for use with an 'original' (non-OTR) profile. This is |
271 // expected to get called on the UI thread. | 272 // expected to get called on the UI thread. |
272 static ChromeURLRequestContextGetter* CreateOriginal( | 273 static ChromeURLRequestContextGetter* CreateOriginal( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 IOThread* const io_thread_; | 393 IOThread* const io_thread_; |
393 | 394 |
394 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); | 395 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); |
395 }; | 396 }; |
396 | 397 |
397 // Creates a proxy configuration using the overrides specified on the command | 398 // Creates a proxy configuration using the overrides specified on the command |
398 // line. Returns NULL if the system defaults should be used instead. | 399 // line. Returns NULL if the system defaults should be used instead. |
399 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line); | 400 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line); |
400 | 401 |
401 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 402 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |