OLD | NEW |
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 CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 // the destructor and GetURLRequestContext(). | 28 // the destructor and GetURLRequestContext(). |
29 class ChromeURLRequestContextGetter : public net::URLRequestContextGetter { | 29 class ChromeURLRequestContextGetter : public net::URLRequestContextGetter { |
30 public: | 30 public: |
31 // Constructs a ChromeURLRequestContextGetter that will use |factory| to | 31 // Constructs a ChromeURLRequestContextGetter that will use |factory| to |
32 // create the URLRequestContext. | 32 // create the URLRequestContext. |
33 explicit ChromeURLRequestContextGetter( | 33 explicit ChromeURLRequestContextGetter( |
34 ChromeURLRequestContextFactory* factory); | 34 ChromeURLRequestContextFactory* factory); |
35 | 35 |
36 // Note that GetURLRequestContext() can only be called from the IO | 36 // Note that GetURLRequestContext() can only be called from the IO |
37 // thread (it will assert otherwise). | 37 // thread (it will assert otherwise). |
38 // GetIOMessageLoopProxy however can be called from any thread. | 38 // GetIOTaskRunner however can be called from any thread. |
39 // | 39 // |
40 // net::URLRequestContextGetter implementation. | 40 // net::URLRequestContextGetter implementation. |
41 net::URLRequestContext* GetURLRequestContext() override; | 41 net::URLRequestContext* GetURLRequestContext() override; |
42 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() | 42 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
43 const override; | 43 const override; |
44 | 44 |
45 // Create an instance for use with an 'original' (non-OTR) profile. This is | 45 // Create an instance for use with an 'original' (non-OTR) profile. This is |
46 // expected to get called on the UI thread. | 46 // expected to get called on the UI thread. |
47 static ChromeURLRequestContextGetter* Create( | 47 static ChromeURLRequestContextGetter* Create( |
48 Profile* profile, | 48 Profile* profile, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // NULL before initialization and after invalidation. | 94 // NULL before initialization and after invalidation. |
95 // Otherwise, it is the URLRequestContext instance that | 95 // Otherwise, it is the URLRequestContext instance that |
96 // was lazily created by GetURLRequestContext(). | 96 // was lazily created by GetURLRequestContext(). |
97 // Access only from the IO thread. | 97 // Access only from the IO thread. |
98 net::URLRequestContext* url_request_context_; | 98 net::URLRequestContext* url_request_context_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); | 100 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); |
101 }; | 101 }; |
102 | 102 |
103 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 103 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |