Diff
Modified: trunk/Source/WebKit2/ChangeLog (99092 => 99093)
--- trunk/Source/WebKit2/ChangeLog 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/ChangeLog 2011-11-02 20:57:32 UTC (rev 99093)
@@ -1,5 +1,37 @@
2011-11-02 Anders Carlsson <[email protected]>
+ Fix non-Mac builds and remove #if PLATFORM(MAC) around all contents scale factor functions.
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::PluginControllerProxy):
+ (WebKit::PluginControllerProxy::contentsScaleFactor):
+ (WebKit::PluginControllerProxy::geometryDidChange):
+ * PluginProcess/PluginControllerProxy.h:
+ * PluginProcess/PluginCreationParameters.cpp:
+ (WebKit::PluginCreationParameters::PluginCreationParameters):
+ (WebKit::PluginCreationParameters::encode):
+ (WebKit::PluginCreationParameters::decode):
+ * PluginProcess/PluginCreationParameters.h:
+ * PluginProcess/mac/PluginControllerProxyMac.mm:
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::contentsScaleFactor):
+ (WebKit::NetscapePlugin::getAuthenticationInfo):
+ (WebKit::NetscapePlugin::snapshot):
+ (WebKit::NetscapePlugin::contentsScaleFactorChanged):
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+ * WebProcess/Plugins/Plugin.h:
+ * WebProcess/Plugins/PluginController.h:
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::initialize):
+ (WebKit::PluginProxy::contentsScaleFactorChanged):
+ (WebKit::PluginProxy::contentsScaleFactor):
+ * WebProcess/Plugins/PluginProxy.h:
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::contentsScaleFactor):
+
+2011-11-02 Anders Carlsson <[email protected]>
+
Use m_pluginSize instead of m_frameRectInWindowCoordinates.size() in NetscapePlugin.
https://bugs.webkit.org/show_bug.cgi?id=71390
Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp (99092 => 99093)
--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp 2011-11-02 20:57:32 UTC (rev 99093)
@@ -70,8 +70,8 @@
, m_pluginCanceledManualStreamLoad(false)
#if PLATFORM(MAC)
, m_isComplexTextInputEnabled(false)
+#endif
, m_contentsScaleFactor(creationParameters.contentsScaleFactor)
-#endif
, m_windowNPObject(0)
, m_pluginElementNPObject(0)
{
@@ -370,6 +370,11 @@
ASSERT_NOT_REACHED();
}
+float PluginControllerProxy::contentsScaleFactor()
+{
+ return m_contentsScaleFactor;
+}
+
String PluginControllerProxy::proxiesForURL(const String& urlString)
{
String proxyString;
@@ -438,14 +443,10 @@
m_pluginSize = pluginSize;
m_frameRectInWindowCoordinates = frameRectInWindowCoordinates;
-#if PLATFORM(MAC)
if (contentsScaleFactor != m_contentsScaleFactor) {
m_contentsScaleFactor = contentsScaleFactor;
m_plugin->contentsScaleFactorChanged(m_contentsScaleFactor);
}
-#else
- UNUSED_PARAM(contentsScaleFactor);
-#endif
platformGeometryDidChange();
Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h (99092 => 99093)
--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h 2011-11-02 20:57:32 UTC (rev 99093)
@@ -99,9 +99,9 @@
virtual void pluginFocusOrWindowFocusChanged(bool);
virtual void setComplexTextInputState(PluginComplexTextInputState);
virtual mach_port_t compositingRenderServerPort();
- virtual float contentsScaleFactor();
#endif
+ virtual float contentsScaleFactor();
virtual String proxiesForURL(const String&);
virtual String cookiesForURL(const String&);
virtual void setCookiesForURL(const String& urlString, const String& cookieString);
Modified: trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.cpp (99092 => 99093)
--- trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.cpp 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.cpp 2011-11-02 20:57:32 UTC (rev 99093)
@@ -35,13 +35,11 @@
PluginCreationParameters::PluginCreationParameters()
: pluginInstanceID(0)
, windowNPObjectID(0)
+ , contentsScaleFactor(1)
, isPrivateBrowsingEnabled(false)
#if USE(ACCELERATED_COMPOSITING)
, isAcceleratedCompositingEnabled(false)
#endif
-#if PLATFORM(MAC)
- , contentsScaleFactor(1)
-#endif
{
}
@@ -51,15 +49,12 @@
encoder->encode(windowNPObjectID);
encoder->encode(parameters);
encoder->encode(userAgent);
+ encoder->encode(contentsScaleFactor);
encoder->encode(isPrivateBrowsingEnabled);
#if USE(ACCELERATED_COMPOSITING)
encoder->encode(isAcceleratedCompositingEnabled);
#endif
-
-#if PLATFORM(MAC)
- encoder->encode(contentsScaleFactor);
-#endif
}
bool PluginCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, PluginCreationParameters& result)
@@ -76,6 +71,9 @@
if (!decoder->decode(result.userAgent))
return false;
+ if (!decoder->decode(result.contentsScaleFactor))
+ return false;
+
if (!decoder->decode(result.isPrivateBrowsingEnabled))
return false;
@@ -84,11 +82,6 @@
return false;
#endif
-#if PLATFORM(MAC)
- if (!decoder->decode(result.contentsScaleFactor))
- return false;
-#endif
-
return true;
}
Modified: trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.h (99092 => 99093)
--- trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.h 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/PluginProcess/PluginCreationParameters.h 2011-11-02 20:57:32 UTC (rev 99093)
@@ -55,6 +55,9 @@
// The browser user agent.
String userAgent;
+ // The current contents scale factor that this plug-in should have.
+ float contentsScaleFactor;
+
// Whether private browsing is enabled at the time of instantiation.
bool isPrivateBrowsingEnabled;
@@ -62,11 +65,6 @@
// Whether accelerated compositing is enabled.
bool isAcceleratedCompositingEnabled;
#endif
-
-#if PLATFORM(MAC)
- // The current contents scale factor that this plug-in should have.
- float contentsScaleFactor;
-#endif
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm (99092 => 99093)
--- trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2011-11-02 20:57:32 UTC (rev 99093)
@@ -53,11 +53,6 @@
return PluginProcess::shared().compositingRenderServerPort();
}
-float PluginControllerProxy::contentsScaleFactor()
-{
- return m_contentsScaleFactor;
-}
-
void PluginControllerProxy::platformInitialize()
{
CALayer * platformLayer = m_plugin->pluginLayer();
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2011-11-02 20:57:32 UTC (rev 99093)
@@ -390,6 +390,11 @@
timer->stop();
}
+double NetscapePlugin::contentsScaleFactor()
+{
+ return controller()->contentsScaleFactor();
+}
+
String NetscapePlugin::proxiesForURL(const String& urlString)
{
return controller()->proxiesForURL(urlString);
@@ -408,7 +413,7 @@
bool NetscapePlugin::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password)
{
return controller()->getAuthenticationInfo(protectionSpace, username, password);
-}
+}
NPError NetscapePlugin::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* savedData)
{
@@ -645,18 +650,14 @@
ASSERT(m_isStarted);
IntSize backingStoreSize = m_pluginSize;
-#if PLATFORM(MAC)
backingStoreSize.scale(contentsScaleFactor());
-#endif
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha);
OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext();
-#if PLATFORM(MAC)
// FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI
// which we currently don't have initiated in the plug-in process.
context->scale(FloatSize(contentsScaleFactor(), contentsScaleFactor()));
-#endif
context->translate(-m_frameRectInWindowCoordinates.x(), -m_frameRectInWindowCoordinates.y());
platformPaint(context.get(), m_frameRectInWindowCoordinates, true);
@@ -890,6 +891,16 @@
return scriptableNPObject;
}
+void NetscapePlugin::contentsScaleFactorChanged(float scaleFactor)
+{
+ ASSERT(m_isStarted);
+
+#if PLUGIN_ARCHITECTURE(MAC)
+ double contentsScaleFactor = scaleFactor;
+ NPP_SetValue(NPNVcontentsScaleFactor, &contentsScaleFactor);
+#endif
+}
+
void NetscapePlugin::privateBrowsingStateChanged(bool privateBrowsingEnabled)
{
ASSERT(m_isStarted);
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2011-11-02 20:57:32 UTC (rev 99093)
@@ -64,7 +64,6 @@
bool hasHandledAKeyDownEvent() const { return m_hasHandledAKeyDownEvent; }
mach_port_t compositingRenderServerPort();
- double contentsScaleFactor();
#ifndef NP_NO_CARBON
WindowRef windowRef() const;
@@ -116,6 +115,7 @@
unsigned scheduleTimer(unsigned interval, bool repeat, void (*timerFunc)(NPP, unsigned timerID));
void unscheduleTimer(unsigned timerID);
+ double contentsScaleFactor();
String proxiesForURL(const String& urlString);
String cookiesForURL(const String& urlString);
void setCookiesForURL(const String& urlString, const String& cookieString);
@@ -199,7 +199,6 @@
virtual void windowFocusChanged(bool);
virtual void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates);
virtual void windowVisibilityChanged(bool);
- virtual void contentsScaleFactorChanged(float);
virtual uint64_t pluginComplexTextInputIdentifier() const;
virtual void sendComplexTextInput(const String& textInput);
@@ -208,6 +207,7 @@
void setComplexTextInputEnabled(bool);
#endif
+ virtual void contentsScaleFactorChanged(float);
virtual void privateBrowsingStateChanged(bool);
virtual bool getFormValue(String& formValue);
virtual bool handleScroll(WebCore::ScrollDirection, WebCore::ScrollGranularity);
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm 2011-11-02 20:57:32 UTC (rev 99093)
@@ -179,11 +179,6 @@
return controller()->compositingRenderServerPort();
}
-double NetscapePlugin::contentsScaleFactor()
-{
- return controller()->contentsScaleFactor();
-}
-
#ifndef NP_NO_CARBON
typedef HashMap<WindowRef, NetscapePlugin*> WindowMap;
@@ -925,12 +920,6 @@
// FIXME: Implement.
}
-void NetscapePlugin::contentsScaleFactorChanged(float scaleFactor)
-{
- double contentsScaleFactor = scaleFactor;
- NPP_SetValue(NPNVcontentsScaleFactor, &contentsScaleFactor);
-}
-
uint64_t NetscapePlugin::pluginComplexTextInputIdentifier() const
{
// Just return a dummy value; this is only called for in-process plug-ins, which we don't support on Mac.
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h 2011-11-02 20:57:32 UTC (rev 99093)
@@ -197,9 +197,6 @@
// Tells the plug-in about window visibility changes.
virtual void windowVisibilityChanged(bool) = 0;
- // Tells the plug-in about scale factor changes.
- virtual void contentsScaleFactorChanged(float) = 0;
-
// Get the per complex text input identifier.
virtual uint64_t pluginComplexTextInputIdentifier() const = 0;
@@ -207,6 +204,9 @@
virtual void sendComplexTextInput(const String& textInput) = 0;
#endif
+ // Tells the plug-in about scale factor changes.
+ virtual void contentsScaleFactorChanged(float) = 0;
+
// Called when the private browsing state for this plug-in changes.
virtual void privateBrowsingStateChanged(bool) = 0;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h 2011-11-02 20:57:32 UTC (rev 99093)
@@ -120,10 +120,10 @@
// Returns the mach port of the compositing render server.
virtual mach_port_t compositingRenderServerPort() = 0;
+#endif
// Returns the contents scale factor.
virtual float contentsScaleFactor() = 0;
-#endif
// Returns the proxies for the given URL or null on failure.
virtual String proxiesForURL(const String&) = 0;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2011-11-02 20:57:32 UTC (rev 99093)
@@ -97,13 +97,11 @@
creationParameters.windowNPObjectID = windowNPObjectID();
creationParameters.parameters = parameters;
creationParameters.userAgent = controller()->userAgent();
+ creationParameters.contentsScaleFactor = contentsScaleFactor();
creationParameters.isPrivateBrowsingEnabled = controller()->isPrivateBrowsingEnabled();
#if USE(ACCELERATED_COMPOSITING)
creationParameters.isAcceleratedCompositingEnabled = controller()->isAcceleratedCompositingEnabled();
#endif
-#if PLATFORM(MAC)
- creationParameters.contentsScaleFactor = contentsScaleFactor();
-#endif
bool result = false;
uint32_t remoteLayerClientID = 0;
@@ -375,11 +373,6 @@
m_connection->connection()->send(Messages::PluginControllerProxy::WindowVisibilityChanged(isVisible), m_pluginInstanceID);
}
-void PluginProxy::contentsScaleFactorChanged(float scaleFactor)
-{
- geometryDidChange();
-}
-
uint64_t PluginProxy::pluginComplexTextInputIdentifier() const
{
return m_pluginInstanceID;
@@ -391,6 +384,11 @@
}
#endif
+void PluginProxy::contentsScaleFactorChanged(float scaleFactor)
+{
+ geometryDidChange();
+}
+
void PluginProxy::privateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
{
m_connection->connection()->send(Messages::PluginControllerProxy::PrivateBrowsingStateChanged(isPrivateBrowsingEnabled), m_pluginInstanceID);
@@ -452,11 +450,7 @@
float PluginProxy::contentsScaleFactor()
{
-#if PLATFORM(MAC)
return controller()->contentsScaleFactor();
-#else
- return 1;
-#endif
}
bool PluginProxy::updateBackingStore()
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h 2011-11-02 20:57:32 UTC (rev 99093)
@@ -99,11 +99,11 @@
virtual void windowFocusChanged(bool);
virtual void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates);
virtual void windowVisibilityChanged(bool);
- virtual void contentsScaleFactorChanged(float);
virtual uint64_t pluginComplexTextInputIdentifier() const;
virtual void sendComplexTextInput(const String& textInput);
#endif
+ virtual void contentsScaleFactorChanged(float);
virtual void privateBrowsingStateChanged(bool);
virtual bool getFormValue(String& formValue);
virtual bool handleScroll(WebCore::ScrollDirection, WebCore::ScrollGranularity);
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (99092 => 99093)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2011-11-02 20:28:57 UTC (rev 99092)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2011-11-02 20:57:32 UTC (rev 99093)
@@ -1150,6 +1150,7 @@
{
return WebProcess::shared().compositingRenderServerPort();
}
+#endif
float PluginView::contentsScaleFactor()
{
@@ -1158,7 +1159,6 @@
return 1;
}
-#endif
String PluginView::proxiesForURL(const String& urlString)
{