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

Unified Diff: components/plugins/renderer/webview_plugin.cc

Issue 1148223004: Plugin Placeholders: Factor out common BindWebFrame method into base class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/plugins/renderer/plugin_placeholder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/webview_plugin.cc
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 6200094c08b4ac6035218dddb1c50cad9f0133df..6ecab2c8d838e17ea4de6f47f3736f062119ef5d 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -45,7 +45,7 @@ using content::WebPreferences;
WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate,
const WebPreferences& preferences)
: delegate_(delegate),
- container_(NULL),
+ container_(nullptr),
web_view_(WebView::create(this)),
finished_loading_(false),
focused_(false) {
@@ -61,6 +61,7 @@ WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate,
const WebPreferences& preferences,
const std::string& html_data,
const GURL& url) {
+ DCHECK(url.is_valid()) << "Blink requires the WebView to have a valid URL.";
WebViewPlugin* plugin = new WebViewPlugin(delegate, preferences);
plugin->web_view()->mainFrame()->loadHTMLString(html_data, url);
return plugin;
@@ -122,9 +123,9 @@ bool WebViewPlugin::initialize(WebPluginContainer* container) {
void WebViewPlugin::destroy() {
if (delegate_) {
delegate_->PluginDestroyed();
- delegate_ = NULL;
+ delegate_ = nullptr;
}
- container_ = NULL;
+ container_ = nullptr;
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
@@ -261,6 +262,7 @@ void WebViewPlugin::scheduleAnimation() {
}
void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) {
+ DCHECK_EQ(web_frame_, frame);
if (delegate_)
delegate_->BindWebFrame(frame);
}
« no previous file with comments | « components/plugins/renderer/plugin_placeholder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698