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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess); | 1044 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess); |
1045 bool is_main_frame = !frame_->parent(); | 1045 bool is_main_frame = !frame_->parent(); |
1046 | 1046 |
1047 // Only run unload if we're not swapped out yet, but send the ack either way. | 1047 // Only run unload if we're not swapped out yet, but send the ack either way. |
1048 if (!is_swapped_out_ || !render_view_->is_swapped_out_) { | 1048 if (!is_swapped_out_ || !render_view_->is_swapped_out_) { |
1049 // Swap this RenderFrame out so the frame can navigate to a page rendered by | 1049 // Swap this RenderFrame out so the frame can navigate to a page rendered by |
1050 // a different process. This involves running the unload handler and | 1050 // a different process. This involves running the unload handler and |
1051 // clearing the page. We also allow this process to exit if there are no | 1051 // clearing the page. We also allow this process to exit if there are no |
1052 // other active RenderFrames in it. | 1052 // other active RenderFrames in it. |
1053 | 1053 |
1054 // Send an UpdateState message before we get swapped out. Create the | 1054 // Send an UpdateState message before we get swapped out. |
1055 // RenderFrameProxy as well so its routing id is registered for receiving | |
1056 // IPC messages. | |
1057 render_view_->SyncNavigationState(); | 1055 render_view_->SyncNavigationState(); |
1058 proxy = RenderFrameProxy::CreateProxyToReplaceFrame(this, | 1056 |
1059 proxy_routing_id); | 1057 // If we need a proxy to replace this, create it now so its routing id is |
| 1058 // registered for receiving IPC messages. |
| 1059 if (proxy_routing_id != MSG_ROUTING_NONE) { |
| 1060 proxy = RenderFrameProxy::CreateProxyToReplaceFrame(this, |
| 1061 proxy_routing_id); |
| 1062 } |
1060 | 1063 |
1061 // Synchronously run the unload handler before sending the ACK. | 1064 // Synchronously run the unload handler before sending the ACK. |
1062 // TODO(creis): Call dispatchUnloadEvent unconditionally here to support | 1065 // TODO(creis): Call dispatchUnloadEvent unconditionally here to support |
1063 // unload on subframes as well. | 1066 // unload on subframes as well. |
1064 if (is_main_frame) | 1067 if (is_main_frame) |
1065 frame_->dispatchUnloadEvent(); | 1068 frame_->dispatchUnloadEvent(); |
1066 | 1069 |
1067 // Swap out and stop sending any IPC messages that are not ACKs. | 1070 // Swap out and stop sending any IPC messages that are not ACKs. |
1068 // TODO(nasko): Do we need RenderFrameImpl::is_swapped_out_ anymore? | 1071 // TODO(nasko): Do we need RenderFrameImpl::is_swapped_out_ anymore? |
1069 if (is_main_frame) | 1072 if (is_main_frame) |
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3929 | 3932 |
3930 #if defined(ENABLE_BROWSER_CDMS) | 3933 #if defined(ENABLE_BROWSER_CDMS) |
3931 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3934 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3932 if (!cdm_manager_) | 3935 if (!cdm_manager_) |
3933 cdm_manager_ = new RendererCdmManager(this); | 3936 cdm_manager_ = new RendererCdmManager(this); |
3934 return cdm_manager_; | 3937 return cdm_manager_; |
3935 } | 3938 } |
3936 #endif // defined(ENABLE_BROWSER_CDMS) | 3939 #endif // defined(ENABLE_BROWSER_CDMS) |
3937 | 3940 |
3938 } // namespace content | 3941 } // namespace content |
OLD | NEW |