| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 int64* cloned_session_storage_namespace_id) { | 404 int64* cloned_session_storage_namespace_id) { |
| 405 if (!content::GetContentClient()->browser()->CanCreateWindow( | 405 if (!content::GetContentClient()->browser()->CanCreateWindow( |
| 406 GURL(params.opener_url), GURL(params.opener_security_origin), | 406 GURL(params.opener_url), GURL(params.opener_security_origin), |
| 407 params.window_container_type, resource_context_, | 407 params.window_container_type, resource_context_, |
| 408 render_process_id_)) { | 408 render_process_id_)) { |
| 409 *route_id = MSG_ROUTING_NONE; | 409 *route_id = MSG_ROUTING_NONE; |
| 410 *surface_id = 0; | 410 *surface_id = 0; |
| 411 return; | 411 return; |
| 412 } | 412 } |
| 413 | 413 |
| 414 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND |
| 415 // TODO(michaeln): Fix this. |
| 416 // This is a bug in the existing impl, session storage is effectively |
| 417 // leaked when created thru this code path (window.open()) since there |
| 418 // is no balancing DeleteSessionStorage() for this Clone() call anywhere |
| 419 // in the codebase. I'm replicating the bug for now. |
| 420 *cloned_session_storage_namespace_id = |
| 421 dom_storage_context_->LeakyCloneSessionStorage( |
| 422 params.session_storage_namespace_id); |
| 423 #else |
| 414 *cloned_session_storage_namespace_id = | 424 *cloned_session_storage_namespace_id = |
| 415 dom_storage_context_->CloneSessionStorage( | 425 dom_storage_context_->CloneSessionStorage( |
| 416 params.session_storage_namespace_id); | 426 params.session_storage_namespace_id); |
| 427 #endif |
| 428 |
| 417 render_widget_helper_->CreateNewWindow(params, | 429 render_widget_helper_->CreateNewWindow(params, |
| 418 peer_handle(), | 430 peer_handle(), |
| 419 route_id, | 431 route_id, |
| 420 surface_id); | 432 surface_id); |
| 421 } | 433 } |
| 422 | 434 |
| 423 void RenderMessageFilter::OnMsgCreateWidget(int opener_id, | 435 void RenderMessageFilter::OnMsgCreateWidget(int opener_id, |
| 424 WebKit::WebPopupType popup_type, | 436 WebKit::WebPopupType popup_type, |
| 425 int* route_id, | 437 int* route_id, |
| 426 int* surface_id) { | 438 int* surface_id) { |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 // for a resize or if no backing store) the RenderWidgetHost is blocking the | 936 // for a resize or if no backing store) the RenderWidgetHost is blocking the |
| 925 // UI thread for some time, waiting for an UpdateRect from the renderer. If we | 937 // UI thread for some time, waiting for an UpdateRect from the renderer. If we |
| 926 // are going to switch to accelerated compositing, the GPU process may need | 938 // are going to switch to accelerated compositing, the GPU process may need |
| 927 // round-trips to the UI thread before finishing the frame, causing deadlocks | 939 // round-trips to the UI thread before finishing the frame, causing deadlocks |
| 928 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So | 940 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So |
| 929 // the renderer sent us this message, so that we can unblock the UI thread. | 941 // the renderer sent us this message, so that we can unblock the UI thread. |
| 930 // We will simply re-use the UpdateRect unblock mechanism, just with a | 942 // We will simply re-use the UpdateRect unblock mechanism, just with a |
| 931 // different message. | 943 // different message. |
| 932 render_widget_helper_->DidReceiveUpdateMsg(msg); | 944 render_widget_helper_->DidReceiveUpdateMsg(msg); |
| 933 } | 945 } |
| OLD | NEW |