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

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

Issue 1790483002: headless: Initialize the browser context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698