Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1487)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 647613002: Fix RenderWidgetHostViewGuest leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bring back mac delegate() Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // to initialize the browser-side state now so that the RenderFrameHostManager 531 // to initialize the browser-side state now so that the RenderFrameHostManager
532 // does not create a new RenderView on navigation. 532 // does not create a new RenderView on navigation.
533 if (has_render_view_) { 533 if (has_render_view_) {
534 // This will trigger a callback to RenderViewReady after a round-trip IPC. 534 // This will trigger a callback to RenderViewReady after a round-trip IPC.
535 static_cast<RenderViewHostImpl*>( 535 static_cast<RenderViewHostImpl*>(
536 GetWebContents()->GetRenderViewHost())->Init(); 536 GetWebContents()->GetRenderViewHost())->Init();
537 WebContentsViewGuest* web_contents_view = 537 WebContentsViewGuest* web_contents_view =
538 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); 538 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
539 if (!web_contents()->GetRenderViewHost()->GetView()) { 539 if (!web_contents()->GetRenderViewHost()->GetView()) {
540 web_contents_view->CreateViewForWidget( 540 web_contents_view->CreateViewForWidget(
541 web_contents()->GetRenderViewHost()); 541 web_contents()->GetRenderViewHost(), true);
542 } 542 }
543 } 543 }
544 544
545 Initialize(browser_plugin_instance_id, params, embedder_web_contents); 545 Initialize(browser_plugin_instance_id, params, embedder_web_contents);
546 546
547 SendQueuedMessages(); 547 SendQueuedMessages();
548 548
549 // Create a swapped out RenderView for the guest in the embedder render 549 // Create a swapped out RenderView for the guest in the embedder render
550 // process, so that the embedder can access the guest's window object. 550 // process, so that the embedder can access the guest's window object.
551 // On reattachment, we can reuse the same swapped out RenderView because 551 // On reattachment, we can reuse the same swapped out RenderView because
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 void BrowserPluginGuest::OnImeCompositionRangeChanged( 813 void BrowserPluginGuest::OnImeCompositionRangeChanged(
814 const gfx::Range& range, 814 const gfx::Range& range,
815 const std::vector<gfx::Rect>& character_bounds) { 815 const std::vector<gfx::Rect>& character_bounds) {
816 static_cast<RenderWidgetHostViewBase*>( 816 static_cast<RenderWidgetHostViewBase*>(
817 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( 817 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged(
818 range, character_bounds); 818 range, character_bounds);
819 } 819 }
820 #endif 820 #endif
821 821
822 } // namespace content 822 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698