OLD | NEW |
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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 432 |
433 pref_proxy_config_tracker_->DetachFromPrefService(); | 433 pref_proxy_config_tracker_->DetachFromPrefService(); |
434 DCHECK(!globals_); | 434 DCHECK(!globals_); |
435 } | 435 } |
436 | 436 |
437 IOThread::Globals* IOThread::globals() { | 437 IOThread::Globals* IOThread::globals() { |
438 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 438 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
439 return globals_; | 439 return globals_; |
440 } | 440 } |
441 | 441 |
| 442 void IOThread::SetGlobalsForTesting(Globals* globals) { |
| 443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 444 DCHECK(!globals || !globals_); |
| 445 globals_ = globals; |
| 446 } |
| 447 |
442 ChromeNetLog* IOThread::net_log() { | 448 ChromeNetLog* IOThread::net_log() { |
443 return net_log_; | 449 return net_log_; |
444 } | 450 } |
445 | 451 |
446 void IOThread::ChangedToOnTheRecord() { | 452 void IOThread::ChangedToOnTheRecord() { |
447 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 453 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
448 BrowserThread::PostTask( | 454 BrowserThread::PostTask( |
449 BrowserThread::IO, | 455 BrowserThread::IO, |
450 FROM_HERE, | 456 FROM_HERE, |
451 base::Bind(&IOThread::ChangedToOnTheRecordOnIOThread, | 457 base::Bind(&IOThread::ChangedToOnTheRecordOnIOThread, |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 | 973 |
968 if (command_line.HasSwitch(switches::kDisableQuic)) | 974 if (command_line.HasSwitch(switches::kDisableQuic)) |
969 return false; | 975 return false; |
970 | 976 |
971 if (command_line.HasSwitch(switches::kEnableQuic)) { | 977 if (command_line.HasSwitch(switches::kEnableQuic)) { |
972 return true; | 978 return true; |
973 } | 979 } |
974 | 980 |
975 return quic_trial_group == kQuicFieldTrialEnabledGroupName; | 981 return quic_trial_group == kQuicFieldTrialEnabledGroupName; |
976 } | 982 } |
OLD | NEW |