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

Side by Side Diff: chrome/browser/prefetch/prefetch_browsertest.cc

Issue 624173002: replace OVERRIDE and FINAL with override and final in chrome/browser/[j-q]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/net/prediction_options.h" 9 #include "chrome/browser/net/prediction_options.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 14 matching lines...) Expand all
25 using chrome_browser_net::NetworkPredictionOptions; 25 using chrome_browser_net::NetworkPredictionOptions;
26 using content::BrowserThread; 26 using content::BrowserThread;
27 using net::NetworkChangeNotifier; 27 using net::NetworkChangeNotifier;
28 28
29 namespace { 29 namespace {
30 30
31 const char kPrefetchPage[] = "files/prerender/simple_prefetch.html"; 31 const char kPrefetchPage[] = "files/prerender/simple_prefetch.html";
32 32
33 class MockNetworkChangeNotifierWIFI : public NetworkChangeNotifier { 33 class MockNetworkChangeNotifierWIFI : public NetworkChangeNotifier {
34 public: 34 public:
35 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE { 35 virtual ConnectionType GetCurrentConnectionType() const override {
36 return NetworkChangeNotifier::CONNECTION_WIFI; 36 return NetworkChangeNotifier::CONNECTION_WIFI;
37 } 37 }
38 }; 38 };
39 39
40 class MockNetworkChangeNotifier4G : public NetworkChangeNotifier { 40 class MockNetworkChangeNotifier4G : public NetworkChangeNotifier {
41 public: 41 public:
42 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE { 42 virtual ConnectionType GetCurrentConnectionType() const override {
43 return NetworkChangeNotifier::CONNECTION_4G; 43 return NetworkChangeNotifier::CONNECTION_4G;
44 } 44 }
45 }; 45 };
46 46
47 class PrefetchBrowserTestBase : public InProcessBrowserTest { 47 class PrefetchBrowserTestBase : public InProcessBrowserTest {
48 public: 48 public:
49 explicit PrefetchBrowserTestBase(bool disabled_via_field_trial) 49 explicit PrefetchBrowserTestBase(bool disabled_via_field_trial)
50 : disabled_via_field_trial_(disabled_via_field_trial) {} 50 : disabled_via_field_trial_(disabled_via_field_trial) {}
51 51
52 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 52 virtual void SetUpCommandLine(CommandLine* command_line) override {
53 if (disabled_via_field_trial_) { 53 if (disabled_via_field_trial_) {
54 command_line->AppendSwitchASCII(switches::kForceFieldTrials, 54 command_line->AppendSwitchASCII(switches::kForceFieldTrials,
55 "Prefetch/ExperimentDisabled/"); 55 "Prefetch/ExperimentDisabled/");
56 } 56 }
57 } 57 }
58 58
59 void SetPreference(NetworkPredictionOptions value) { 59 void SetPreference(NetworkPredictionOptions value) {
60 browser()->profile()->GetPrefs()->SetInteger( 60 browser()->profile()->GetPrefs()->SetInteger(
61 prefs::kNetworkPredictionOptions, value); 61 prefs::kNetworkPredictionOptions, value);
62 } 62 }
(...skipping 25 matching lines...) Expand all
88 }; 88 };
89 89
90 // URLRequestJob (and associated handler) which hangs. 90 // URLRequestJob (and associated handler) which hangs.
91 class HangingURLRequestJob : public net::URLRequestJob { 91 class HangingURLRequestJob : public net::URLRequestJob {
92 public: 92 public:
93 HangingURLRequestJob(net::URLRequest* request, 93 HangingURLRequestJob(net::URLRequest* request,
94 net::NetworkDelegate* network_delegate) 94 net::NetworkDelegate* network_delegate)
95 : net::URLRequestJob(request, network_delegate) {} 95 : net::URLRequestJob(request, network_delegate) {}
96 96
97 // net::URLRequestJob implementation 97 // net::URLRequestJob implementation
98 virtual void Start() OVERRIDE {} 98 virtual void Start() override {}
99 99
100 private: 100 private:
101 virtual ~HangingURLRequestJob() {} 101 virtual ~HangingURLRequestJob() {}
102 102
103 DISALLOW_COPY_AND_ASSIGN(HangingURLRequestJob); 103 DISALLOW_COPY_AND_ASSIGN(HangingURLRequestJob);
104 }; 104 };
105 105
106 class HangingRequestInterceptor : public net::URLRequestInterceptor { 106 class HangingRequestInterceptor : public net::URLRequestInterceptor {
107 public: 107 public:
108 explicit HangingRequestInterceptor(const base::Closure& callback) 108 explicit HangingRequestInterceptor(const base::Closure& callback)
109 : callback_(callback) {} 109 : callback_(callback) {}
110 110
111 virtual ~HangingRequestInterceptor() {} 111 virtual ~HangingRequestInterceptor() {}
112 112
113 virtual net::URLRequestJob* MaybeInterceptRequest( 113 virtual net::URLRequestJob* MaybeInterceptRequest(
114 net::URLRequest* request, 114 net::URLRequest* request,
115 net::NetworkDelegate* network_delegate) const OVERRIDE { 115 net::NetworkDelegate* network_delegate) const override {
116 if (!callback_.is_null()) 116 if (!callback_.is_null())
117 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_); 117 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_);
118 return new HangingURLRequestJob(request, network_delegate); 118 return new HangingURLRequestJob(request, network_delegate);
119 } 119 }
120 120
121 private: 121 private:
122 base::Closure callback_; 122 base::Closure callback_;
123 }; 123 };
124 124
125 void CreateHangingRequestInterceptorOnIO(const GURL& url, 125 void CreateHangingRequestInterceptorOnIO(const GURL& url,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 kHangingUrl, 210 kHangingUrl,
211 loop_.QuitClosure())); 211 loop_.QuitClosure()));
212 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 212 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
213 content::RenderFrameHost* rfh = 213 content::RenderFrameHost* rfh =
214 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(); 214 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame();
215 rfh->Send(new PrefetchMsg_Prefetch(rfh->GetRoutingID(), kHangingUrl)); 215 rfh->Send(new PrefetchMsg_Prefetch(rfh->GetRoutingID(), kHangingUrl));
216 loop_.Run(); 216 loop_.Run();
217 } 217 }
218 218
219 } // namespace 219 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/pref_service_flags_storage.h ('k') | chrome/browser/prefs/browser_ui_prefs_migrator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698