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

Side by Side Diff: content/browser/devtools/protocol/tethering_handler.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/devtools/protocol/tethering_handler.h" 5 #include "content/browser/devtools/protocol/tethering_handler.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/ip_address.h" 10 #include "net/base/ip_address.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 #include "net/log/net_log_source.h"
12 #include "net/socket/server_socket.h" 13 #include "net/socket/server_socket.h"
13 #include "net/socket/stream_socket.h" 14 #include "net/socket/stream_socket.h"
14 #include "net/socket/tcp_server_socket.h" 15 #include "net/socket/tcp_server_socket.h"
15 16
16 namespace content { 17 namespace content {
17 namespace devtools { 18 namespace devtools {
18 namespace tethering { 19 namespace tethering {
19 20
20 namespace { 21 namespace {
21 22
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 }; 155 };
155 156
156 class BoundSocket { 157 class BoundSocket {
157 public: 158 public:
158 typedef base::Callback<void(uint16_t, const std::string&)> AcceptedCallback; 159 typedef base::Callback<void(uint16_t, const std::string&)> AcceptedCallback;
159 160
160 BoundSocket(AcceptedCallback accepted_callback, 161 BoundSocket(AcceptedCallback accepted_callback,
161 const CreateServerSocketCallback& socket_callback) 162 const CreateServerSocketCallback& socket_callback)
162 : accepted_callback_(accepted_callback), 163 : accepted_callback_(accepted_callback),
163 socket_callback_(socket_callback), 164 socket_callback_(socket_callback),
164 socket_(new net::TCPServerSocket(NULL, net::NetLog::Source())), 165 socket_(new net::TCPServerSocket(NULL, net::NetLogSource())),
165 port_(0) { 166 port_(0) {
166 } 167 }
167 168
168 virtual ~BoundSocket() { 169 virtual ~BoundSocket() {
169 } 170 }
170 171
171 bool Listen(uint16_t port) { 172 bool Listen(uint16_t port) {
172 port_ = port; 173 port_ = port;
173 net::IPEndPoint end_point(net::IPAddress::IPv4Localhost(), port); 174 net::IPEndPoint end_point(net::IPAddress::IPv4Localhost(), port);
174 int result = socket_->Listen(end_point, kListenBacklog); 175 int result = socket_->Listen(end_point, kListenBacklog);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 } 392 }
392 393
393 void TetheringHandler::SendInternalError(DevToolsCommandId command_id, 394 void TetheringHandler::SendInternalError(DevToolsCommandId command_id,
394 const std::string& message) { 395 const std::string& message) {
395 client_->SendError(command_id, Response::InternalError(message)); 396 client_->SendError(command_id, Response::InternalError(message));
396 } 397 }
397 398
398 } // namespace tethering 399 } // namespace tethering
399 } // namespace devtools 400 } // namespace devtools
400 } // namespace content 401 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698