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

Side by Side Diff: chrome/browser/extensions/api/dial/dial_service.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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 | « AUTHORS ('k') | chrome/browser/net/chrome_network_delegate.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/dial/dial_service.h" 5 #include "chrome/browser/extensions/api/dial/dial_service.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 14 matching lines...) Expand all
25 #include "components/version_info/version_info.h" 25 #include "components/version_info/version_info.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "net/base/address_family.h" 27 #include "net/base/address_family.h"
28 #include "net/base/completion_callback.h" 28 #include "net/base/completion_callback.h"
29 #include "net/base/io_buffer.h" 29 #include "net/base/io_buffer.h"
30 #include "net/base/ip_endpoint.h" 30 #include "net/base/ip_endpoint.h"
31 #include "net/base/net_errors.h" 31 #include "net/base/net_errors.h"
32 #include "net/base/network_interfaces.h" 32 #include "net/base/network_interfaces.h"
33 #include "net/http/http_response_headers.h" 33 #include "net/http/http_response_headers.h"
34 #include "net/http/http_util.h" 34 #include "net/http/http_util.h"
35 #include "net/log/net_log_source_type.h"
35 #include "url/gurl.h" 36 #include "url/gurl.h"
36 37
37 #if defined(OS_CHROMEOS) 38 #if defined(OS_CHROMEOS)
38 #include "chromeos/network/network_state.h" 39 #include "chromeos/network/network_state.h"
39 #include "chromeos/network/network_state_handler.h" 40 #include "chromeos/network/network_state_handler.h"
40 #include "third_party/cros_system_api/dbus/service_constants.h" 41 #include "third_party/cros_system_api/dbus/service_constants.h"
41 #endif 42 #endif
42 43
43 using base::Time; 44 using base::Time;
44 using base::TimeDelta; 45 using base::TimeDelta;
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 kDialRequestIntervalMillis) + 383 kDialRequestIntervalMillis) +
383 TimeDelta::FromSeconds(kDialResponseTimeoutSecs)), 384 TimeDelta::FromSeconds(kDialResponseTimeoutSecs)),
384 request_interval_( 385 request_interval_(
385 TimeDelta::FromMilliseconds(kDialRequestIntervalMillis)), 386 TimeDelta::FromMilliseconds(kDialRequestIntervalMillis)),
386 weak_factory_(this) { 387 weak_factory_(this) {
387 IPAddress address; 388 IPAddress address;
388 bool success = address.AssignFromIPLiteral(kDialRequestAddress); 389 bool success = address.AssignFromIPLiteral(kDialRequestAddress);
389 DCHECK(success); 390 DCHECK(success);
390 send_address_ = net::IPEndPoint(address, kDialRequestPort); 391 send_address_ = net::IPEndPoint(address, kDialRequestPort);
391 send_buffer_ = new StringIOBuffer(BuildRequest()); 392 send_buffer_ = new StringIOBuffer(BuildRequest());
392 net_log_source_.type = net::NetLog::SOURCE_UDP_SOCKET; 393 net_log_source_.type = net::NetLogSourceType::UDP_SOCKET;
393 net_log_source_.id = net_log_->NextID(); 394 net_log_source_.id = net_log_->NextID();
394 } 395 }
395 396
396 DialServiceImpl::~DialServiceImpl() { 397 DialServiceImpl::~DialServiceImpl() {
397 DCHECK_CURRENTLY_ON(BrowserThread::IO); 398 DCHECK_CURRENTLY_ON(BrowserThread::IO);
398 } 399 }
399 400
400 void DialServiceImpl::AddObserver(Observer* observer) { 401 void DialServiceImpl::AddObserver(Observer* observer) {
401 DCHECK_CURRENTLY_ON(BrowserThread::IO); 402 DCHECK_CURRENTLY_ON(BrowserThread::IO);
402 observer_list_.AddObserver(observer); 403 observer_list_.AddObserver(observer);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 610
610 bool DialServiceImpl::HasOpenSockets() { 611 bool DialServiceImpl::HasOpenSockets() {
611 for (const auto& socket : dial_sockets_) { 612 for (const auto& socket : dial_sockets_) {
612 if (!socket->IsClosed()) 613 if (!socket->IsClosed())
613 return true; 614 return true;
614 } 615 }
615 return false; 616 return false;
616 } 617 }
617 618
618 } // namespace extensions 619 } // namespace extensions
OLDNEW
« no previous file with comments | « AUTHORS ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698