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

Unified Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Issue 2719333002: second stage
Patch Set: Need to get around resource loading without web/ Created 3 years, 10 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
Index: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
index 41a2aaa9f7a45d2594d77b50b94e509f347094b1..2aed1cb15d2ef50753a3f0d4fd9f15c292c703e3 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -29,6 +29,7 @@
#include "core/dom/Node.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
+#include "core/frame/Frame.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
@@ -45,6 +46,7 @@
#include "core/loader/MixedContentChecker.h"
#include "core/page/Page.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
+#include "core/plugins/PluginClient.h"
#include "core/plugins/PluginView.h"
#include "platform/Histogram.h"
#include "platform/Widget.h"
@@ -93,6 +95,7 @@ HTMLPlugInElement::~HTMLPlugInElement() {
DEFINE_TRACE(HTMLPlugInElement) {
visitor->trace(m_imageLoader);
visitor->trace(m_persistedPluginWidget);
+ visitor->trace(m_pluginClient);
HTMLFrameOwnerElement::trace(visitor);
}
@@ -136,6 +139,9 @@ bool HTMLPlugInElement::requestObjectInternal(
return loadOrRedirectSubframe(completedURL, getNameAttribute(), true);
}
+ if (loadFrame(completedURL))
+ return true;
+
return loadPlugin(completedURL, mimeType, paramNames, paramValues,
useFallback, true);
}
@@ -322,6 +328,11 @@ SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() {
// return the cached allocated Bindings::Instance. Not supporting this
// edge-case is OK.
if (!m_pluginWrapper) {
+ if (m_pluginClient) {
+ m_pluginWrapper = frame->script().createPluginWrapper(m_pluginClient);
+ return m_pluginWrapper.get();
+ }
+
Widget* plugin;
if (m_persistedPluginWidget)
@@ -329,8 +340,9 @@ SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() {
else
plugin = pluginWidget();
- if (plugin)
+ if (plugin && plugin->isPluginView()) {
m_pluginWrapper = frame->script().createPluginWrapper(plugin);
+ }
}
return m_pluginWrapper.get();
}
@@ -498,6 +510,15 @@ bool HTMLPlugInElement::requestObject(const String& url,
return result;
}
+bool HTMLPlugInElement::loadFrame(const KURL& url) {
+ LocalFrame* frame = document().frame();
+ if (!frame)
+ return false;
+ m_pluginClient = frame->loader().client()->createPluginClient(
+ this, url, mimeTypeFromURL(url));
+ return m_pluginClient;
+}
+
bool HTMLPlugInElement::loadPlugin(const KURL& url,
const String& mimeType,
const Vector<String>& paramNames,
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLPlugInElement.h ('k') | third_party/WebKit/Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698