| 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 <deque> | 5 #include <deque> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 PrerenderContents::DidStopLoading(render_view_host); | 299 PrerenderContents::DidStopLoading(render_view_host); |
| 300 ++number_of_loads_; | 300 ++number_of_loads_; |
| 301 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && | 301 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && |
| 302 number_of_loads_ == expected_number_of_loads_) { | 302 number_of_loads_ == expected_number_of_loads_) { |
| 303 MessageLoopForUI::current()->Quit(); | 303 MessageLoopForUI::current()->Quit(); |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 virtual void AddPendingPrerender( | 307 virtual void AddPendingPrerender( |
| 308 base::WeakPtr<PrerenderHandle> weak_prerender_handle, | 308 base::WeakPtr<PrerenderHandle> weak_prerender_handle, |
| 309 const Origin origin, |
| 309 const GURL& url, | 310 const GURL& url, |
| 310 const content::Referrer& referrer, | 311 const content::Referrer& referrer, |
| 311 const gfx::Size& size) OVERRIDE { | 312 const gfx::Size& size) OVERRIDE { |
| 312 PrerenderContents::AddPendingPrerender( | 313 PrerenderContents::AddPendingPrerender( |
| 313 weak_prerender_handle, url, referrer, size); | 314 weak_prerender_handle, origin, url, referrer, size); |
| 314 if (expected_pending_prerenders_ > 0 && | 315 if (expected_pending_prerenders_ > 0 && |
| 315 pending_prerenders().size() == expected_pending_prerenders_) { | 316 pending_prerenders().size() == expected_pending_prerenders_) { |
| 316 MessageLoop::current()->Quit(); | 317 MessageLoop::current()->Quit(); |
| 317 } | 318 } |
| 318 } | 319 } |
| 319 | 320 |
| 320 virtual WebContents* CreateWebContents( | 321 virtual WebContents* CreateWebContents( |
| 321 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE { | 322 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE { |
| 322 WebContents* web_contents = PrerenderContents::CreateWebContents( | 323 WebContents* web_contents = PrerenderContents::CreateWebContents( |
| 323 session_storage_namespace); | 324 session_storage_namespace); |
| (...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 channel_close_watcher.WatchChannel( | 2520 channel_close_watcher.WatchChannel( |
| 2520 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); | 2521 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); |
| 2521 NavigateToDestURL(); | 2522 NavigateToDestURL(); |
| 2522 channel_close_watcher.WaitForChannelClose(); | 2523 channel_close_watcher.WaitForChannelClose(); |
| 2523 | 2524 |
| 2524 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); | 2525 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); |
| 2525 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 2526 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 2526 } | 2527 } |
| 2527 | 2528 |
| 2528 } // namespace prerender | 2529 } // namespace prerender |
| OLD | NEW |