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/net/connection_tester.h" | 5 #include "chrome/browser/net/connection_tester.h" |
6 | 6 |
7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
8 #include "content/public/browser/cookie_store_factory.h" | 8 #include "content/public/browser/cookie_store_factory.h" |
9 #include "content/public/test/test_browser_thread.h" | 9 #include "content/public/test/test_browser_thread.h" |
10 #include "content/public/browser/cookie_store_factory.h" | 10 #include "content/public/browser/cookie_store_factory.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // the delegate's methods were invoked. | 33 // the delegate's methods were invoked. |
34 class ConnectionTesterDelegate : public ConnectionTester::Delegate { | 34 class ConnectionTesterDelegate : public ConnectionTester::Delegate { |
35 public: | 35 public: |
36 ConnectionTesterDelegate() | 36 ConnectionTesterDelegate() |
37 : start_connection_test_suite_count_(0), | 37 : start_connection_test_suite_count_(0), |
38 start_connection_test_experiment_count_(0), | 38 start_connection_test_experiment_count_(0), |
39 completed_connection_test_experiment_count_(0), | 39 completed_connection_test_experiment_count_(0), |
40 completed_connection_test_suite_count_(0) { | 40 completed_connection_test_suite_count_(0) { |
41 } | 41 } |
42 | 42 |
43 virtual void OnStartConnectionTestSuite() OVERRIDE { | 43 virtual void OnStartConnectionTestSuite() override { |
44 start_connection_test_suite_count_++; | 44 start_connection_test_suite_count_++; |
45 } | 45 } |
46 | 46 |
47 virtual void OnStartConnectionTestExperiment( | 47 virtual void OnStartConnectionTestExperiment( |
48 const ConnectionTester::Experiment& experiment) OVERRIDE { | 48 const ConnectionTester::Experiment& experiment) override { |
49 start_connection_test_experiment_count_++; | 49 start_connection_test_experiment_count_++; |
50 } | 50 } |
51 | 51 |
52 virtual void OnCompletedConnectionTestExperiment( | 52 virtual void OnCompletedConnectionTestExperiment( |
53 const ConnectionTester::Experiment& experiment, | 53 const ConnectionTester::Experiment& experiment, |
54 int result) OVERRIDE { | 54 int result) override { |
55 completed_connection_test_experiment_count_++; | 55 completed_connection_test_experiment_count_++; |
56 } | 56 } |
57 | 57 |
58 virtual void OnCompletedConnectionTestSuite() OVERRIDE { | 58 virtual void OnCompletedConnectionTestSuite() override { |
59 completed_connection_test_suite_count_++; | 59 completed_connection_test_suite_count_++; |
60 base::MessageLoop::current()->Quit(); | 60 base::MessageLoop::current()->Quit(); |
61 } | 61 } |
62 | 62 |
63 int start_connection_test_suite_count() const { | 63 int start_connection_test_suite_count() const { |
64 return start_connection_test_suite_count_; | 64 return start_connection_test_suite_count_; |
65 } | 65 } |
66 | 66 |
67 int start_connection_test_experiment_count() const { | 67 int start_connection_test_experiment_count() const { |
68 return start_connection_test_experiment_count_; | 68 return start_connection_test_experiment_count_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer | 167 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer |
168 // |backup_task| that it will try to deref during the destructor, but | 168 // |backup_task| that it will try to deref during the destructor, but |
169 // depending on the order that pending tasks were deleted in, it might | 169 // depending on the order that pending tasks were deleted in, it might |
170 // already be invalid! See http://crbug.com/43291. | 170 // already be invalid! See http://crbug.com/43291. |
171 base::MessageLoop::current()->PostTask(FROM_HERE, | 171 base::MessageLoop::current()->PostTask(FROM_HERE, |
172 base::MessageLoop::QuitClosure()); | 172 base::MessageLoop::QuitClosure()); |
173 base::MessageLoop::current()->Run(); | 173 base::MessageLoop::current()->Run(); |
174 } | 174 } |
175 | 175 |
176 } // namespace | 176 } // namespace |
OLD | NEW |