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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11046002: Browser Plugin: Fixed browser process crash on embedder reload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Alternative behavior to match Istiaque's previous implementation of NavigateGuest Created 8 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 | Annotate | Revision Log
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 int instance_id, 2372 int instance_id,
2373 const std::string& storage_partition_id, 2373 const std::string& storage_partition_id,
2374 bool persist_storage) { 2374 bool persist_storage) {
2375 // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin 2375 // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin
2376 // specific messages for this WebContents (through its 2376 // specific messages for this WebContents (through its
2377 // BrowserPluginEmbedderHelper). This means that any message from browser 2377 // BrowserPluginEmbedderHelper). This means that any message from browser
2378 // plugin renderer prior to CreateGuest will be ignored. 2378 // plugin renderer prior to CreateGuest will be ignored.
2379 // For more info, see comment above classes BrowserPluginEmbedder and 2379 // For more info, see comment above classes BrowserPluginEmbedder and
2380 // BrowserPluginGuest. 2380 // BrowserPluginGuest.
2381 CHECK(!browser_plugin_embedder_.get()); 2381 CHECK(!browser_plugin_embedder_.get());
2382
2383 browser_plugin_embedder_.reset( 2382 browser_plugin_embedder_.reset(
2384 content::BrowserPluginEmbedder::Create(this, GetRenderViewHost())); 2383 content::BrowserPluginEmbedder::Create(this, GetRenderViewHost()));
2385 browser_plugin_embedder_->CreateGuest(GetRenderViewHost(), 2384 browser_plugin_embedder_->CreateGuest(GetRenderViewHost(),
2386 instance_id, 2385 instance_id,
2387 storage_partition_id, 2386 storage_partition_id,
2388 persist_storage); 2387 persist_storage);
2389 } 2388 }
2390 2389
2391 void WebContentsImpl::OnBrowserPluginNavigateGuest(
2392 int instance_id,
2393 const std::string& src,
2394 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) {
2395 browser_plugin_embedder_->NavigateGuest(GetRenderViewHost(),
2396 instance_id,
2397 src,
2398 resize_params);
2399 }
2400
2401 // Notifies the RenderWidgetHost instance about the fact that the page is 2390 // Notifies the RenderWidgetHost instance about the fact that the page is
2402 // loading, or done loading and calls the base implementation. 2391 // loading, or done loading and calls the base implementation.
2403 void WebContentsImpl::SetIsLoading(bool is_loading, 2392 void WebContentsImpl::SetIsLoading(bool is_loading,
2404 LoadNotificationDetails* details) { 2393 LoadNotificationDetails* details) {
2405 if (is_loading == is_loading_) 2394 if (is_loading == is_loading_)
2406 return; 2395 return;
2407 2396
2408 if (!is_loading) { 2397 if (!is_loading) {
2409 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); 2398 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16());
2410 load_state_host_.clear(); 2399 load_state_host_.clear();
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 } 3379 }
3391 } 3380 }
3392 3381
3393 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3382 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3394 return browser_plugin_guest_.get(); 3383 return browser_plugin_guest_.get();
3395 } 3384 }
3396 3385
3397 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3386 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3398 return browser_plugin_embedder_.get(); 3387 return browser_plugin_embedder_.get();
3399 } 3388 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698