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 #include "headless/lib/browser/headless_browser_context.h" | 5 #include "headless/lib/browser/headless_browser_context.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/resource_context.h" | 9 #include "content/public/browser/resource_context.h" |
10 #include "content/public/browser/storage_partition.h" | 10 #include "content/public/browser/storage_partition.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 HeadlessBrowserContext::~HeadlessBrowserContext() { | 67 HeadlessBrowserContext::~HeadlessBrowserContext() { |
68 if (resource_context_) { | 68 if (resource_context_) { |
69 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, | 69 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, |
70 resource_context_.release()); | 70 resource_context_.release()); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 void HeadlessBrowserContext::InitWhileIOAllowed() { | 74 void HeadlessBrowserContext::InitWhileIOAllowed() { |
75 // TODO(skyostil): Allow the embedder to override this. | 75 // TODO(skyostil): Allow the embedder to override this. |
76 PathService::Get(base::DIR_EXE, &path_); | 76 PathService::Get(base::DIR_EXE, &path_); |
| 77 BrowserContext::Initialize(this, path_); |
77 } | 78 } |
78 | 79 |
79 scoped_ptr<content::ZoomLevelDelegate> | 80 scoped_ptr<content::ZoomLevelDelegate> |
80 HeadlessBrowserContext::CreateZoomLevelDelegate( | 81 HeadlessBrowserContext::CreateZoomLevelDelegate( |
81 const base::FilePath& partition_path) { | 82 const base::FilePath& partition_path) { |
82 return scoped_ptr<content::ZoomLevelDelegate>(); | 83 return scoped_ptr<content::ZoomLevelDelegate>(); |
83 } | 84 } |
84 | 85 |
85 base::FilePath HeadlessBrowserContext::GetPath() const { | 86 base::FilePath HeadlessBrowserContext::GetPath() const { |
86 return path_; | 87 return path_; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 HeadlessBrowserContext::GetBackgroundSyncController() { | 155 HeadlessBrowserContext::GetBackgroundSyncController() { |
155 return nullptr; | 156 return nullptr; |
156 } | 157 } |
157 | 158 |
158 void HeadlessBrowserContext::SetURLRequestContextGetter( | 159 void HeadlessBrowserContext::SetURLRequestContextGetter( |
159 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { | 160 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { |
160 resource_context_->set_url_request_context_getter(url_request_context_getter); | 161 resource_context_->set_url_request_context_getter(url_request_context_getter); |
161 } | 162 } |
162 | 163 |
163 } // namespace headless | 164 } // namespace headless |
OLD | NEW |