- Revision
- 114295
- Author
- ander...@apple.com
- Date
- 2012-04-16 14:02:49 -0700 (Mon, 16 Apr 2012)
Log Message
Nightly Back/Forward no longer calls plug-in's NPP_NewStream
https://bugs.webkit.org/show_bug.cgi?id=83805
<rdar://problem/11238748>
Reviewed by Simon Fraser.
When a page with a full-frame plug-in is restored from the page cache, it needs to re-fetch the plug-in stream.
Fix this by breaking the assumption that a plug-in will always get its data from WebCore if it's a full-frame plug-in;
instead it only get its data from WebCore if it's a full-frame plug-in that's not being restored from the page cache.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin):
Rename m_loadManually to m_shouldUseManualLoader.
(WebKit::NetscapePlugin::initialize):
Get the mode from parameters.isFullFramePlugin instead.
(WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
(WebKit::NetscapePlugin::manualStreamDidReceiveData):
(WebKit::NetscapePlugin::manualStreamDidFinishLoading):
(WebKit::NetscapePlugin::manualStreamDidFail):
Rename m_loadManually to m_shouldUseManualLoader.
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
Rename m_loadManually to m_shouldUseManualLoader.
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::Parameters::encode):
(WebKit::Plugin::Parameters::decode):
* WebProcess/Plugins/Plugin.h:
(Parameters):
Add an extra isFullFramePlugin parameter, and rename loadManually to shouldUseManualLoader.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
Initialize m_frameCameFromPageCache.
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
Set m_frameCameFromPageCache to true.
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Set m_frameCameFromPageCache to false.
(WebKit::WebFrameLoaderClient::createPlugin):
Initialize isFullFramePlugin and shouldUseManualLoader.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (114294 => 114295)
--- trunk/Source/WebKit2/ChangeLog 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/ChangeLog 2012-04-16 21:02:49 UTC (rev 114295)
@@ -1,3 +1,52 @@
+2012-04-16 Anders Carlsson <ander...@apple.com>
+
+ Nightly Back/Forward no longer calls plug-in's NPP_NewStream
+ https://bugs.webkit.org/show_bug.cgi?id=83805
+ <rdar://problem/11238748>
+
+ Reviewed by Simon Fraser.
+
+ When a page with a full-frame plug-in is restored from the page cache, it needs to re-fetch the plug-in stream.
+
+ Fix this by breaking the assumption that a plug-in will always get its data from WebCore if it's a full-frame plug-in;
+ instead it only get its data from WebCore if it's a full-frame plug-in that's not being restored from the page cache.
+
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::NetscapePlugin):
+ Rename m_loadManually to m_shouldUseManualLoader.
+
+ (WebKit::NetscapePlugin::initialize):
+ Get the mode from parameters.isFullFramePlugin instead.
+
+ (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
+ (WebKit::NetscapePlugin::manualStreamDidReceiveData):
+ (WebKit::NetscapePlugin::manualStreamDidFinishLoading):
+ (WebKit::NetscapePlugin::manualStreamDidFail):
+ Rename m_loadManually to m_shouldUseManualLoader.
+
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ Rename m_loadManually to m_shouldUseManualLoader.
+
+ * WebProcess/Plugins/Plugin.cpp:
+ (WebKit::Plugin::Parameters::encode):
+ (WebKit::Plugin::Parameters::decode):
+ * WebProcess/Plugins/Plugin.h:
+ (Parameters):
+ Add an extra isFullFramePlugin parameter, and rename loadManually to shouldUseManualLoader.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
+ Initialize m_frameCameFromPageCache.
+
+ (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
+ Set m_frameCameFromPageCache to true.
+
+ (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+ Set m_frameCameFromPageCache to false.
+
+ (WebKit::WebFrameLoaderClient::createPlugin):
+ Initialize isFullFramePlugin and shouldUseManualLoader.
+
2012-04-16 Alexey Proskuryakov <a...@apple.com>
EndPrinting message should be sent synchronously when printing was initiated from DOM.
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2012-04-16 21:02:49 UTC (rev 114295)
@@ -68,7 +68,7 @@
#endif
, m_isTransparent(false)
, m_inNPPNew(false)
- , m_loadManually(false)
+ , m_shouldUseManualLoader(false)
, m_nextTimerID(0)
#if PLATFORM(MAC)
, m_drawingModel(static_cast<NPDrawingModel>(-1))
@@ -543,9 +543,9 @@
bool NetscapePlugin::initialize(const Parameters& parameters)
{
- uint16_t mode = parameters.loadManually ? NP_FULL : NP_EMBED;
+ uint16_t mode = parameters.isFullFramePlugin ? NP_FULL : NP_EMBED;
- m_loadManually = parameters.loadManually;
+ m_shouldUseManualLoader = parameters.shouldUseManualLoader;
CString mimeTypeCString = parameters.mimeType.utf8();
@@ -611,7 +611,7 @@
}
// Load the src URL if needed.
- if (!parameters.loadManually && !parameters.url.isEmpty() && shouldLoadSrcURL())
+ if (!parameters.shouldUseManualLoader && !parameters.url.isEmpty() && shouldLoadSrcURL())
loadURL("GET", parameters.url.string(), String(), HTTPHeaderMap(), Vector<uint8_t>(), false, 0);
return true;
@@ -787,7 +787,7 @@
const String& mimeType, const String& headers, const String& /* suggestedFileName */)
{
ASSERT(m_isStarted);
- ASSERT(m_loadManually);
+ ASSERT(m_shouldUseManualLoader);
ASSERT(!m_manualStream);
m_manualStream = NetscapePluginStream::create(this, 0, responseURL.string(), false, 0);
@@ -797,7 +797,7 @@
void NetscapePlugin::manualStreamDidReceiveData(const char* bytes, int length)
{
ASSERT(m_isStarted);
- ASSERT(m_loadManually);
+ ASSERT(m_shouldUseManualLoader);
ASSERT(m_manualStream);
m_manualStream->didReceiveData(bytes, length);
@@ -806,7 +806,7 @@
void NetscapePlugin::manualStreamDidFinishLoading()
{
ASSERT(m_isStarted);
- ASSERT(m_loadManually);
+ ASSERT(m_shouldUseManualLoader);
ASSERT(m_manualStream);
m_manualStream->didFinishLoading();
@@ -815,7 +815,7 @@
void NetscapePlugin::manualStreamDidFail(bool wasCancelled)
{
ASSERT(m_isStarted);
- ASSERT(m_loadManually);
+ ASSERT(m_shouldUseManualLoader);
if (!m_manualStream)
return;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2012-04-16 21:02:49 UTC (rev 114295)
@@ -263,7 +263,7 @@
bool m_isWindowed;
bool m_isTransparent;
bool m_inNPPNew;
- bool m_loadManually;
+ bool m_shouldUseManualLoader;
RefPtr<NetscapePluginStream> m_manualStream;
Vector<bool, 8> m_popupEnabledStates;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp 2012-04-16 21:02:49 UTC (rev 114295)
@@ -331,7 +331,7 @@
{
// Load the src URL if needed.
m_sourceURL = parameters.url;
- if (!parameters.loadManually && !parameters.url.isEmpty())
+ if (!parameters.shouldUseManualLoader && !parameters.url.isEmpty())
controller()->loadURL(pdfDocumentRequestID, "GET", parameters.url.string(), String(), HTTPHeaderMap(), Vector<uint8_t>(), false);
return true;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Plugin.cpp (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/Plugins/Plugin.cpp 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Plugin.cpp 2012-04-16 21:02:49 UTC (rev 114295)
@@ -38,7 +38,8 @@
encoder->encode(names);
encoder->encode(values);
encoder->encode(mimeType);
- encoder->encode(loadManually);
+ encoder->encode(isFullFramePlugin);
+ encoder->encode(shouldUseManualLoader);
#if PLATFORM(MAC)
encoder->encodeEnum(layerHostingMode);
#endif
@@ -58,8 +59,10 @@
return false;
if (!decoder->decode(parameters.mimeType))
return false;
- if (!decoder->decode(parameters.loadManually))
+ if (!decoder->decode(parameters.isFullFramePlugin))
return false;
+ if (!decoder->decode(parameters.shouldUseManualLoader))
+ return false;
#if PLATFORM(MAC)
if (!decoder->decodeEnum(parameters.layerHostingMode))
return false;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h 2012-04-16 21:02:49 UTC (rev 114295)
@@ -68,7 +68,8 @@
Vector<String> names;
Vector<String> values;
String mimeType;
- bool loadManually;
+ bool isFullFramePlugin;
+ bool shouldUseManualLoader;
#if PLATFORM(MAC)
LayerHostingMode layerHostingMode;
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2012-04-16 21:02:49 UTC (rev 114295)
@@ -78,6 +78,7 @@
: m_frame(frame)
, m_hasSentResponseToPluginView(false)
, m_frameHasCustomRepresentation(false)
+ , m_frameCameFromPageCache(false)
{
}
@@ -1165,6 +1166,7 @@
const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
+ m_frameCameFromPageCache = true;
}
void WebFrameLoaderClient::transitionToCommittedForNewPage()
@@ -1177,6 +1179,7 @@
const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
+ m_frameCameFromPageCache = false;
m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), shouldUseFixedLayout);
m_frame->coreFrame()->view()->setTransparent(!webPage->drawsBackground());
@@ -1267,7 +1270,8 @@
parameters.names = paramNames;
parameters.values = paramValues;
parameters.mimeType = mimeType;
- parameters.loadManually = loadManually;
+ parameters.isFullFramePlugin = loadManually;
+ parameters.shouldUseManualLoader = parameters.isFullFramePlugin && !m_frameCameFromPageCache;
#if PLATFORM(MAC)
parameters.layerHostingMode = webPage->layerHostingMode();
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (114294 => 114295)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h 2012-04-16 20:57:35 UTC (rev 114294)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h 2012-04-16 21:02:49 UTC (rev 114295)
@@ -221,6 +221,7 @@
RefPtr<PluginView> m_pluginView;
bool m_hasSentResponseToPluginView;
bool m_frameHasCustomRepresentation;
+ bool m_frameCameFromPageCache;
};
} // namespace WebKit