| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |