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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: Implement discussion conclusions 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <deque> 6 #include <deque>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 547
548 // A ContentBrowserClient that cancels all prerenderers on OpenURL. 548 // A ContentBrowserClient that cancels all prerenderers on OpenURL.
549 class TestContentBrowserClient : public ChromeContentBrowserClient { 549 class TestContentBrowserClient : public ChromeContentBrowserClient {
550 public: 550 public:
551 TestContentBrowserClient() {} 551 TestContentBrowserClient() {}
552 ~TestContentBrowserClient() override {} 552 ~TestContentBrowserClient() override {}
553 553
554 // ChromeContentBrowserClient: 554 // ChromeContentBrowserClient:
555 bool ShouldAllowOpenURL(content::SiteInstance* site_instance, 555 bool ShouldAllowOpenURL(content::SiteInstance* site_instance,
556 const GURL& url) override { 556 const GURL& url) override {
557 PrerenderManagerFactory::GetForProfile( 557 PrerenderManagerFactory::GetForBrowserContext(
558 Profile::FromBrowserContext(site_instance->GetBrowserContext())) 558 site_instance->GetBrowserContext())
559 ->CancelAllPrerenders(); 559 ->CancelAllPrerenders();
560 return ChromeContentBrowserClient::ShouldAllowOpenURL(site_instance, 560 return ChromeContentBrowserClient::ShouldAllowOpenURL(site_instance,
561 url); 561 url);
562 } 562 }
563 563
564 private: 564 private:
565 DISALLOW_COPY_AND_ASSIGN(TestContentBrowserClient); 565 DISALLOW_COPY_AND_ASSIGN(TestContentBrowserClient);
566 }; 566 };
567 567
568 // A ContentBrowserClient that forces cross-process navigations. 568 // A ContentBrowserClient that forces cross-process navigations.
(...skipping 2792 matching lines...) Expand 10 before | Expand all | Expand 10 after
3361 browser()->tab_strip_model()->GetActiveWebContents(); 3361 browser()->tab_strip_model()->GetActiveWebContents();
3362 bool display_test_result = false; 3362 bool display_test_result = false;
3363 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3363 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3364 "DidDisplayReallyPass()", 3364 "DidDisplayReallyPass()",
3365 &display_test_result)); 3365 &display_test_result));
3366 ASSERT_TRUE(display_test_result); 3366 ASSERT_TRUE(display_test_result);
3367 } 3367 }
3368 #endif // !defined(DISABLE_NACL) 3368 #endif // !defined(DISABLE_NACL)
3369 3369
3370 } // namespace prerender 3370 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698