Chromium Code Reviews| 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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/child/appcache/appcache_dispatcher.h" | 9 #include "content/child/appcache/appcache_dispatcher.h" |
| 10 #include "content/child/fileapi/file_system_dispatcher.h" | 10 #include "content/child/fileapi/file_system_dispatcher.h" |
| 11 #include "content/child/fileapi/webfilesystem_callback_adapters.h" | 11 #include "content/child/fileapi/webfilesystem_callback_adapters.h" |
| 12 #include "content/child/quota_dispatcher.h" | 12 #include "content/child/quota_dispatcher.h" |
| 13 #include "content/child/request_extra_data.h" | 13 #include "content/child/request_extra_data.h" |
| 14 #include "content/common/socket_stream_handle_data.h" | 14 #include "content/common/socket_stream_handle_data.h" |
| 15 #include "content/common/swapped_out_messages.h" | |
| 15 #include "content/common/view_messages.h" | 16 #include "content/common/view_messages.h" |
| 16 #include "content/public/common/content_constants.h" | 17 #include "content/public/common/content_constants.h" |
| 17 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
| 18 #include "content/public/renderer/content_renderer_client.h" | 19 #include "content/public/renderer/content_renderer_client.h" |
| 19 #include "content/public/renderer/document_state.h" | 20 #include "content/public/renderer/document_state.h" |
| 20 #include "content/public/renderer/navigation_state.h" | 21 #include "content/public/renderer/navigation_state.h" |
| 21 #include "content/public/renderer/password_form_conversion_utils.h" | 22 #include "content/public/renderer/password_form_conversion_utils.h" |
| 22 #include "content/renderer/browser_plugin/browser_plugin.h" | 23 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 23 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 24 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
| 24 #include "content/renderer/internal_document_state_data.h" | 25 #include "content/renderer/internal_document_state_data.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 // static | 92 // static |
| 92 void RenderFrameImpl::InstallCreateHook( | 93 void RenderFrameImpl::InstallCreateHook( |
| 93 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32)) { | 94 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32)) { |
| 94 CHECK(!g_create_render_frame_impl); | 95 CHECK(!g_create_render_frame_impl); |
| 95 g_create_render_frame_impl = create_render_frame_impl; | 96 g_create_render_frame_impl = create_render_frame_impl; |
| 96 } | 97 } |
| 97 | 98 |
| 98 // RenderFrameImpl ---------------------------------------------------------- | 99 // RenderFrameImpl ---------------------------------------------------------- |
| 99 RenderFrameImpl::RenderFrameImpl(RenderViewImpl* render_view, int routing_id) | 100 RenderFrameImpl::RenderFrameImpl(RenderViewImpl* render_view, int routing_id) |
| 100 : render_view_(render_view), | 101 : render_view_(render_view), |
| 101 routing_id_(routing_id) { | 102 routing_id_(routing_id), |
| 103 is_swapped_out_(false), | |
| 104 detaching_(false) { | |
| 102 } | 105 } |
| 103 | 106 |
| 104 RenderFrameImpl::~RenderFrameImpl() { | 107 RenderFrameImpl::~RenderFrameImpl() { |
| 105 } | 108 } |
| 106 | 109 |
| 107 int RenderFrameImpl::GetRoutingID() const { | 110 int RenderFrameImpl::GetRoutingID() const { |
| 108 // TODO(nasko): Until we register RenderFrameHost in the browser process as | 111 return routing_id_; |
|
Charlie Reis
2013/08/26 18:27:10
I'm not sure I understand the intention of changin
awong
2013/08/27 19:58:13
The guiding thought was to make all uses of render
| |
| 109 // a listener, we must route all messages to the RenderViewHost, so use the | |
| 110 // routing id of the RenderView for now. | |
| 111 return render_view_->GetRoutingID(); | |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool RenderFrameImpl::Send(IPC::Message* message) { | 114 bool RenderFrameImpl::Send(IPC::Message* message) { |
| 115 // TODO(nasko): Move away from using the RenderView's Send method once we | 115 if (detaching_ || |
|
Charlie Reis
2013/08/26 18:27:10
This is never set to true. Why include it?
awong
2013/08/27 19:58:13
Honestly, I was trying to replicated RenderViewHos
| |
| 116 // have enough infrastructure and state to make the right checks here. | 116 (is_swapped_out_ && |
| 117 return render_view_->Send(message); | 117 !SwappedOutMessages::CanSendWhileSwappedOut(message))) { |
| 118 delete message; | |
| 119 return false; | |
| 120 } | |
| 121 | |
| 122 if (message->routing_id() == MSG_ROUTING_NONE) | |
| 123 message->set_routing_id(routing_id_); | |
| 124 | |
| 125 return RenderThread::Get()->Send(message); | |
| 118 } | 126 } |
| 119 | 127 |
| 120 bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { | 128 bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { |
| 121 // Pass the message up to the RenderView, until we have enough | 129 return false; |
|
Charlie Reis
2013/08/26 18:27:10
Maybe add a TODO comment here about what the inten
awong
2013/08/27 19:58:13
Done.
| |
| 122 // infrastructure to start processing messages in this object. | |
| 123 return render_view_->OnMessageReceived(msg); | |
| 124 } | 130 } |
| 125 | 131 |
| 126 // WebKit::WebFrameClient implementation ------------------------------------- | 132 // WebKit::WebFrameClient implementation ------------------------------------- |
| 127 | 133 |
| 128 WebKit::WebPlugin* RenderFrameImpl::createPlugin( | 134 WebKit::WebPlugin* RenderFrameImpl::createPlugin( |
| 129 WebKit::WebFrame* frame, | 135 WebKit::WebFrame* frame, |
| 130 const WebKit::WebPluginParams& params) { | 136 const WebKit::WebPluginParams& params) { |
| 131 WebKit::WebPlugin* plugin = NULL; | 137 WebKit::WebPlugin* plugin = NULL; |
| 132 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 138 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
| 133 render_view_, frame, params, &plugin)) { | 139 render_view_, frame, params, &plugin)) { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 161 const WebKit::WebURL& url, | 167 const WebKit::WebURL& url, |
| 162 const WebKit::WebString& name, | 168 const WebKit::WebString& name, |
| 163 unsigned long long document_id) { | 169 unsigned long long document_id) { |
| 164 int route_id = MSG_ROUTING_NONE; | 170 int route_id = MSG_ROUTING_NONE; |
| 165 bool exists = false; | 171 bool exists = false; |
| 166 bool url_mismatch = false; | 172 bool url_mismatch = false; |
| 167 ViewHostMsg_CreateWorker_Params params; | 173 ViewHostMsg_CreateWorker_Params params; |
| 168 params.url = url; | 174 params.url = url; |
| 169 params.name = name; | 175 params.name = name; |
| 170 params.document_id = document_id; | 176 params.document_id = document_id; |
| 171 params.render_view_route_id = GetRoutingID(); | 177 params.render_view_route_id = render_view_->GetRoutingID(); |
| 172 params.route_id = MSG_ROUTING_NONE; | 178 params.route_id = MSG_ROUTING_NONE; |
| 173 params.script_resource_appcache_id = 0; | 179 params.script_resource_appcache_id = 0; |
| 174 Send(new ViewHostMsg_LookupSharedWorker( | 180 render_view_->Send(new ViewHostMsg_LookupSharedWorker( |
| 175 params, &exists, &route_id, &url_mismatch)); | 181 params, &exists, &route_id, &url_mismatch)); |
| 176 if (url_mismatch) { | 182 if (url_mismatch) { |
| 177 return NULL; | 183 return NULL; |
| 178 } else { | 184 } else { |
| 179 return new WebSharedWorkerProxy(RenderThreadImpl::current(), | 185 return new WebSharedWorkerProxy(RenderThreadImpl::current(), |
| 180 document_id, | 186 document_id, |
| 181 exists, | 187 exists, |
| 182 route_id, | 188 route_id, |
| 183 GetRoutingID()); | 189 render_view_->GetRoutingID()); |
| 184 } | 190 } |
| 185 } | 191 } |
| 186 | 192 |
| 187 WebKit::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( | 193 WebKit::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( |
| 188 WebKit::WebFrame* frame, | 194 WebKit::WebFrame* frame, |
| 189 const WebKit::WebURL& url, | 195 const WebKit::WebURL& url, |
| 190 WebKit::WebMediaPlayerClient* client) { | 196 WebKit::WebMediaPlayerClient* client) { |
| 191 // TODO(nasko): Moving the implementation here involves moving a few media | 197 // TODO(nasko): Moving the implementation here involves moving a few media |
| 192 // related client objects here or referencing them in the RenderView. Needs | 198 // related client objects here or referencing them in the RenderView. Needs |
| 193 // more work to understand where the proper place for those objects is. | 199 // more work to understand where the proper place for those objects is. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 207 WebKit::WebCookieJar* RenderFrameImpl::cookieJar(WebKit::WebFrame* frame) { | 213 WebKit::WebCookieJar* RenderFrameImpl::cookieJar(WebKit::WebFrame* frame) { |
| 208 return render_view_->cookieJar(frame); | 214 return render_view_->cookieJar(frame); |
| 209 } | 215 } |
| 210 | 216 |
| 211 void RenderFrameImpl::didAccessInitialDocument(WebKit::WebFrame* frame) { | 217 void RenderFrameImpl::didAccessInitialDocument(WebKit::WebFrame* frame) { |
| 212 render_view_->didAccessInitialDocument(frame); | 218 render_view_->didAccessInitialDocument(frame); |
| 213 } | 219 } |
| 214 | 220 |
| 215 void RenderFrameImpl::didCreateFrame(WebKit::WebFrame* parent, | 221 void RenderFrameImpl::didCreateFrame(WebKit::WebFrame* parent, |
| 216 WebKit::WebFrame* child) { | 222 WebKit::WebFrame* child) { |
| 217 Send(new ViewHostMsg_FrameAttached(GetRoutingID(), parent->identifier(), | 223 render_view_->Send(new ViewHostMsg_FrameAttached(render_view_->GetRoutingID(), |
| 224 parent->identifier(), | |
|
Charlie Reis
2013/08/26 18:27:10
nit: Wrong indent.
awong
2013/08/27 19:58:13
Done.
| |
| 218 child->identifier(), UTF16ToUTF8(child->assignedName()))); | 225 child->identifier(), UTF16ToUTF8(child->assignedName()))); |
| 219 } | 226 } |
| 220 | 227 |
| 221 void RenderFrameImpl::didDisownOpener(WebKit::WebFrame* frame) { | 228 void RenderFrameImpl::didDisownOpener(WebKit::WebFrame* frame) { |
| 222 render_view_->didDisownOpener(frame); | 229 render_view_->didDisownOpener(frame); |
| 223 } | 230 } |
| 224 | 231 |
| 225 void RenderFrameImpl::frameDetached(WebKit::WebFrame* frame) { | 232 void RenderFrameImpl::frameDetached(WebKit::WebFrame* frame) { |
| 226 int64 parent_frame_id = -1; | 233 int64 parent_frame_id = -1; |
| 227 if (frame->parent()) | 234 if (frame->parent()) |
| 228 parent_frame_id = frame->parent()->identifier(); | 235 parent_frame_id = frame->parent()->identifier(); |
| 229 | 236 |
| 230 Send(new ViewHostMsg_FrameDetached(GetRoutingID(), parent_frame_id, | 237 render_view_->Send(new ViewHostMsg_FrameDetached(render_view_->GetRoutingID(), |
| 231 frame->identifier())); | 238 parent_frame_id, |
|
Charlie Reis
2013/08/26 18:27:10
nit: Wrong indent.
awong
2013/08/27 19:58:13
Done.
| |
| 239 frame->identifier())); | |
| 232 | 240 |
| 233 // Call back to RenderViewImpl for observers to be notified. | 241 // Call back to RenderViewImpl for observers to be notified. |
| 234 // TODO(nasko): Remove once we have RenderFrameObserver. | 242 // TODO(nasko): Remove once we have RenderFrameObserver. |
| 235 render_view_->frameDetached(frame); | 243 render_view_->frameDetached(frame); |
| 236 } | 244 } |
| 237 | 245 |
| 238 void RenderFrameImpl::willClose(WebKit::WebFrame* frame) { | 246 void RenderFrameImpl::willClose(WebKit::WebFrame* frame) { |
| 239 // Call back to RenderViewImpl for observers to be notified. | 247 // Call back to RenderViewImpl for observers to be notified. |
| 240 // TODO(nasko): Remove once we have RenderFrameObserver. | 248 // TODO(nasko): Remove once we have RenderFrameObserver. |
| 241 render_view_->willClose(frame); | 249 render_view_->willClose(frame); |
| 242 } | 250 } |
| 243 | 251 |
| 244 void RenderFrameImpl::didChangeName(WebKit::WebFrame* frame, | 252 void RenderFrameImpl::didChangeName(WebKit::WebFrame* frame, |
| 245 const WebKit::WebString& name) { | 253 const WebKit::WebString& name) { |
| 246 if (!render_view_->renderer_preferences_.report_frame_name_changes) | 254 if (!render_view_->renderer_preferences_.report_frame_name_changes) |
| 247 return; | 255 return; |
| 248 | 256 |
| 249 Send(new ViewHostMsg_UpdateFrameName(GetRoutingID(), | 257 render_view_->Send( |
| 250 frame->identifier(), | 258 new ViewHostMsg_UpdateFrameName(render_view_->GetRoutingID(), |
| 251 !frame->parent(), | 259 frame->identifier(), |
| 252 UTF16ToUTF8(name))); | 260 !frame->parent(), |
| 261 UTF16ToUTF8(name))); | |
| 253 } | 262 } |
| 254 | 263 |
| 255 void RenderFrameImpl::loadURLExternally(WebKit::WebFrame* frame, | 264 void RenderFrameImpl::loadURLExternally(WebKit::WebFrame* frame, |
| 256 const WebKit::WebURLRequest& request, | 265 const WebKit::WebURLRequest& request, |
| 257 WebKit::WebNavigationPolicy policy) { | 266 WebKit::WebNavigationPolicy policy) { |
| 258 loadURLExternally(frame, request, policy, WebString()); | 267 loadURLExternally(frame, request, policy, WebString()); |
| 259 } | 268 } |
| 260 | 269 |
| 261 void RenderFrameImpl::loadURLExternally( | 270 void RenderFrameImpl::loadURLExternally( |
| 262 WebKit::WebFrame* frame, | 271 WebKit::WebFrame* frame, |
| 263 const WebKit::WebURLRequest& request, | 272 const WebKit::WebURLRequest& request, |
| 264 WebKit::WebNavigationPolicy policy, | 273 WebKit::WebNavigationPolicy policy, |
| 265 const WebKit::WebString& suggested_name) { | 274 const WebKit::WebString& suggested_name) { |
| 266 Referrer referrer(RenderViewImpl::GetReferrerFromRequest(frame, request)); | 275 Referrer referrer(RenderViewImpl::GetReferrerFromRequest(frame, request)); |
| 267 if (policy == WebKit::WebNavigationPolicyDownload) { | 276 if (policy == WebKit::WebNavigationPolicyDownload) { |
| 268 Send(new ViewHostMsg_DownloadUrl(GetRoutingID(), request.url(), referrer, | 277 render_view_->Send(new ViewHostMsg_DownloadUrl(render_view_->GetRoutingID(), |
| 269 suggested_name)); | 278 request.url(), referrer, |
| 279 suggested_name)); | |
| 270 } else { | 280 } else { |
| 271 render_view_->OpenURL(frame, request.url(), referrer, policy); | 281 render_view_->OpenURL(frame, request.url(), referrer, policy); |
| 272 } | 282 } |
| 273 } | 283 } |
| 274 | 284 |
| 275 WebKit::WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( | 285 WebKit::WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
| 276 WebKit::WebFrame* frame, | 286 WebKit::WebFrame* frame, |
| 277 const WebKit::WebURLRequest& request, | 287 const WebKit::WebURLRequest& request, |
| 278 WebKit::WebNavigationType type, | 288 WebKit::WebNavigationType type, |
| 279 WebKit::WebNavigationPolicy default_policy, | 289 WebKit::WebNavigationPolicy default_policy, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 373 // * stats_collection_controller_ | 383 // * stats_collection_controller_ |
| 374 render_view_->didClearWindowObject(frame); | 384 render_view_->didClearWindowObject(frame); |
| 375 } | 385 } |
| 376 | 386 |
| 377 void RenderFrameImpl::didCreateDocumentElement(WebKit::WebFrame* frame) { | 387 void RenderFrameImpl::didCreateDocumentElement(WebKit::WebFrame* frame) { |
| 378 // Notify the browser about non-blank documents loading in the top frame. | 388 // Notify the browser about non-blank documents loading in the top frame. |
| 379 GURL url = frame->document().url(); | 389 GURL url = frame->document().url(); |
| 380 if (url.is_valid() && url.spec() != kAboutBlankURL) { | 390 if (url.is_valid() && url.spec() != kAboutBlankURL) { |
| 381 // TODO(nasko): Check if webview()->mainFrame() is the same as the | 391 // TODO(nasko): Check if webview()->mainFrame() is the same as the |
| 382 // frame->tree()->top(). | 392 // frame->tree()->top(). |
| 383 if (frame == render_view_->webview()->mainFrame()) | 393 if (frame == render_view_->webview()->mainFrame()) { |
| 384 Send(new ViewHostMsg_DocumentAvailableInMainFrame(GetRoutingID())); | 394 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( |
| 395 render_view_->GetRoutingID())); | |
| 396 } | |
| 385 } | 397 } |
| 386 | 398 |
| 387 // Call back to RenderViewImpl for observers to be notified. | 399 // Call back to RenderViewImpl for observers to be notified. |
| 388 // TODO(nasko): Remove once we have RenderFrameObserver. | 400 // TODO(nasko): Remove once we have RenderFrameObserver. |
| 389 render_view_->didCreateDocumentElement(frame); | 401 render_view_->didCreateDocumentElement(frame); |
| 390 } | 402 } |
| 391 | 403 |
| 392 void RenderFrameImpl::didReceiveTitle(WebKit::WebFrame* frame, | 404 void RenderFrameImpl::didReceiveTitle(WebKit::WebFrame* frame, |
| 393 const WebKit::WebString& title, | 405 const WebKit::WebString& title, |
| 394 WebKit::WebTextDirection direction) { | 406 WebKit::WebTextDirection direction) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 553 top_document_state->set_was_prefetcher(true); | 565 top_document_state->set_was_prefetcher(true); |
| 554 | 566 |
| 555 if (was_after_preconnect_request) | 567 if (was_after_preconnect_request) |
| 556 top_document_state->set_was_after_preconnect_request(true); | 568 top_document_state->set_was_after_preconnect_request(true); |
| 557 } | 569 } |
| 558 | 570 |
| 559 // This is an instance where we embed a copy of the routing id | 571 // This is an instance where we embed a copy of the routing id |
| 560 // into the data portion of the message. This can cause problems if we | 572 // into the data portion of the message. This can cause problems if we |
| 561 // don't register this id on the browser side, since the download manager | 573 // don't register this id on the browser side, since the download manager |
| 562 // expects to find a RenderViewHost based off the id. | 574 // expects to find a RenderViewHost based off the id. |
| 563 request.setRequestorID(GetRoutingID()); | 575 request.setRequestorID(render_view_->GetRoutingID()); |
| 564 request.setHasUserGesture(WebUserGestureIndicator::isProcessingUserGesture()); | 576 request.setHasUserGesture(WebUserGestureIndicator::isProcessingUserGesture()); |
| 565 | 577 |
| 566 if (!navigation_state->extra_headers().empty()) { | 578 if (!navigation_state->extra_headers().empty()) { |
| 567 for (net::HttpUtil::HeadersIterator i( | 579 for (net::HttpUtil::HeadersIterator i( |
| 568 navigation_state->extra_headers().begin(), | 580 navigation_state->extra_headers().begin(), |
| 569 navigation_state->extra_headers().end(), "\n"); | 581 navigation_state->extra_headers().end(), "\n"); |
| 570 i.GetNext(); ) { | 582 i.GetNext(); ) { |
| 571 request.setHTTPHeaderField(WebString::fromUTF8(i.name()), | 583 request.setHTTPHeaderField(WebString::fromUTF8(i.name()), |
| 572 WebString::fromUTF8(i.values())); | 584 WebString::fromUTF8(i.values())); |
| 573 } | 585 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 639 // The recipients of this message have no use for data: URLs: they don't | 651 // The recipients of this message have no use for data: URLs: they don't |
| 640 // affect the page's insecure content list and are not in the disk cache. To | 652 // affect the page's insecure content list and are not in the disk cache. To |
| 641 // prevent large (1M+) data: URLs from crashing in the IPC system, we simply | 653 // prevent large (1M+) data: URLs from crashing in the IPC system, we simply |
| 642 // filter them out here. | 654 // filter them out here. |
| 643 GURL url(request.url()); | 655 GURL url(request.url()); |
| 644 if (url.SchemeIs("data")) | 656 if (url.SchemeIs("data")) |
| 645 return; | 657 return; |
| 646 | 658 |
| 647 // Let the browser know we loaded a resource from the memory cache. This | 659 // Let the browser know we loaded a resource from the memory cache. This |
| 648 // message is needed to display the correct SSL indicators. | 660 // message is needed to display the correct SSL indicators. |
| 649 Send(new ViewHostMsg_DidLoadResourceFromMemoryCache( | 661 render_view_->Send(new ViewHostMsg_DidLoadResourceFromMemoryCache( |
| 650 GetRoutingID(), | 662 render_view_->GetRoutingID(), |
| 651 url, | 663 url, |
| 652 response.securityInfo(), | 664 response.securityInfo(), |
| 653 request.httpMethod().utf8(), | 665 request.httpMethod().utf8(), |
| 654 response.mimeType().utf8(), | 666 response.mimeType().utf8(), |
| 655 ResourceType::FromTargetType(request.targetType()))); | 667 ResourceType::FromTargetType(request.targetType()))); |
| 656 } | 668 } |
| 657 | 669 |
| 658 void RenderFrameImpl::didDisplayInsecureContent(WebKit::WebFrame* frame) { | 670 void RenderFrameImpl::didDisplayInsecureContent(WebKit::WebFrame* frame) { |
| 659 Send(new ViewHostMsg_DidDisplayInsecureContent(GetRoutingID())); | 671 render_view_->Send(new ViewHostMsg_DidDisplayInsecureContent( |
| 672 render_view_->GetRoutingID())); | |
| 660 } | 673 } |
| 661 | 674 |
| 662 void RenderFrameImpl::didRunInsecureContent( | 675 void RenderFrameImpl::didRunInsecureContent( |
| 663 WebKit::WebFrame* frame, | 676 WebKit::WebFrame* frame, |
| 664 const WebKit::WebSecurityOrigin& origin, | 677 const WebKit::WebSecurityOrigin& origin, |
| 665 const WebKit::WebURL& target) { | 678 const WebKit::WebURL& target) { |
| 666 Send(new ViewHostMsg_DidRunInsecureContent( | 679 render_view_->Send(new ViewHostMsg_DidRunInsecureContent( |
| 667 GetRoutingID(), | 680 render_view_->GetRoutingID(), |
| 668 origin.toString().utf8(), | 681 origin.toString().utf8(), |
| 669 target)); | 682 target)); |
| 670 } | 683 } |
| 671 | 684 |
| 672 void RenderFrameImpl::didExhaustMemoryAvailableForScript( | 685 void RenderFrameImpl::didExhaustMemoryAvailableForScript( |
| 673 WebKit::WebFrame* frame) { | 686 WebKit::WebFrame* frame) { |
| 674 Send(new ViewHostMsg_JSOutOfMemory(GetRoutingID())); | 687 render_view_->Send(new ViewHostMsg_JSOutOfMemory( |
| 688 render_view_->GetRoutingID())); | |
| 675 } | 689 } |
| 676 | 690 |
| 677 void RenderFrameImpl::didCreateScriptContext(WebKit::WebFrame* frame, | 691 void RenderFrameImpl::didCreateScriptContext(WebKit::WebFrame* frame, |
| 678 v8::Handle<v8::Context> context, | 692 v8::Handle<v8::Context> context, |
| 679 int extension_group, | 693 int extension_group, |
| 680 int world_id) { | 694 int world_id) { |
| 681 GetContentClient()->renderer()->DidCreateScriptContext( | 695 GetContentClient()->renderer()->DidCreateScriptContext( |
| 682 frame, context, extension_group, world_id); | 696 frame, context, extension_group, world_id); |
| 683 } | 697 } |
| 684 | 698 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 701 render_view_->didChangeContentsSize(frame, size); | 715 render_view_->didChangeContentsSize(frame, size); |
| 702 } | 716 } |
| 703 | 717 |
| 704 void RenderFrameImpl::didChangeScrollOffset(WebKit::WebFrame* frame) { | 718 void RenderFrameImpl::didChangeScrollOffset(WebKit::WebFrame* frame) { |
| 705 // TODO(nasko): Move implementation here. Needed methods: | 719 // TODO(nasko): Move implementation here. Needed methods: |
| 706 // * StartNavStateSyncTimerIfNecessary | 720 // * StartNavStateSyncTimerIfNecessary |
| 707 render_view_->didChangeScrollOffset(frame); | 721 render_view_->didChangeScrollOffset(frame); |
| 708 } | 722 } |
| 709 | 723 |
| 710 void RenderFrameImpl::willInsertBody(WebKit::WebFrame* frame) { | 724 void RenderFrameImpl::willInsertBody(WebKit::WebFrame* frame) { |
| 711 if (!frame->parent()) | 725 if (!frame->parent()) { |
| 712 Send(new ViewHostMsg_WillInsertBody(GetRoutingID())); | 726 render_view_->Send(new ViewHostMsg_WillInsertBody( |
| 727 render_view_->GetRoutingID())); | |
| 728 } | |
| 713 } | 729 } |
| 714 | 730 |
| 715 void RenderFrameImpl::reportFindInPageMatchCount(int request_id, | 731 void RenderFrameImpl::reportFindInPageMatchCount(int request_id, |
| 716 int count, | 732 int count, |
| 717 bool final_update) { | 733 bool final_update) { |
| 718 int active_match_ordinal = -1; // -1 = don't update active match ordinal | 734 int active_match_ordinal = -1; // -1 = don't update active match ordinal |
| 719 if (!count) | 735 if (!count) |
| 720 active_match_ordinal = 0; | 736 active_match_ordinal = 0; |
| 721 | 737 |
| 722 Send(new ViewHostMsg_Find_Reply(GetRoutingID(), | 738 render_view_->Send(new ViewHostMsg_Find_Reply( |
| 723 request_id, | 739 render_view_->GetRoutingID(), request_id, count, |
| 724 count, | 740 gfx::Rect(), active_match_ordinal, final_update)); |
| 725 gfx::Rect(), | |
| 726 active_match_ordinal, | |
| 727 final_update)); | |
| 728 } | 741 } |
| 729 | 742 |
| 730 void RenderFrameImpl::reportFindInPageSelection( | 743 void RenderFrameImpl::reportFindInPageSelection( |
| 731 int request_id, | 744 int request_id, |
| 732 int active_match_ordinal, | 745 int active_match_ordinal, |
| 733 const WebKit::WebRect& selection_rect) { | 746 const WebKit::WebRect& selection_rect) { |
| 734 Send(new ViewHostMsg_Find_Reply(GetRoutingID(), | 747 render_view_->Send(new ViewHostMsg_Find_Reply( |
| 735 request_id, | 748 render_view_->GetRoutingID(), request_id, -1, selection_rect, |
| 736 -1, | 749 active_match_ordinal, false)); |
| 737 selection_rect, | |
| 738 active_match_ordinal, | |
| 739 false)); | |
| 740 } | 750 } |
| 741 | 751 |
| 742 void RenderFrameImpl::openFileSystem( | 752 void RenderFrameImpl::openFileSystem( |
| 743 WebKit::WebFrame* frame, | 753 WebKit::WebFrame* frame, |
| 744 WebKit::WebFileSystemType type, | 754 WebKit::WebFileSystemType type, |
| 745 long long size, | 755 long long size, |
| 746 bool create, | 756 bool create, |
| 747 WebKit::WebFileSystemCallbacks* callbacks) { | 757 WebKit::WebFileSystemCallbacks* callbacks) { |
| 748 DCHECK(callbacks); | 758 DCHECK(callbacks); |
| 749 | 759 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 unsigned long long requested_size, | 796 unsigned long long requested_size, |
| 787 WebKit::WebStorageQuotaCallbacks* callbacks) { | 797 WebKit::WebStorageQuotaCallbacks* callbacks) { |
| 788 DCHECK(frame); | 798 DCHECK(frame); |
| 789 WebSecurityOrigin origin = frame->document().securityOrigin(); | 799 WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 790 if (origin.isUnique()) { | 800 if (origin.isUnique()) { |
| 791 // Unique origins cannot store persistent state. | 801 // Unique origins cannot store persistent state. |
| 792 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 802 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
| 793 return; | 803 return; |
| 794 } | 804 } |
| 795 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( | 805 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( |
| 796 GetRoutingID(), GURL(origin.toString()), | 806 render_view_->GetRoutingID(), GURL(origin.toString()), |
| 797 static_cast<quota::StorageType>(type), requested_size, | 807 static_cast<quota::StorageType>(type), requested_size, |
| 798 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 808 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 799 } | 809 } |
| 800 | 810 |
| 801 void RenderFrameImpl::willOpenSocketStream( | 811 void RenderFrameImpl::willOpenSocketStream( |
| 802 WebKit::WebSocketStreamHandle* handle) { | 812 WebKit::WebSocketStreamHandle* handle) { |
| 803 SocketStreamHandleData::AddToHandle(handle, GetRoutingID()); | 813 SocketStreamHandleData::AddToHandle(handle, render_view_->GetRoutingID()); |
| 804 } | 814 } |
| 805 | 815 |
| 806 void RenderFrameImpl::willStartUsingPeerConnectionHandler( | 816 void RenderFrameImpl::willStartUsingPeerConnectionHandler( |
| 807 WebKit::WebFrame* frame, | 817 WebKit::WebFrame* frame, |
| 808 WebKit::WebRTCPeerConnectionHandler* handler) { | 818 WebKit::WebRTCPeerConnectionHandler* handler) { |
| 809 #if defined(ENABLE_WEBRTC) | 819 #if defined(ENABLE_WEBRTC) |
| 810 static_cast<RTCPeerConnectionHandler*>(handler)->associateWithFrame(frame); | 820 static_cast<RTCPeerConnectionHandler*>(handler)->associateWithFrame(frame); |
| 811 #endif | 821 #endif |
| 812 } | 822 } |
| 813 | 823 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 851 if (render_view_->renderer_preferences_.enable_do_not_track) | 861 if (render_view_->renderer_preferences_.enable_do_not_track) |
| 852 return WebString::fromUTF8("1"); | 862 return WebString::fromUTF8("1"); |
| 853 return WebString(); | 863 return WebString(); |
| 854 } | 864 } |
| 855 | 865 |
| 856 bool RenderFrameImpl::allowWebGL(WebKit::WebFrame* frame, bool default_value) { | 866 bool RenderFrameImpl::allowWebGL(WebKit::WebFrame* frame, bool default_value) { |
| 857 if (!default_value) | 867 if (!default_value) |
| 858 return false; | 868 return false; |
| 859 | 869 |
| 860 bool blocked = true; | 870 bool blocked = true; |
| 861 Send(new ViewHostMsg_Are3DAPIsBlocked( | 871 render_view_->Send(new ViewHostMsg_Are3DAPIsBlocked( |
| 862 GetRoutingID(), | 872 render_view_->GetRoutingID(), |
| 863 GURL(frame->top()->document().securityOrigin().toString()), | 873 GURL(frame->top()->document().securityOrigin().toString()), |
| 864 THREE_D_API_TYPE_WEBGL, | 874 THREE_D_API_TYPE_WEBGL, |
| 865 &blocked)); | 875 &blocked)); |
| 866 return !blocked; | 876 return !blocked; |
| 867 } | 877 } |
| 868 | 878 |
| 869 void RenderFrameImpl::didLoseWebGLContext(WebKit::WebFrame* frame, | 879 void RenderFrameImpl::didLoseWebGLContext(WebKit::WebFrame* frame, |
| 870 int arb_robustness_status_code) { | 880 int arb_robustness_status_code) { |
| 871 Send(new ViewHostMsg_DidLose3DContext( | 881 render_view_->Send(new ViewHostMsg_DidLose3DContext( |
| 872 GURL(frame->top()->document().securityOrigin().toString()), | 882 GURL(frame->top()->document().securityOrigin().toString()), |
| 873 THREE_D_API_TYPE_WEBGL, | 883 THREE_D_API_TYPE_WEBGL, |
| 874 arb_robustness_status_code)); | 884 arb_robustness_status_code)); |
| 875 } | 885 } |
| 876 | 886 |
| 877 } // namespace content | 887 } // namespace content |
| OLD | NEW |