| 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 <memory> |
| 8 |
| 7 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 8 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/resource_context.h" | 11 #include "content/public/browser/resource_context.h" |
| 10 #include "content/public/browser/storage_partition.h" | 12 #include "content/public/browser/storage_partition.h" |
| 11 #include "headless/lib/browser/headless_url_request_context_getter.h" | 13 #include "headless/lib/browser/headless_url_request_context_getter.h" |
| 12 #include "net/url_request/url_request_context.h" | 14 #include "net/url_request/url_request_context.h" |
| 13 | 15 |
| 14 namespace headless { | 16 namespace headless { |
| 15 | 17 |
| 16 // Contains net::URLRequestContextGetter required for resource loading. | 18 // Contains net::URLRequestContextGetter required for resource loading. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 resource_context_.release()); | 72 resource_context_.release()); |
| 71 } | 73 } |
| 72 } | 74 } |
| 73 | 75 |
| 74 void HeadlessBrowserContext::InitWhileIOAllowed() { | 76 void HeadlessBrowserContext::InitWhileIOAllowed() { |
| 75 // TODO(skyostil): Allow the embedder to override this. | 77 // TODO(skyostil): Allow the embedder to override this. |
| 76 PathService::Get(base::DIR_EXE, &path_); | 78 PathService::Get(base::DIR_EXE, &path_); |
| 77 BrowserContext::Initialize(this, path_); | 79 BrowserContext::Initialize(this, path_); |
| 78 } | 80 } |
| 79 | 81 |
| 80 scoped_ptr<content::ZoomLevelDelegate> | 82 std::unique_ptr<content::ZoomLevelDelegate> |
| 81 HeadlessBrowserContext::CreateZoomLevelDelegate( | 83 HeadlessBrowserContext::CreateZoomLevelDelegate( |
| 82 const base::FilePath& partition_path) { | 84 const base::FilePath& partition_path) { |
| 83 return scoped_ptr<content::ZoomLevelDelegate>(); | 85 return std::unique_ptr<content::ZoomLevelDelegate>(); |
| 84 } | 86 } |
| 85 | 87 |
| 86 base::FilePath HeadlessBrowserContext::GetPath() const { | 88 base::FilePath HeadlessBrowserContext::GetPath() const { |
| 87 return path_; | 89 return path_; |
| 88 } | 90 } |
| 89 | 91 |
| 90 bool HeadlessBrowserContext::IsOffTheRecord() const { | 92 bool HeadlessBrowserContext::IsOffTheRecord() const { |
| 91 return false; | 93 return false; |
| 92 } | 94 } |
| 93 | 95 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 const HeadlessBrowser::Options& options) { | 156 const HeadlessBrowser::Options& options) { |
| 155 options_ = options; | 157 options_ = options; |
| 156 } | 158 } |
| 157 | 159 |
| 158 void HeadlessBrowserContext::SetURLRequestContextGetter( | 160 void HeadlessBrowserContext::SetURLRequestContextGetter( |
| 159 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { | 161 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { |
| 160 resource_context_->set_url_request_context_getter(url_request_context_getter); | 162 resource_context_->set_url_request_context_getter(url_request_context_getter); |
| 161 } | 163 } |
| 162 | 164 |
| 163 } // namespace headless | 165 } // namespace headless |
| OLD | NEW |