| 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_tracker.h" | 5 #include "chrome/browser/prerender/prerender_tracker.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/prerender/prerender_manager.h" | 10 #include "chrome/browser/prerender/prerender_manager.h" |
| 11 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 11 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
| 14 #include "content/public/browser/resource_context.h" | 14 #include "content/public/browser/resource_context.h" |
| 15 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
| 16 | 16 |
| 17 using content::BrowserThread; | 17 using content::BrowserThread; |
| 18 using content::RenderViewHost; |
| 18 | 19 |
| 19 namespace prerender { | 20 namespace prerender { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 bool ShouldCancelRequest( | 24 bool ShouldCancelRequest( |
| 24 int child_id, | 25 int child_id, |
| 25 int route_id) { | 26 int route_id) { |
| 26 // Check if the RenderViewHost associated with (child_id, route_id) no | 27 // Check if the RenderViewHost associated with (child_id, route_id) no |
| 27 // longer exists, or has already been swapped out for a prerendered page. | 28 // longer exists, or has already been swapped out for a prerendered page. |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 GetDefault()->AddPrerenderOnIOThread(child_route_id_pair); | 325 GetDefault()->AddPrerenderOnIOThread(child_route_id_pair); |
| 325 } | 326 } |
| 326 | 327 |
| 327 // static | 328 // static |
| 328 void PrerenderTracker::RemovePrerenderOnIOThreadTask( | 329 void PrerenderTracker::RemovePrerenderOnIOThreadTask( |
| 329 const ChildRouteIdPair& child_route_id_pair) { | 330 const ChildRouteIdPair& child_route_id_pair) { |
| 330 GetDefault()->RemovePrerenderOnIOThread(child_route_id_pair); | 331 GetDefault()->RemovePrerenderOnIOThread(child_route_id_pair); |
| 331 } | 332 } |
| 332 | 333 |
| 333 } // namespace prerender | 334 } // namespace prerender |
| OLD | NEW |