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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1056 is_swapped_out_ = true; | 1056 is_swapped_out_ = true; |
1057 | 1057 |
1058 // Now that we're swapped out and filtering IPC messages, stop loading to | 1058 // Now that we're swapped out and filtering IPC messages, stop loading to |
1059 // ensure that no other in-progress navigation continues. We do this here | 1059 // ensure that no other in-progress navigation continues. We do this here |
1060 // to avoid sending a DidStopLoading message to the browser process. | 1060 // to avoid sending a DidStopLoading message to the browser process. |
1061 // TODO(creis): Should we be stopping all frames here and using | 1061 // TODO(creis): Should we be stopping all frames here and using |
1062 // StopAltErrorPageFetcher with RenderView::OnStop, or just stopping this | 1062 // StopAltErrorPageFetcher with RenderView::OnStop, or just stopping this |
1063 // frame? | 1063 // frame? |
1064 OnStop(); | 1064 OnStop(); |
1065 | 1065 |
1066 // Let subframes know that the frame is now rendered remotely, for the | 1066 // Send initial drawing parameters to the frame being rendered remotely. |
nasko
2014/09/25 20:17:51
nit: I'd put a comment that is more generic. Now i
| |
1067 // purposes of compositing and input events. | 1067 if (!is_main_frame) |
1068 if (!is_main_frame) { | 1068 proxy->web_frame()->initializeFromFrame(frame_); |
1069 // TODO(creis): Remove setIsRemote and send initializeChildFrame from the | |
1070 // RenderFrameProxy, since the RenderFrameHost may be deleted first. In | |
1071 // the meantime, temporarily set this frame's proxy so that the message | |
1072 // is sent via RenderFrameProxy. | |
1073 // See http://crbug.com/416102. | |
1074 DCHECK(!render_frame_proxy_); | |
1075 set_render_frame_proxy(proxy); | |
1076 frame_->setIsRemote(true); | |
1077 set_render_frame_proxy(NULL); | |
1078 } | |
1079 | 1069 |
1080 // Replace the page with a blank dummy URL. The unload handler will not be | 1070 // Replace the page with a blank dummy URL. The unload handler will not be |
1081 // run a second time, thanks to a check in FrameLoader::stopLoading. | 1071 // run a second time, thanks to a check in FrameLoader::stopLoading. |
1082 // TODO(creis): Need to add a better way to do this that avoids running the | 1072 // TODO(creis): Need to add a better way to do this that avoids running the |
1083 // beforeunload handler. For now, we just run it a second time silently. | 1073 // beforeunload handler. For now, we just run it a second time silently. |
1084 if (!is_site_per_process || is_main_frame) | 1074 if (!is_site_per_process || is_main_frame) |
1085 render_view_->NavigateToSwappedOutURL(frame_); | 1075 render_view_->NavigateToSwappedOutURL(frame_); |
1086 | 1076 |
1087 // Let WebKit know that this view is hidden so it can drop resources and | 1077 // Let WebKit know that this view is hidden so it can drop resources and |
1088 // stop compositing. | 1078 // stop compositing. |
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3182 render_view_->Send(new ViewHostMsg_DidLose3DContext( | 3172 render_view_->Send(new ViewHostMsg_DidLose3DContext( |
3183 GURL(frame->top()->document().securityOrigin().toString()), | 3173 GURL(frame->top()->document().securityOrigin().toString()), |
3184 THREE_D_API_TYPE_WEBGL, | 3174 THREE_D_API_TYPE_WEBGL, |
3185 arb_robustness_status_code)); | 3175 arb_robustness_status_code)); |
3186 } | 3176 } |
3187 | 3177 |
3188 void RenderFrameImpl::forwardInputEvent(const blink::WebInputEvent* event) { | 3178 void RenderFrameImpl::forwardInputEvent(const blink::WebInputEvent* event) { |
3189 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 3179 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
3190 } | 3180 } |
3191 | 3181 |
3192 void RenderFrameImpl::initializeChildFrame(const blink::WebRect& frame_rect, | |
3193 float scale_factor) { | |
3194 render_frame_proxy_->Send(new FrameHostMsg_InitializeChildFrame( | |
3195 routing_id_, frame_rect, scale_factor)); | |
3196 } | |
3197 | |
3198 blink::WebScreenOrientationClient* | 3182 blink::WebScreenOrientationClient* |
3199 RenderFrameImpl::webScreenOrientationClient() { | 3183 RenderFrameImpl::webScreenOrientationClient() { |
3200 if (!screen_orientation_dispatcher_) | 3184 if (!screen_orientation_dispatcher_) |
3201 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this); | 3185 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this); |
3202 return screen_orientation_dispatcher_; | 3186 return screen_orientation_dispatcher_; |
3203 } | 3187 } |
3204 | 3188 |
3205 bool RenderFrameImpl::isControlledByServiceWorker() { | 3189 bool RenderFrameImpl::isControlledByServiceWorker() { |
3206 // If we're in the middle of committing a load, the data source we need | 3190 // If we're in the middle of committing a load, the data source we need |
3207 // will still be provisional. | 3191 // will still be provisional. |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3923 | 3907 |
3924 #if defined(ENABLE_BROWSER_CDMS) | 3908 #if defined(ENABLE_BROWSER_CDMS) |
3925 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3909 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3926 if (!cdm_manager_) | 3910 if (!cdm_manager_) |
3927 cdm_manager_ = new RendererCdmManager(this); | 3911 cdm_manager_ = new RendererCdmManager(this); |
3928 return cdm_manager_; | 3912 return cdm_manager_; |
3929 } | 3913 } |
3930 #endif // defined(ENABLE_BROWSER_CDMS) | 3914 #endif // defined(ENABLE_BROWSER_CDMS) |
3931 | 3915 |
3932 } // namespace content | 3916 } // namespace content |
OLD | NEW |