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

Side by Side Diff: webkit/glue/webframeloaderclient_impl.cc

Issue 211008: Fix plugin crash caused by removal of EMBED element during NPP_New.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « no previous file | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "config.h" 5 #include "config.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "Chrome.h" 10 #include "Chrome.h"
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 if (!webplugin) 1220 if (!webplugin)
1221 return NULL; 1221 return NULL;
1222 1222
1223 // The container takes ownership of the WebPlugin. 1223 // The container takes ownership of the WebPlugin.
1224 RefPtr<WebPluginContainerImpl> container = 1224 RefPtr<WebPluginContainerImpl> container =
1225 WebPluginContainerImpl::create(element, webplugin); 1225 WebPluginContainerImpl::create(element, webplugin);
1226 1226
1227 if (!webplugin->initialize(container.get())) 1227 if (!webplugin->initialize(container.get()))
1228 return NULL; 1228 return NULL;
1229 1229
1230 // The element might have been removed during plugin initialization!
1231 if (!element->renderer())
1232 return NULL;
1233
1230 return container; 1234 return container;
1231 } 1235 }
1232 1236
1233 // This method gets called when a plugin is put in place of html content 1237 // This method gets called when a plugin is put in place of html content
1234 // (e.g., acrobat reader). 1238 // (e.g., acrobat reader).
1235 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) { 1239 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) {
1236 plugin_widget_ = static_cast<WebPluginContainerImpl*>(pluginWidget); 1240 plugin_widget_ = static_cast<WebPluginContainerImpl*>(pluginWidget);
1237 DCHECK(plugin_widget_.get()); 1241 DCHECK(plugin_widget_.get());
1238 } 1242 }
1239 1243
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 WebViewImpl* webview = webframe_->GetWebViewImpl(); 1335 WebViewImpl* webview = webframe_->GetWebViewImpl();
1332 if (webview->client()) 1336 if (webview->client())
1333 webview->client()->navigateBackForwardSoon(offset); 1337 webview->client()->navigateBackForwardSoon(offset);
1334 } 1338 }
1335 1339
1336 PassOwnPtr<WebPluginLoadObserver> WebFrameLoaderClient::GetPluginLoadObserver() { 1340 PassOwnPtr<WebPluginLoadObserver> WebFrameLoaderClient::GetPluginLoadObserver() {
1337 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( 1341 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(
1338 webframe_->frame()->loader()->activeDocumentLoader()); 1342 webframe_->frame()->loader()->activeDocumentLoader());
1339 return ds->releasePluginLoadObserver(); 1343 return ds->releasePluginLoadObserver();
1340 } 1344 }
OLDNEW
« no previous file with comments | « no previous file | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698