OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void RenderMessageFilter::OnDestruct() const { | 390 void RenderMessageFilter::OnDestruct() const { |
391 BrowserThread::DeleteOnIOThread::Destruct(this); | 391 BrowserThread::DeleteOnIOThread::Destruct(this); |
392 } | 392 } |
393 | 393 |
394 bool RenderMessageFilter::OffTheRecord() const { | 394 bool RenderMessageFilter::OffTheRecord() const { |
395 return incognito_; | 395 return incognito_; |
396 } | 396 } |
397 | 397 |
398 void RenderMessageFilter::OnMsgCreateWindow( | 398 void RenderMessageFilter::OnMsgCreateWindow( |
399 const ViewHostMsg_CreateWindow_Params& params, | 399 const ViewHostMsg_CreateWindow_Params& params, |
400 int* route_id, int64* cloned_session_storage_namespace_id) { | 400 int* route_id, |
| 401 int* surface_id, |
| 402 int64* cloned_session_storage_namespace_id) { |
401 if (!content::GetContentClient()->browser()->CanCreateWindow( | 403 if (!content::GetContentClient()->browser()->CanCreateWindow( |
402 GURL(params.opener_security_origin), params.window_container_type, | 404 GURL(params.opener_security_origin), params.window_container_type, |
403 resource_context_, render_process_id_)) { | 405 resource_context_, render_process_id_)) { |
404 *route_id = MSG_ROUTING_NONE; | 406 *route_id = MSG_ROUTING_NONE; |
| 407 *surface_id = 0; |
405 return; | 408 return; |
406 } | 409 } |
407 | 410 |
408 *cloned_session_storage_namespace_id = | 411 *cloned_session_storage_namespace_id = |
409 webkit_context_->dom_storage_context()->CloneSessionStorage( | 412 webkit_context_->dom_storage_context()->CloneSessionStorage( |
410 params.session_storage_namespace_id); | 413 params.session_storage_namespace_id); |
411 render_widget_helper_->CreateNewWindow(params, | 414 render_widget_helper_->CreateNewWindow(params, |
412 peer_handle(), | 415 peer_handle(), |
413 route_id); | 416 route_id, |
| 417 surface_id); |
414 } | 418 } |
415 | 419 |
416 void RenderMessageFilter::OnMsgCreateWidget(int opener_id, | 420 void RenderMessageFilter::OnMsgCreateWidget(int opener_id, |
417 WebKit::WebPopupType popup_type, | 421 WebKit::WebPopupType popup_type, |
418 int* route_id) { | 422 int* route_id, |
419 render_widget_helper_->CreateNewWidget(opener_id, popup_type, route_id); | 423 int* surface_id) { |
| 424 render_widget_helper_->CreateNewWidget( |
| 425 opener_id, popup_type, route_id, surface_id); |
420 } | 426 } |
421 | 427 |
422 void RenderMessageFilter::OnMsgCreateFullscreenWidget(int opener_id, | 428 void RenderMessageFilter::OnMsgCreateFullscreenWidget(int opener_id, |
423 int* route_id) { | 429 int* route_id, |
424 render_widget_helper_->CreateNewFullscreenWidget(opener_id, route_id); | 430 int* surface_id) { |
| 431 render_widget_helper_->CreateNewFullscreenWidget( |
| 432 opener_id, route_id, surface_id); |
425 } | 433 } |
426 | 434 |
427 void RenderMessageFilter::OnSetCookie(const IPC::Message& message, | 435 void RenderMessageFilter::OnSetCookie(const IPC::Message& message, |
428 const GURL& url, | 436 const GURL& url, |
429 const GURL& first_party_for_cookies, | 437 const GURL& first_party_for_cookies, |
430 const std::string& cookie) { | 438 const std::string& cookie) { |
431 ChildProcessSecurityPolicy* policy = | 439 ChildProcessSecurityPolicy* policy = |
432 ChildProcessSecurityPolicy::GetInstance(); | 440 ChildProcessSecurityPolicy::GetInstance(); |
433 if (!policy->CanUseCookiesForOrigin(render_process_id_, url)) | 441 if (!policy->CanUseCookiesForOrigin(render_process_id_, url)) |
434 return; | 442 return; |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 // for a resize or if no backing store) the RenderWidgetHost is blocking the | 914 // for a resize or if no backing store) the RenderWidgetHost is blocking the |
907 // UI thread for some time, waiting for an UpdateRect from the renderer. If we | 915 // UI thread for some time, waiting for an UpdateRect from the renderer. If we |
908 // are going to switch to accelerated compositing, the GPU process may need | 916 // are going to switch to accelerated compositing, the GPU process may need |
909 // round-trips to the UI thread before finishing the frame, causing deadlocks | 917 // round-trips to the UI thread before finishing the frame, causing deadlocks |
910 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So | 918 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So |
911 // the renderer sent us this message, so that we can unblock the UI thread. | 919 // the renderer sent us this message, so that we can unblock the UI thread. |
912 // We will simply re-use the UpdateRect unblock mechanism, just with a | 920 // We will simply re-use the UpdateRect unblock mechanism, just with a |
913 // different message. | 921 // different message. |
914 render_widget_helper_->DidReceiveUpdateMsg(msg); | 922 render_widget_helper_->DidReceiveUpdateMsg(msg); |
915 } | 923 } |
OLD | NEW |