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

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

Issue 14949012: Add instrumentation to see how often a local predictor prerender could be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_handle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 531 }
532 532
533 alias_urls_.push_back(url); 533 alias_urls_.push_back(url);
534 NotifyPrerenderAddAlias(url); 534 NotifyPrerenderAddAlias(url);
535 return true; 535 return true;
536 } 536 }
537 537
538 bool PrerenderContents::Matches( 538 bool PrerenderContents::Matches(
539 const GURL& url, 539 const GURL& url,
540 const SessionStorageNamespace* session_storage_namespace) const { 540 const SessionStorageNamespace* session_storage_namespace) const {
541 DCHECK(child_id_ == -1 || session_storage_namespace);
542 if (session_storage_namespace && 541 if (session_storage_namespace &&
543 session_storage_namespace_id_ != session_storage_namespace->id()) { 542 session_storage_namespace_id_ != session_storage_namespace->id()) {
544 return false; 543 return false;
545 } 544 }
546 return std::count_if(alias_urls_.begin(), alias_urls_.end(), 545 return std::count_if(alias_urls_.begin(), alias_urls_.end(),
547 std::bind2nd(std::equal_to<GURL>(), url)) != 0; 546 std::bind2nd(std::equal_to<GURL>(), url)) != 0;
548 } 547 }
549 548
550 void PrerenderContents::RenderViewGone(base::TerminationStatus status) { 549 void PrerenderContents::RenderViewGone(base::TerminationStatus status) {
551 Destroy(FINAL_STATUS_RENDERER_CRASHED); 550 Destroy(FINAL_STATUS_RENDERER_CRASHED);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 700
702 bool PrerenderContents::IsCrossSiteNavigationPending() const { 701 bool PrerenderContents::IsCrossSiteNavigationPending() const {
703 if (!prerender_contents_) 702 if (!prerender_contents_)
704 return false; 703 return false;
705 return (prerender_contents_->GetSiteInstance() != 704 return (prerender_contents_->GetSiteInstance() !=
706 prerender_contents_->GetPendingSiteInstance()); 705 prerender_contents_->GetPendingSiteInstance());
707 } 706 }
708 707
709 708
710 } // namespace prerender 709 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698