| OLD | NEW |
| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 458 |
| 459 size_t PrerenderContents::pending_prerender_count() const { | 459 size_t PrerenderContents::pending_prerender_count() const { |
| 460 return pending_prerenders_.size(); | 460 return pending_prerenders_.size(); |
| 461 } | 461 } |
| 462 | 462 |
| 463 WebContents* PrerenderContents::CreateWebContents( | 463 WebContents* PrerenderContents::CreateWebContents( |
| 464 SessionStorageNamespace* session_storage_namespace) { | 464 SessionStorageNamespace* session_storage_namespace) { |
| 465 // TODO(ajwong): Remove the temporary map once prerendering is aware of | 465 // TODO(ajwong): Remove the temporary map once prerendering is aware of |
| 466 // multiple session storage namespaces per tab. | 466 // multiple session storage namespaces per tab. |
| 467 content::SessionStorageNamespaceMap session_storage_namespace_map; | 467 content::SessionStorageNamespaceMap session_storage_namespace_map; |
| 468 session_storage_namespace_map[""] = session_storage_namespace; | 468 session_storage_namespace_map[std::string()] = session_storage_namespace; |
| 469 return WebContents::CreateWithSessionStorage( | 469 return WebContents::CreateWithSessionStorage( |
| 470 WebContents::CreateParams(profile_), session_storage_namespace_map); | 470 WebContents::CreateParams(profile_), session_storage_namespace_map); |
| 471 } | 471 } |
| 472 | 472 |
| 473 void PrerenderContents::NotifyPrerenderStart() { | 473 void PrerenderContents::NotifyPrerenderStart() { |
| 474 DCHECK_EQ(FINAL_STATUS_MAX, final_status_); | 474 DCHECK_EQ(FINAL_STATUS_MAX, final_status_); |
| 475 FOR_EACH_OBSERVER(Observer, observer_list_, OnPrerenderStart(this)); | 475 FOR_EACH_OBSERVER(Observer, observer_list_, OnPrerenderStart(this)); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void PrerenderContents::NotifyPrerenderStopLoading() { | 478 void PrerenderContents::NotifyPrerenderStopLoading() { |
| 479 FOR_EACH_OBSERVER(Observer, observer_list_, OnPrerenderStopLoading(this)); | 479 FOR_EACH_OBSERVER(Observer, observer_list_, OnPrerenderStopLoading(this)); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 701 |
| 702 bool PrerenderContents::IsCrossSiteNavigationPending() const { | 702 bool PrerenderContents::IsCrossSiteNavigationPending() const { |
| 703 if (!prerender_contents_) | 703 if (!prerender_contents_) |
| 704 return false; | 704 return false; |
| 705 return (prerender_contents_->GetSiteInstance() != | 705 return (prerender_contents_->GetSiteInstance() != |
| 706 prerender_contents_->GetPendingSiteInstance()); | 706 prerender_contents_->GetPendingSiteInstance()); |
| 707 } | 707 } |
| 708 | 708 |
| 709 | 709 |
| 710 } // namespace prerender | 710 } // namespace prerender |
| OLD | NEW |