Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: headless/lib/browser/headless_browser_context.cc

Issue 2013483002: headless: Make HeadlessBrowser::Options move-only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 7 #include <memory>
8 8
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 CHECK(url_request_context_getter_); 58 CHECK(url_request_context_getter_);
59 return url_request_context_getter_->GetURLRequestContext()->host_resolver(); 59 return url_request_context_getter_->GetURLRequestContext()->host_resolver();
60 } 60 }
61 61
62 net::URLRequestContext* HeadlessResourceContext::GetRequestContext() { 62 net::URLRequestContext* HeadlessResourceContext::GetRequestContext() {
63 CHECK(url_request_context_getter_); 63 CHECK(url_request_context_getter_);
64 return url_request_context_getter_->GetURLRequestContext(); 64 return url_request_context_getter_->GetURLRequestContext();
65 } 65 }
66 66
67 HeadlessBrowserContext::HeadlessBrowserContext( 67 HeadlessBrowserContext::HeadlessBrowserContext(
68 const HeadlessBrowser::Options& options) 68 HeadlessBrowser::Options* options)
69 : resource_context_(new HeadlessResourceContext), options_(options) { 69 : resource_context_(new HeadlessResourceContext), options_(options) {
70 InitWhileIOAllowed(); 70 InitWhileIOAllowed();
71 } 71 }
72 72
73 HeadlessBrowserContext::~HeadlessBrowserContext() { 73 HeadlessBrowserContext::~HeadlessBrowserContext() {
74 if (resource_context_) { 74 if (resource_context_) {
75 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, 75 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
76 resource_context_.release()); 76 resource_context_.release());
77 } 77 }
78 } 78 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 net::URLRequestContextGetter* 168 net::URLRequestContextGetter*
169 HeadlessBrowserContext::CreateMediaRequestContextForStoragePartition( 169 HeadlessBrowserContext::CreateMediaRequestContextForStoragePartition(
170 const base::FilePath& partition_path, 170 const base::FilePath& partition_path,
171 bool in_memory) { 171 bool in_memory) {
172 return nullptr; 172 return nullptr;
173 } 173 }
174 174
175 void HeadlessBrowserContext::SetOptionsForTesting( 175 void HeadlessBrowserContext::SetOptionsForTesting(
176 const HeadlessBrowser::Options& options) { 176 HeadlessBrowser::Options* options) {
177 options_ = options; 177 options_ = options;
178 } 178 }
179 179
180 } // namespace headless 180 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_browser_context.h ('k') | headless/lib/browser/headless_browser_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698