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

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

Issue 2043603004: headless: Introduce a browser context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits 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_devtools.h" 5 #include "headless/lib/browser/headless_devtools.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "components/devtools_http_handler/devtools_http_handler.h" 9 #include "components/devtools_http_handler/devtools_http_handler.h"
10 #include "components/devtools_http_handler/devtools_http_handler_delegate.h" 10 #include "components/devtools_http_handler/devtools_http_handler_delegate.h"
11 #include "content/public/browser/browser_context.h"
12 #include "content/public/browser/devtools_frontend_host.h" 11 #include "content/public/browser/devtools_frontend_host.h"
13 #include "content/public/browser/navigation_entry.h" 12 #include "content/public/browser/navigation_entry.h"
14 #include "headless/grit/headless_lib_resources.h" 13 #include "headless/grit/headless_lib_resources.h"
15 #include "headless/lib/browser/headless_browser_context.h" 14 #include "headless/lib/browser/headless_browser_context_impl.h"
16 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
17 #include "net/socket/tcp_server_socket.h" 16 #include "net/socket/tcp_server_socket.h"
18 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
19 18
20 using devtools_http_handler::DevToolsHttpHandler; 19 using devtools_http_handler::DevToolsHttpHandler;
21 20
22 namespace headless { 21 namespace headless {
23 22
24 namespace { 23 namespace {
25 24
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 83 }
85 84
86 content::DevToolsExternalAgentProxyDelegate* 85 content::DevToolsExternalAgentProxyDelegate*
87 HeadlessDevToolsDelegate::HandleWebSocketConnection(const std::string& path) { 86 HeadlessDevToolsDelegate::HandleWebSocketConnection(const std::string& path) {
88 return nullptr; 87 return nullptr;
89 } 88 }
90 89
91 } // namespace 90 } // namespace
92 91
93 std::unique_ptr<DevToolsHttpHandler> CreateLocalDevToolsHttpHandler( 92 std::unique_ptr<DevToolsHttpHandler> CreateLocalDevToolsHttpHandler(
94 HeadlessBrowserContext* browser_context) { 93 HeadlessBrowserContextImpl* browser_context) {
95 const net::IPEndPoint& endpoint = 94 const net::IPEndPoint& endpoint =
96 browser_context->options()->devtools_endpoint; 95 browser_context->options()->devtools_endpoint;
97 std::unique_ptr<DevToolsHttpHandler::ServerSocketFactory> socket_factory( 96 std::unique_ptr<DevToolsHttpHandler::ServerSocketFactory> socket_factory(
98 new TCPServerSocketFactory(endpoint)); 97 new TCPServerSocketFactory(endpoint));
99 return base::WrapUnique(new DevToolsHttpHandler( 98 return base::WrapUnique(new DevToolsHttpHandler(
100 std::move(socket_factory), std::string(), new HeadlessDevToolsDelegate(), 99 std::move(socket_factory), std::string(), new HeadlessDevToolsDelegate(),
101 browser_context->GetPath(), base::FilePath(), std::string(), 100 browser_context->GetPath(), base::FilePath(), std::string(),
102 browser_context->options()->user_agent)); 101 browser_context->options()->user_agent));
103 } 102 }
104 103
105 } // namespace headless 104 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_devtools.h ('k') | headless/lib/browser/headless_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698