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

Side by Side Diff: content/shell/browser/shell_devtools_manager_delegate.cc

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_devtools_manager_delegate.h" 5 #include "content/shell/browser/shell_devtools_manager_delegate.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 15 matching lines...) Expand all
26 #include "content/public/browser/navigation_entry.h" 26 #include "content/public/browser/navigation_entry.h"
27 #include "content/public/browser/render_view_host.h" 27 #include "content/public/browser/render_view_host.h"
28 #include "content/public/browser/web_contents.h" 28 #include "content/public/browser/web_contents.h"
29 #include "content/public/common/content_switches.h" 29 #include "content/public/common/content_switches.h"
30 #include "content/public/common/url_constants.h" 30 #include "content/public/common/url_constants.h"
31 #include "content/public/common/user_agent.h" 31 #include "content/public/common/user_agent.h"
32 #include "content/shell/browser/shell.h" 32 #include "content/shell/browser/shell.h"
33 #include "content/shell/common/shell_content_client.h" 33 #include "content/shell/common/shell_content_client.h"
34 #include "grit/shell_resources.h" 34 #include "grit/shell_resources.h"
35 #include "net/base/net_errors.h" 35 #include "net/base/net_errors.h"
36 #include "net/log/net_log_source.h"
36 #include "net/socket/tcp_server_socket.h" 37 #include "net/socket/tcp_server_socket.h"
37 #include "ui/base/resource/resource_bundle.h" 38 #include "ui/base/resource/resource_bundle.h"
38 39
39 #if defined(OS_ANDROID) 40 #if defined(OS_ANDROID)
40 #include "content/public/browser/android/devtools_auth.h" 41 #include "content/public/browser/android/devtools_auth.h"
41 #include "net/socket/unix_domain_server_socket_posix.h" 42 #include "net/socket/unix_domain_server_socket_posix.h"
42 #endif 43 #endif
43 44
44 namespace content { 45 namespace content {
45 46
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #else 85 #else
85 class TCPServerSocketFactory : public content::DevToolsSocketFactory { 86 class TCPServerSocketFactory : public content::DevToolsSocketFactory {
86 public: 87 public:
87 TCPServerSocketFactory(const std::string& address, uint16_t port) 88 TCPServerSocketFactory(const std::string& address, uint16_t port)
88 : address_(address), port_(port) {} 89 : address_(address), port_(port) {}
89 90
90 private: 91 private:
91 // content::DevToolsSocketFactory. 92 // content::DevToolsSocketFactory.
92 std::unique_ptr<net::ServerSocket> CreateForHttpServer() override { 93 std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
93 std::unique_ptr<net::ServerSocket> socket( 94 std::unique_ptr<net::ServerSocket> socket(
94 new net::TCPServerSocket(nullptr, net::NetLog::Source())); 95 new net::TCPServerSocket(nullptr, net::NetLogSource()));
95 if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) != net::OK) 96 if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) != net::OK)
96 return std::unique_ptr<net::ServerSocket>(); 97 return std::unique_ptr<net::ServerSocket>();
97 98
98 net::IPEndPoint endpoint; 99 net::IPEndPoint endpoint;
99 if (socket->GetLocalAddress(&endpoint) == net::OK) 100 if (socket->GetLocalAddress(&endpoint) == net::OK)
100 base::subtle::NoBarrier_Store(&g_last_used_port, endpoint.port()); 101 base::subtle::NoBarrier_Store(&g_last_used_port, endpoint.port());
101 102
102 return socket; 103 return socket;
103 } 104 }
104 105
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string(); 201 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
201 #endif 202 #endif
202 } 203 }
203 204
204 std::string ShellDevToolsManagerDelegate::GetFrontendResource( 205 std::string ShellDevToolsManagerDelegate::GetFrontendResource(
205 const std::string& path) { 206 const std::string& path) {
206 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); 207 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
207 } 208 }
208 209
209 } // namespace content 210 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698