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

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

Issue 7618016: Additional fixes for prerender/instant + browsing history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Checks for pending_render_view_host_ Created 9 years, 4 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <utility> 8 #include <utility>
9 9
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 if (!prerender_contents_.get()) 595 if (!prerender_contents_.get())
596 return NULL; 596 return NULL;
597 DictionaryValue* dict_value = new DictionaryValue(); 597 DictionaryValue* dict_value = new DictionaryValue();
598 dict_value->SetString("url", prerender_url_.spec()); 598 dict_value->SetString("url", prerender_url_.spec());
599 base::TimeTicks current_time = base::TimeTicks::Now(); 599 base::TimeTicks current_time = base::TimeTicks::Now();
600 base::TimeDelta duration = current_time - load_start_time_; 600 base::TimeDelta duration = current_time - load_start_time_;
601 dict_value->SetInteger("duration", duration.InSeconds()); 601 dict_value->SetInteger("duration", duration.InSeconds());
602 return dict_value; 602 return dict_value;
603 } 603 }
604 604
605 bool PrerenderContents::IsCrossSiteNavigationPending() const {
606 if (!prerender_contents_.get() || !prerender_contents_->tab_contents())
607 return false;
608 const TabContents* tab_contents = prerender_contents_->tab_contents();
609 return (tab_contents->GetSiteInstance() !=
610 tab_contents->GetPendingSiteInstance());
611 }
612
613
605 } // namespace prerender 614 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698