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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // after cancellation of unused prerendered pages. | 264 // after cancellation of unused prerendered pages. |
265 if (quit_message_loop_on_destruction_) { | 265 if (quit_message_loop_on_destruction_) { |
266 // The message loop may not be running if this is swapped in | 266 // The message loop may not be running if this is swapped in |
267 // synchronously on a Navigation. | 267 // synchronously on a Navigation. |
268 base::MessageLoop* loop = base::MessageLoopForUI::current(); | 268 base::MessageLoop* loop = base::MessageLoopForUI::current(); |
269 if (loop->is_running()) | 269 if (loop->is_running()) |
270 loop->Quit(); | 270 loop->Quit(); |
271 } | 271 } |
272 } | 272 } |
273 | 273 |
274 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE { | 274 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE { |
275 // On quit, it's possible to end up here when render processes are closed | 275 // On quit, it's possible to end up here when render processes are closed |
276 // before the PrerenderManager is destroyed. As a result, it's possible to | 276 // before the PrerenderManager is destroyed. As a result, it's possible to |
277 // get either FINAL_STATUS_APP_TERMINATING or FINAL_STATUS_RENDERER_CRASHED | 277 // get either FINAL_STATUS_APP_TERMINATING or FINAL_STATUS_RENDERER_CRASHED |
278 // on quit. | 278 // on quit. |
279 // | 279 // |
280 // It's also possible for this to be called after we've been notified of | 280 // It's also possible for this to be called after we've been notified of |
281 // app termination, but before we've been deleted, which is why the second | 281 // app termination, but before we've been deleted, which is why the second |
282 // check is needed. | 282 // check is needed. |
283 if (expected_final_status_ == FINAL_STATUS_APP_TERMINATING && | 283 if (expected_final_status_ == FINAL_STATUS_APP_TERMINATING && |
284 final_status() != expected_final_status_) { | 284 final_status() != expected_final_status_) { |
285 expected_final_status_ = FINAL_STATUS_RENDERER_CRASHED; | 285 expected_final_status_ = FINAL_STATUS_RENDERER_CRASHED; |
286 } | 286 } |
287 | 287 |
288 PrerenderContents::RenderViewGone(status); | 288 PrerenderContents::RenderProcessGone(status); |
289 } | 289 } |
290 | 290 |
291 virtual bool AddAliasURL(const GURL& url) OVERRIDE { | 291 virtual bool AddAliasURL(const GURL& url) OVERRIDE { |
292 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in | 292 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in |
293 // the PrerenderRendererCrash test. | 293 // the PrerenderRendererCrash test. |
294 if (url.spec() != content::kChromeUICrashURL) | 294 if (url.spec() != content::kChromeUICrashURL) |
295 return PrerenderContents::AddAliasURL(url); | 295 return PrerenderContents::AddAliasURL(url); |
296 return true; | 296 return true; |
297 } | 297 } |
298 | 298 |
(...skipping 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2893 | 2893 |
2894 // Checks that media source video loads are deferred on prerendering. | 2894 // Checks that media source video loads are deferred on prerendering. |
2895 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHTML5MediaSourceVideo) { | 2895 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHTML5MediaSourceVideo) { |
2896 PrerenderTestURL("files/prerender/prerender_html5_video_media_source.html", | 2896 PrerenderTestURL("files/prerender/prerender_html5_video_media_source.html", |
2897 FINAL_STATUS_USED, | 2897 FINAL_STATUS_USED, |
2898 1); | 2898 1); |
2899 NavigateToDestUrlAndWaitForPassTitle(); | 2899 NavigateToDestUrlAndWaitForPassTitle(); |
2900 } | 2900 } |
2901 | 2901 |
2902 } // namespace prerender | 2902 } // namespace prerender |
OLD | NEW |