| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_NET_IOS_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef IOS_CHROME_BROWSER_NET_IOS_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
| 6 #define IOS_CHROME_BROWSER_NET_IOS_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define IOS_CHROME_BROWSER_NET_IOS_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // the destructor and GetURLRequestContext(). | 23 // the destructor and GetURLRequestContext(). |
| 24 class IOSChromeURLRequestContextGetter : public net::URLRequestContextGetter { | 24 class IOSChromeURLRequestContextGetter : public net::URLRequestContextGetter { |
| 25 public: | 25 public: |
| 26 // Constructs a ChromeURLRequestContextGetter that will use |factory| to | 26 // Constructs a ChromeURLRequestContextGetter that will use |factory| to |
| 27 // create the URLRequestContext. | 27 // create the URLRequestContext. |
| 28 explicit IOSChromeURLRequestContextGetter( | 28 explicit IOSChromeURLRequestContextGetter( |
| 29 std::unique_ptr<IOSChromeURLRequestContextFactory> factory); | 29 std::unique_ptr<IOSChromeURLRequestContextFactory> factory); |
| 30 | 30 |
| 31 // Note that GetURLRequestContext() can only be called from the IO | 31 // Note that GetURLRequestContext() can only be called from the IO |
| 32 // thread (it will assert otherwise). | 32 // thread (it will assert otherwise). |
| 33 // GetIOMessageLoopProxy however can be called from any thread. | 33 // GetIOTaskRunner however can be called from any thread. |
| 34 // | 34 // |
| 35 // net::URLRequestContextGetter implementation. | 35 // net::URLRequestContextGetter implementation. |
| 36 net::URLRequestContext* GetURLRequestContext() override; | 36 net::URLRequestContext* GetURLRequestContext() override; |
| 37 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() | 37 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
| 38 const override; | 38 const override; |
| 39 | 39 |
| 40 // Create an instance for use with an 'original' (non-OTR) profile. This is | 40 // Create an instance for use with an 'original' (non-OTR) profile. This is |
| 41 // expected to get called on the UI thread. | 41 // expected to get called on the UI thread. |
| 42 static IOSChromeURLRequestContextGetter* Create( | 42 static IOSChromeURLRequestContextGetter* Create( |
| 43 const ChromeBrowserStateIOData* io_data, | 43 const ChromeBrowserStateIOData* io_data, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 64 // NULL before initialization and after invalidation. | 64 // NULL before initialization and after invalidation. |
| 65 // Otherwise, it is the URLRequestContext instance that | 65 // Otherwise, it is the URLRequestContext instance that |
| 66 // was lazily created by GetURLRequestContext(). | 66 // was lazily created by GetURLRequestContext(). |
| 67 // Access only from the IO thread. | 67 // Access only from the IO thread. |
| 68 net::URLRequestContext* url_request_context_; | 68 net::URLRequestContext* url_request_context_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(IOSChromeURLRequestContextGetter); | 70 DISALLOW_COPY_AND_ASSIGN(IOSChromeURLRequestContextGetter); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 #endif // IOS_CHROME_BROWSER_NET_IOS_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 73 #endif // IOS_CHROME_BROWSER_NET_IOS_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |