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 HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_ |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 const base::FilePath& partition_path, | 35 const base::FilePath& partition_path, |
36 bool in_memory) override; | 36 bool in_memory) override; |
37 content::ResourceContext* GetResourceContext() override; | 37 content::ResourceContext* GetResourceContext() override; |
38 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; | 38 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; |
39 content::BrowserPluginGuestManager* GetGuestManager() override; | 39 content::BrowserPluginGuestManager* GetGuestManager() override; |
40 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; | 40 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; |
41 content::PushMessagingService* GetPushMessagingService() override; | 41 content::PushMessagingService* GetPushMessagingService() override; |
42 content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; | 42 content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; |
43 content::PermissionManager* GetPermissionManager() override; | 43 content::PermissionManager* GetPermissionManager() override; |
44 content::BackgroundSyncController* GetBackgroundSyncController() override; | 44 content::BackgroundSyncController* GetBackgroundSyncController() override; |
| 45 net::URLRequestContextGetter* CreateRequestContext( |
| 46 content::ProtocolHandlerMap* protocol_handlers, |
| 47 content::URLRequestInterceptorScopedVector request_interceptors) override; |
| 48 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 49 const base::FilePath& partition_path, |
| 50 bool in_memory, |
| 51 content::ProtocolHandlerMap* protocol_handlers, |
| 52 content::URLRequestInterceptorScopedVector request_interceptors) override; |
45 | 53 |
46 const HeadlessBrowser::Options& options() const { return options_; } | 54 const HeadlessBrowser::Options& options() const { return options_; } |
47 void SetOptionsForTesting(const HeadlessBrowser::Options& options); | 55 void SetOptionsForTesting(const HeadlessBrowser::Options& options); |
48 | 56 |
49 // Configure the URL request context getter to be used for serving URL | |
50 // requests in this browser instance. | |
51 void SetURLRequestContextGetter( | |
52 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter); | |
53 | |
54 private: | 57 private: |
55 // Performs initialization of the HeadlessBrowserContext while IO is still | 58 // Performs initialization of the HeadlessBrowserContext while IO is still |
56 // allowed on the current thread. | 59 // allowed on the current thread. |
57 void InitWhileIOAllowed(); | 60 void InitWhileIOAllowed(); |
58 | 61 |
59 base::FilePath path_; | 62 base::FilePath path_; |
60 std::unique_ptr<HeadlessResourceContext> resource_context_; | 63 std::unique_ptr<HeadlessResourceContext> resource_context_; |
61 HeadlessBrowser::Options options_; | 64 HeadlessBrowser::Options options_; |
62 | 65 |
63 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContext); | 66 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContext); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace headless | 69 } // namespace headless |
67 | 70 |
68 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_ | 71 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_ |
OLD | NEW |