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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 648653003: Standardize usage of virtual/override/final in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (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/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Used for the "system" URLRequestContext. 149 // Used for the "system" URLRequestContext.
150 class SystemURLRequestContext : public net::URLRequestContext { 150 class SystemURLRequestContext : public net::URLRequestContext {
151 public: 151 public:
152 SystemURLRequestContext() { 152 SystemURLRequestContext() {
153 #if defined(USE_NSS) || defined(OS_IOS) 153 #if defined(USE_NSS) || defined(OS_IOS)
154 net::SetURLRequestContextForNSSHttpIO(this); 154 net::SetURLRequestContextForNSSHttpIO(this);
155 #endif 155 #endif
156 } 156 }
157 157
158 private: 158 private:
159 virtual ~SystemURLRequestContext() { 159 ~SystemURLRequestContext() override {
160 AssertNoURLRequests(); 160 AssertNoURLRequests();
161 #if defined(USE_NSS) || defined(OS_IOS) 161 #if defined(USE_NSS) || defined(OS_IOS)
162 net::SetURLRequestContextForNSSHttpIO(NULL); 162 net::SetURLRequestContextForNSSHttpIO(NULL);
163 #endif 163 #endif
164 } 164 }
165 }; 165 };
166 166
167 scoped_ptr<net::HostResolver> CreateGlobalHostResolver(net::NetLog* net_log) { 167 scoped_ptr<net::HostResolver> CreateGlobalHostResolver(net::NetLog* net_log) {
168 TRACE_EVENT0("startup", "IOThread::CreateGlobalHostResolver"); 168 TRACE_EVENT0("startup", "IOThread::CreateGlobalHostResolver");
169 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 169 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 public net::NetworkChangeNotifier::NetworkChangeObserver { 319 public net::NetworkChangeNotifier::NetworkChangeObserver {
320 public: 320 public:
321 // |net_log| must remain valid throughout our lifetime. 321 // |net_log| must remain valid throughout our lifetime.
322 explicit LoggingNetworkChangeObserver(net::NetLog* net_log) 322 explicit LoggingNetworkChangeObserver(net::NetLog* net_log)
323 : net_log_(net_log) { 323 : net_log_(net_log) {
324 net::NetworkChangeNotifier::AddIPAddressObserver(this); 324 net::NetworkChangeNotifier::AddIPAddressObserver(this);
325 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); 325 net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
326 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); 326 net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
327 } 327 }
328 328
329 virtual ~LoggingNetworkChangeObserver() { 329 ~LoggingNetworkChangeObserver() override {
330 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); 330 net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
331 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 331 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
332 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); 332 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
333 } 333 }
334 334
335 // NetworkChangeNotifier::IPAddressObserver implementation. 335 // NetworkChangeNotifier::IPAddressObserver implementation.
336 virtual void OnIPAddressChanged() override { 336 void OnIPAddressChanged() override {
337 VLOG(1) << "Observed a change to the network IP addresses"; 337 VLOG(1) << "Observed a change to the network IP addresses";
338 338
339 net_log_->AddGlobalEntry(net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); 339 net_log_->AddGlobalEntry(net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED);
340 } 340 }
341 341
342 // NetworkChangeNotifier::ConnectionTypeObserver implementation. 342 // NetworkChangeNotifier::ConnectionTypeObserver implementation.
343 virtual void OnConnectionTypeChanged( 343 void OnConnectionTypeChanged(
344 net::NetworkChangeNotifier::ConnectionType type) override { 344 net::NetworkChangeNotifier::ConnectionType type) override {
345 std::string type_as_string = 345 std::string type_as_string =
346 net::NetworkChangeNotifier::ConnectionTypeToString(type); 346 net::NetworkChangeNotifier::ConnectionTypeToString(type);
347 347
348 VLOG(1) << "Observed a change to network connectivity state " 348 VLOG(1) << "Observed a change to network connectivity state "
349 << type_as_string; 349 << type_as_string;
350 350
351 net_log_->AddGlobalEntry( 351 net_log_->AddGlobalEntry(
352 net::NetLog::TYPE_NETWORK_CONNECTIVITY_CHANGED, 352 net::NetLog::TYPE_NETWORK_CONNECTIVITY_CHANGED,
353 net::NetLog::StringCallback("new_connection_type", &type_as_string)); 353 net::NetLog::StringCallback("new_connection_type", &type_as_string));
354 } 354 }
355 355
356 // NetworkChangeNotifier::NetworkChangeObserver implementation. 356 // NetworkChangeNotifier::NetworkChangeObserver implementation.
357 virtual void OnNetworkChanged( 357 void OnNetworkChanged(
358 net::NetworkChangeNotifier::ConnectionType type) override { 358 net::NetworkChangeNotifier::ConnectionType type) override {
359 std::string type_as_string = 359 std::string type_as_string =
360 net::NetworkChangeNotifier::ConnectionTypeToString(type); 360 net::NetworkChangeNotifier::ConnectionTypeToString(type);
361 361
362 VLOG(1) << "Observed a network change to state " << type_as_string; 362 VLOG(1) << "Observed a network change to state " << type_as_string;
363 363
364 net_log_->AddGlobalEntry( 364 net_log_->AddGlobalEntry(
365 net::NetLog::TYPE_NETWORK_CHANGED, 365 net::NetLog::TYPE_NETWORK_CHANGED,
366 net::NetLog::StringCallback("new_connection_type", &type_as_string)); 366 net::NetLog::StringCallback("new_connection_type", &type_as_string));
367 } 367 }
368 368
369 private: 369 private:
370 net::NetLog* net_log_; 370 net::NetLog* net_log_;
371 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); 371 DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
372 }; 372 };
373 373
374 class SystemURLRequestContextGetter : public net::URLRequestContextGetter { 374 class SystemURLRequestContextGetter : public net::URLRequestContextGetter {
375 public: 375 public:
376 explicit SystemURLRequestContextGetter(IOThread* io_thread); 376 explicit SystemURLRequestContextGetter(IOThread* io_thread);
377 377
378 // Implementation for net::UrlRequestContextGetter. 378 // Implementation for net::UrlRequestContextGetter.
379 virtual net::URLRequestContext* GetURLRequestContext() override; 379 net::URLRequestContext* GetURLRequestContext() override;
380 virtual scoped_refptr<base::SingleThreadTaskRunner> 380 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
381 GetNetworkTaskRunner() const override; 381 const override;
382 382
383 protected: 383 protected:
384 virtual ~SystemURLRequestContextGetter(); 384 ~SystemURLRequestContextGetter() override;
385 385
386 private: 386 private:
387 IOThread* const io_thread_; // Weak pointer, owned by BrowserProcess. 387 IOThread* const io_thread_; // Weak pointer, owned by BrowserProcess.
388 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; 388 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
389 389
390 base::debug::LeakTracker<SystemURLRequestContextGetter> leak_tracker_; 390 base::debug::LeakTracker<SystemURLRequestContextGetter> leak_tracker_;
391 }; 391 };
392 392
393 SystemURLRequestContextGetter::SystemURLRequestContextGetter( 393 SystemURLRequestContextGetter::SystemURLRequestContextGetter(
394 IOThread* io_thread) 394 IOThread* io_thread)
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1411 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1412 for (size_t i = 0; i < supported_versions.size(); ++i) { 1412 for (size_t i = 0; i < supported_versions.size(); ++i) {
1413 net::QuicVersion version = supported_versions[i]; 1413 net::QuicVersion version = supported_versions[i];
1414 if (net::QuicVersionToString(version) == quic_version) { 1414 if (net::QuicVersionToString(version) == quic_version) {
1415 return version; 1415 return version;
1416 } 1416 }
1417 } 1417 }
1418 1418
1419 return net::QUIC_VERSION_UNSUPPORTED; 1419 return net::QUIC_VERSION_UNSUPPORTED;
1420 } 1420 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/lifetime/browser_close_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698