Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 content::URLRequestInterceptorScopedVector request_interceptors); | 72 content::URLRequestInterceptorScopedVector request_interceptors); |
| 73 | 73 |
| 74 // Create an instance for an original profile for media with isolated | 74 // Create an instance for an original profile for media with isolated |
| 75 // storage. This is expected to get called on UI thread. | 75 // storage. This is expected to get called on UI thread. |
| 76 static ChromeURLRequestContextGetter* CreateForIsolatedMedia( | 76 static ChromeURLRequestContextGetter* CreateForIsolatedMedia( |
| 77 Profile* profile, | 77 Profile* profile, |
| 78 ChromeURLRequestContextGetter* app_context, | 78 ChromeURLRequestContextGetter* app_context, |
| 79 const ProfileIOData* profile_io_data, | 79 const ProfileIOData* profile_io_data, |
| 80 const StoragePartitionDescriptor& partition_descriptor); | 80 const StoragePartitionDescriptor& partition_descriptor); |
| 81 | 81 |
| 82 // Discard reference to URLRequestContext. | 82 // Discard reference to URLRequestContext and inform observers of shutdown. |
| 83 // Access only from the IO thread. | 83 // Must be called before destruction. May only be called on IO thread. |
| 84 void Invalidate(); | 84 void NotifyContextShuttingDown(); |
|
davidben
2015/05/14 17:09:26
Maybe keep this called Invalidate or rename it to
mmenke
2015/05/14 19:23:52
Done - was on the fence about naming, happy to def
| |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 ~ChromeURLRequestContextGetter() override; | 87 ~ChromeURLRequestContextGetter() override; |
| 88 | 88 |
| 89 // Deferred logic for creating a URLRequestContext. | 89 // Deferred logic for creating a URLRequestContext. |
| 90 // Access only from the IO thread. | 90 // Access only from the IO thread. |
| 91 scoped_ptr<ChromeURLRequestContextFactory> factory_; | 91 scoped_ptr<ChromeURLRequestContextFactory> factory_; |
| 92 | 92 |
| 93 // NULL before initialization and after invalidation. | 93 // NULL before initialization and after invalidation. |
| 94 // Otherwise, it is the URLRequestContext instance that | 94 // Otherwise, it is the URLRequestContext instance that |
| 95 // was lazily created by GetURLRequestContext(). | 95 // was lazily created by GetURLRequestContext(). |
| 96 // Access only from the IO thread. | 96 // Access only from the IO thread. |
| 97 net::URLRequestContext* url_request_context_; | 97 net::URLRequestContext* url_request_context_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); | 99 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ | 102 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |