Chromium Code Reviews| 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" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 const base::WeakPtr<PrerenderPendingSwapThrottle>& throttle) { | 111 const base::WeakPtr<PrerenderPendingSwapThrottle>& throttle) { |
| 112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 113 | 113 |
| 114 ChildRouteIdPair render_frame_route_id_pair( | 114 ChildRouteIdPair render_frame_route_id_pair( |
| 115 render_process_id, render_frame_id); | 115 render_process_id, render_frame_id); |
| 116 PendingSwapThrottleMap::iterator it = | 116 PendingSwapThrottleMap::iterator it = |
| 117 pending_swap_throttle_map_.find(render_frame_route_id_pair); | 117 pending_swap_throttle_map_.find(render_frame_route_id_pair); |
| 118 DCHECK(it != pending_swap_throttle_map_.end()); | 118 DCHECK(it != pending_swap_throttle_map_.end()); |
| 119 if (it == pending_swap_throttle_map_.end()) | 119 if (it == pending_swap_throttle_map_.end()) |
| 120 return; | 120 return; |
| 121 CHECK(!it->second.throttle); | |
|
davidben
2014/01/16 19:41:02
(If you do get rid of the CHECK, probably good to
| |
| 121 it->second.throttle = throttle; | 122 it->second.throttle = throttle; |
| 122 } | 123 } |
| 123 | 124 |
| 124 void PrerenderTracker::AddPrerenderOnIOThread( | 125 void PrerenderTracker::AddPrerenderOnIOThread( |
| 125 const ChildRouteIdPair& child_route_id_pair) { | 126 const ChildRouteIdPair& child_route_id_pair) { |
| 126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 127 DCHECK(!IsPrerenderingOnIOThread(child_route_id_pair.first, | 128 DCHECK(!IsPrerenderingOnIOThread(child_route_id_pair.first, |
| 128 child_route_id_pair.second)); | 129 child_route_id_pair.second)); |
| 129 | 130 |
| 130 resource_throttle_io_thread_map_.insert( | 131 resource_throttle_io_thread_map_.insert( |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 | 209 |
| 209 PrerenderTracker::PendingSwapThrottleData::~PendingSwapThrottleData() { | 210 PrerenderTracker::PendingSwapThrottleData::~PendingSwapThrottleData() { |
| 210 } | 211 } |
| 211 | 212 |
| 212 // static | 213 // static |
| 213 PrerenderTracker* PrerenderTracker::GetDefault() { | 214 PrerenderTracker* PrerenderTracker::GetDefault() { |
| 214 return g_browser_process->prerender_tracker(); | 215 return g_browser_process->prerender_tracker(); |
| 215 } | 216 } |
| 216 | 217 |
| 217 } // namespace prerender | 218 } // namespace prerender |
| OLD | NEW |