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

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

Issue 2841953002: headless: Add support for net logging (Closed)
Patch Set: CrOS build fix Created 3 years, 8 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 | « headless/BUILD.gn ('k') | headless/lib/browser/headless_browser_main_parts.h » ('j') | 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_impl.h" 5 #include "headless/lib/browser/headless_browser_context_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/guid.h" 12 #include "base/guid.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "content/public/browser/resource_context.h" 16 #include "content/public/browser/resource_context.h"
17 #include "content/public/browser/storage_partition.h" 17 #include "content/public/browser/storage_partition.h"
18 #include "headless/grit/headless_lib_resources.h" 18 #include "headless/grit/headless_lib_resources.h"
19 #include "headless/lib/browser/headless_browser_context_options.h" 19 #include "headless/lib/browser/headless_browser_context_options.h"
20 #include "headless/lib/browser/headless_browser_impl.h" 20 #include "headless/lib/browser/headless_browser_impl.h"
21 #include "headless/lib/browser/headless_browser_main_parts.h"
22 #include "headless/lib/browser/headless_net_log.h"
21 #include "headless/lib/browser/headless_permission_manager.h" 23 #include "headless/lib/browser/headless_permission_manager.h"
22 #include "headless/lib/browser/headless_url_request_context_getter.h" 24 #include "headless/lib/browser/headless_url_request_context_getter.h"
23 #include "headless/public/util/black_hole_protocol_handler.h" 25 #include "headless/public/util/black_hole_protocol_handler.h"
24 #include "headless/public/util/in_memory_protocol_handler.h" 26 #include "headless/public/util/in_memory_protocol_handler.h"
25 #include "net/url_request/url_request_context.h" 27 #include "net/url_request/url_request_context.h"
26 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
27 29
28 namespace headless { 30 namespace headless {
29 31
30 namespace { 32 namespace {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 net::URLRequestContextGetter* HeadlessBrowserContextImpl::CreateRequestContext( 218 net::URLRequestContextGetter* HeadlessBrowserContextImpl::CreateRequestContext(
217 content::ProtocolHandlerMap* protocol_handlers, 219 content::ProtocolHandlerMap* protocol_handlers,
218 content::URLRequestInterceptorScopedVector request_interceptors) { 220 content::URLRequestInterceptorScopedVector request_interceptors) {
219 scoped_refptr<HeadlessURLRequestContextGetter> url_request_context_getter( 221 scoped_refptr<HeadlessURLRequestContextGetter> url_request_context_getter(
220 new HeadlessURLRequestContextGetter( 222 new HeadlessURLRequestContextGetter(
221 content::BrowserThread::GetTaskRunnerForThread( 223 content::BrowserThread::GetTaskRunnerForThread(
222 content::BrowserThread::IO), 224 content::BrowserThread::IO),
223 content::BrowserThread::GetTaskRunnerForThread( 225 content::BrowserThread::GetTaskRunnerForThread(
224 content::BrowserThread::FILE), 226 content::BrowserThread::FILE),
225 protocol_handlers, context_options_->TakeProtocolHandlers(), 227 protocol_handlers, context_options_->TakeProtocolHandlers(),
226 std::move(request_interceptors), context_options_.get())); 228 std::move(request_interceptors), context_options_.get(),
229 browser_->browser_main_parts()->net_log()));
227 resource_context_->set_url_request_context_getter(url_request_context_getter); 230 resource_context_->set_url_request_context_getter(url_request_context_getter);
228 return url_request_context_getter.get(); 231 return url_request_context_getter.get();
229 } 232 }
230 233
231 net::URLRequestContextGetter* 234 net::URLRequestContextGetter*
232 HeadlessBrowserContextImpl::CreateRequestContextForStoragePartition( 235 HeadlessBrowserContextImpl::CreateRequestContextForStoragePartition(
233 const base::FilePath& partition_path, 236 const base::FilePath& partition_path,
234 bool in_memory, 237 bool in_memory,
235 content::ProtocolHandlerMap* protocol_handlers, 238 content::ProtocolHandlerMap* protocol_handlers,
236 content::URLRequestInterceptorScopedVector request_interceptors) { 239 content::URLRequestInterceptorScopedVector request_interceptors) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings() {} 425 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings() {}
423 426
424 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings( 427 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings(
425 const std::string& mojom_name, 428 const std::string& mojom_name,
426 const std::string& js_bindings) 429 const std::string& js_bindings)
427 : mojom_name(mojom_name), js_bindings(js_bindings) {} 430 : mojom_name(mojom_name), js_bindings(js_bindings) {}
428 431
429 HeadlessBrowserContext::Builder::MojoBindings::~MojoBindings() {} 432 HeadlessBrowserContext::Builder::MojoBindings::~MojoBindings() {}
430 433
431 } // namespace headless 434 } // namespace headless
OLDNEW
« no previous file with comments | « headless/BUILD.gn ('k') | headless/lib/browser/headless_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698