OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 // Notify all swapped out hosts, including the pending RVH. | 345 // Notify all swapped out hosts, including the pending RVH. |
346 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); | 346 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); |
347 iter != swapped_out_hosts_.end(); | 347 iter != swapped_out_hosts_.end(); |
348 ++iter) { | 348 ++iter) { |
349 DCHECK_NE(iter->second->render_view_host()->GetSiteInstance(), | 349 DCHECK_NE(iter->second->render_view_host()->GetSiteInstance(), |
350 current_host()->GetSiteInstance()); | 350 current_host()->GetSiteInstance()); |
351 iter->second->render_view_host()->DisownOpener(); | 351 iter->second->render_view_host()->DisownOpener(); |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 void RenderFrameHostManager::RendererAbortedProvisionalLoad( | |
356 RenderViewHost* render_view_host) { | |
357 // We used to cancel the pending renderer here for cross-site downloads. | |
358 // However, it's not safe to do that because the download logic repeatedly | |
359 // looks for this WebContents based on a render view ID. Instead, we just | |
360 // leave the pending renderer around until the next navigation event | |
361 // (Navigate, DidNavigate, etc), which will clean it up properly. | |
Charlie Reis
2014/01/06 18:13:35
While it makes sense to remove this method, I thin
nasko
2014/01/06 18:47:03
Done.
| |
362 // TODO(creis): All of this will go away when we move the cross-site logic | |
363 // to ResourceDispatcherHost, so that we intercept responses rather than | |
364 // navigation events. (That's necessary to support onunload anyway.) Once | |
365 // we've made that change, we won't create a pending renderer until we know | |
366 // the response is not a download. | |
Charlie Reis
2014/01/06 18:13:35
This is an ancient TODO from 2008, when I was loos
nasko
2014/01/06 18:47:03
Done.
| |
367 } | |
368 | |
369 void RenderFrameHostManager::RendererProcessClosing( | 355 void RenderFrameHostManager::RendererProcessClosing( |
370 RenderProcessHost* render_process_host) { | 356 RenderProcessHost* render_process_host) { |
371 // Remove any swapped out RVHs from this process, so that we don't try to | 357 // Remove any swapped out RVHs from this process, so that we don't try to |
372 // swap them back in while the process is exiting. Start by finding them, | 358 // swap them back in while the process is exiting. Start by finding them, |
373 // since there could be more than one. | 359 // since there could be more than one. |
374 std::list<int> ids_to_remove; | 360 std::list<int> ids_to_remove; |
375 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); | 361 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); |
376 iter != swapped_out_hosts_.end(); | 362 iter != swapped_out_hosts_.end(); |
377 ++iter) { | 363 ++iter) { |
378 if (iter->second->GetProcess() == render_process_host) | 364 if (iter->second->GetProcess() == render_process_host) |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1310 SiteInstance* instance) const { | 1296 SiteInstance* instance) const { |
1311 RenderFrameHostMap::const_iterator iter = | 1297 RenderFrameHostMap::const_iterator iter = |
1312 swapped_out_hosts_.find(instance->GetId()); | 1298 swapped_out_hosts_.find(instance->GetId()); |
1313 if (iter != swapped_out_hosts_.end()) | 1299 if (iter != swapped_out_hosts_.end()) |
1314 return iter->second; | 1300 return iter->second; |
1315 | 1301 |
1316 return NULL; | 1302 return NULL; |
1317 } | 1303 } |
1318 | 1304 |
1319 } // namespace content | 1305 } // namespace content |
OLD | NEW |