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 | |
424 *cloned_session_storage_namespace_id = | 414 *cloned_session_storage_namespace_id = |
425 dom_storage_context_->CloneSessionStorage( | 415 dom_storage_context_->CloneSessionStorage( |
426 params.session_storage_namespace_id); | 416 params.session_storage_namespace_id); |
427 #endif | |
428 | |
429 render_widget_helper_->CreateNewWindow(params, | 417 render_widget_helper_->CreateNewWindow(params, |
430 peer_handle(), | 418 peer_handle(), |
431 route_id, | 419 route_id, |
432 surface_id); | 420 surface_id); |
433 } | 421 } |
434 | 422 |
435 void RenderMessageFilter::OnMsgCreateWidget(int opener_id, | 423 void RenderMessageFilter::OnMsgCreateWidget(int opener_id, |
436 WebKit::WebPopupType popup_type, | 424 WebKit::WebPopupType popup_type, |
437 int* route_id, | 425 int* route_id, |
438 int* surface_id) { | 426 int* surface_id) { |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 // for a resize or if no backing store) the RenderWidgetHost is blocking the | 924 // for a resize or if no backing store) the RenderWidgetHost is blocking the |
937 // UI thread for some time, waiting for an UpdateRect from the renderer. If we | 925 // UI thread for some time, waiting for an UpdateRect from the renderer. If we |
938 // are going to switch to accelerated compositing, the GPU process may need | 926 // are going to switch to accelerated compositing, the GPU process may need |
939 // round-trips to the UI thread before finishing the frame, causing deadlocks | 927 // round-trips to the UI thread before finishing the frame, causing deadlocks |
940 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So | 928 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So |
941 // the renderer sent us this message, so that we can unblock the UI thread. | 929 // the renderer sent us this message, so that we can unblock the UI thread. |
942 // We will simply re-use the UpdateRect unblock mechanism, just with a | 930 // We will simply re-use the UpdateRect unblock mechanism, just with a |
943 // different message. | 931 // different message. |
944 render_widget_helper_->DidReceiveUpdateMsg(msg); | 932 render_widget_helper_->DidReceiveUpdateMsg(msg); |
945 } | 933 } |
OLD | NEW |