diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
commit | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch) | |
tree | 87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebKit2/WebProcess | |
parent | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff) | |
download | qtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz |
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebKit2/WebProcess')
24 files changed, 149 insertions, 39 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp index b63c73a4e..adc632dd8 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp @@ -676,6 +676,11 @@ bool NetscapePlugin::isTransparent() return m_isTransparent; } +bool NetscapePlugin::wantsWheelEvents() +{ + return m_pluginModule->pluginQuirks().contains(PluginQuirks::WantsWheelEvents); +} + void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) { ASSERT(m_isStarted); diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h index 660b68540..7bba977b4 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h @@ -173,6 +173,7 @@ private: virtual PlatformLayer* pluginLayer(); #endif virtual bool isTransparent(); + virtual bool wantsWheelEvents() OVERRIDE; virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); virtual void visibilityDidChange(); virtual void frameDidFinishLoading(uint64_t requestID); diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h index c4d178c6e..6d11c8552 100644 --- a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h +++ b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h @@ -77,6 +77,7 @@ private: virtual PlatformLayer* pluginLayer(); #endif virtual bool isTransparent(); + virtual bool wantsWheelEvents() OVERRIDE; virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); virtual void visibilityDidChange(); virtual void frameDidFinishLoading(uint64_t requestID); @@ -119,6 +120,7 @@ private: // ScrollableArea methods. virtual WebCore::IntRect scrollCornerRect() const; virtual WebCore::ScrollableArea* enclosingScrollableArea() const; + virtual WebCore::IntRect scrollableAreaBoundingBox() const OVERRIDE; virtual void setScrollOffset(const WebCore::IntPoint&); virtual int scrollSize(WebCore::ScrollbarOrientation) const; virtual bool isActive() const; diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm index 7dc0b0e64..c4ee69330 100644 --- a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm +++ b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm @@ -196,6 +196,8 @@ const PluginView* BuiltInPDFView::pluginView() const void BuiltInPDFView::updateScrollbars() { + bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar; + if (m_horizontalScrollbar) { if (m_pluginSize.width() >= m_pdfDocumentSize.width()) destroyScrollbar(HorizontalScrollbar); @@ -234,10 +236,15 @@ void BuiltInPDFView::updateScrollbars() if (!frameView) return; - if (m_verticalScrollbar || m_horizontalScrollbar) - frameView->addScrollableArea(this); - else - frameView->removeScrollableArea(this); + bool hasScrollbars = m_horizontalScrollbar || m_verticalScrollbar; + if (hadScrollbars != hasScrollbars) { + if (hasScrollbars) + frameView->addScrollableArea(this); + else + frameView->removeScrollableArea(this); + + frameView->setNeedsLayout(); + } } PassRefPtr<Scrollbar> BuiltInPDFView::createScrollbar(ScrollbarOrientation orientation) @@ -464,6 +471,12 @@ bool BuiltInPDFView::isTransparent() return false; } +bool BuiltInPDFView::wantsWheelEvents() +{ + // We return false here even though we do want wheel events, because we add ourselves to the scrollable area set in updateScrollbars(). + return false; +} + void BuiltInPDFView::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) { if (m_pluginSize == pluginSize) { @@ -688,6 +701,11 @@ ScrollableArea* BuiltInPDFView::enclosingScrollableArea() const return 0; } +IntRect BuiltInPDFView::scrollableAreaBoundingBox() const +{ + return pluginView()->frameRect(); +} + void BuiltInPDFView::setScrollOffset(const IntPoint& offset) { m_scrollOffset = IntSize(offset.x(), offset.y()); diff --git a/Source/WebKit2/WebProcess/Plugins/Plugin.h b/Source/WebKit2/WebProcess/Plugins/Plugin.h index 4f10da9bc..5be84f476 100644 --- a/Source/WebKit2/WebProcess/Plugins/Plugin.h +++ b/Source/WebKit2/WebProcess/Plugins/Plugin.h @@ -121,6 +121,9 @@ public: // Returns whether the plug-in is transparent or not. virtual bool isTransparent() = 0; + // Returns whether we should send wheel events to this plug-in. + virtual bool wantsWheelEvents() = 0; + // Tells the plug-in that its geometry has changed. The clip rect is in plug-in coordinates, and the affine transform can be used // to convert from root view coordinates to plug-in coordinates. virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform) = 0; diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp index 0771bc3d5..d4a3549f4 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp +++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp @@ -66,6 +66,7 @@ PluginProxy::PluginProxy(const String& pluginPath) , m_pluginBackingStoreContainsValidData(false) , m_isStarted(false) , m_waitingForPaintInResponseToUpdate(false) + , m_wantsWheelEvents(false) , m_remoteLayerClientID(0) { } @@ -104,13 +105,15 @@ bool PluginProxy::initialize(const Parameters& parameters) #endif bool result = false; + bool wantsWheelEvents = false; uint32_t remoteLayerClientID = 0; - if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(creationParameters), Messages::WebProcessConnection::CreatePlugin::Reply(result, remoteLayerClientID), 0) || !result) { + if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(creationParameters), Messages::WebProcessConnection::CreatePlugin::Reply(result, wantsWheelEvents, remoteLayerClientID), 0) || !result) { m_connection->removePluginProxy(this); return false; } + m_wantsWheelEvents = wantsWheelEvents; m_remoteLayerClientID = remoteLayerClientID; m_isStarted = true; @@ -171,6 +174,11 @@ bool PluginProxy::isTransparent() return false; } +bool PluginProxy::wantsWheelEvents() +{ + return m_wantsWheelEvents; +} + void PluginProxy::geometryDidChange() { ASSERT(m_isStarted); diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h index e4b428669..be07caa85 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h +++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h @@ -72,6 +72,7 @@ private: virtual PlatformLayer* pluginLayer(); #endif virtual bool isTransparent(); + virtual bool wantsWheelEvents() OVERRIDE; virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); virtual void visibilityDidChange(); virtual void frameDidFinishLoading(uint64_t requestID); @@ -168,6 +169,9 @@ private: // Whether we're called invalidate in response to an update call, and are now waiting for a paint call. bool m_waitingForPaintInResponseToUpdate; + // Whether we should send wheel events to this plug-in or not. + bool m_wantsWheelEvents; + // The client ID for the CA layer in the plug-in process. Will be 0 if the plug-in is not a CA plug-in. uint32_t m_remoteLayerClientID; diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp index 6799f11b3..03dd60f59 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp +++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp @@ -54,7 +54,6 @@ #include <WebCore/ProtectionSpace.h> #include <WebCore/ProxyServer.h> #include <WebCore/RenderEmbeddedObject.h> -#include <WebCore/RenderLayer.h> #include <WebCore/ResourceLoadScheduler.h> #include <WebCore/ScriptValue.h> #include <WebCore/ScrollView.h> @@ -504,6 +503,13 @@ void PluginView::initializePlugin() setWindowIsVisible(m_webPage->windowIsVisible()); setWindowIsFocused(m_webPage->windowIsFocused()); #endif + + if (wantsWheelEvents()) { + if (Frame* frame = m_pluginElement->document()->frame()) { + if (FrameView* frameView = frame->view()) + frameView->setNeedsLayout(); + } + } } #if PLATFORM(MAC) @@ -578,6 +584,15 @@ Scrollbar* PluginView::verticalScrollbar() return m_plugin->verticalScrollbar(); } +bool PluginView::wantsWheelEvents() +{ + // The plug-in can be null here if it failed to initialize. + if (!m_isInitialized || !m_plugin) + return 0; + + return m_plugin->wantsWheelEvents(); +} + void PluginView::setFrameRect(const WebCore::IntRect& rect) { Widget::setFrameRect(rect); @@ -652,7 +667,7 @@ void PluginView::handleEvent(Event* event) frame()->eventHandler()->setCapturingMouseEventsNode(0); didHandleEvent = m_plugin->handleMouseEvent(static_cast<const WebMouseEvent&>(*currentEvent)); - } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel) { + } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel && m_plugin->wantsWheelEvents()) { // We have a wheel event. didHandleEvent = m_plugin->handleWheelEvent(static_cast<const WebWheelEvent&>(*currentEvent)); } else if (event->type() == eventNames().mouseoverEvent && currentEvent->type() == WebEvent::MouseMove) { @@ -752,9 +767,8 @@ IntRect PluginView::clipRectInWindowCoordinates() const Frame* frame = this->frame(); - // Get the window clip rect for the enclosing layer (in window coordinates). - RenderLayer* layer = m_pluginElement->renderer()->enclosingLayer(); - IntRect windowClipRect = frame->view()->windowClipRectForLayer(layer, true); + // Get the window clip rect for the plugin element (in window coordinates). + IntRect windowClipRect = frame->view()->windowClipRectForFrameOwner(m_pluginElement.get(), true); // Intersect the two rects to get the view clip rect in window coordinates. frameRectInWindowCoordinates.intersect(windowClipRect); @@ -1111,7 +1125,7 @@ void PluginView::pluginProcessCrashed() return; RenderEmbeddedObject* renderer = toRenderEmbeddedObject(m_pluginElement->renderer()); - renderer->setShowsCrashedPluginIndicator(); + renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginCrashed); Widget::invalidate(); } diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.h b/Source/WebKit2/WebProcess/Plugins/PluginView.h index 1bf76ae71..d5cb2574c 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginView.h +++ b/Source/WebKit2/WebProcess/Plugins/PluginView.h @@ -111,6 +111,7 @@ private: virtual bool scroll(WebCore::ScrollDirection, WebCore::ScrollGranularity); virtual WebCore::Scrollbar* horizontalScrollbar(); virtual WebCore::Scrollbar* verticalScrollbar(); + virtual bool wantsWheelEvents(); // WebCore::Widget virtual void setFrameRect(const WebCore::IntRect&); diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp index 5d3afe68a..4b78c5a29 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp @@ -468,20 +468,25 @@ void WebChromeClient::scrollRectIntoView(const IntRect&) const notImplemented(); } -bool WebChromeClient::shouldMissingPluginMessageBeButton() const +bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const { - // FIXME: <rdar://problem/8794397> We should only return true when there is a - // missingPluginButtonClicked callback defined on the Page UI client. - return true; + if (pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion) { + // FIXME: <rdar://problem/8794397> We should only return true when there is a + // missingPluginButtonClicked callback defined on the Page UI client. + return true; + } + + return false; } -void WebChromeClient::missingPluginButtonClicked(Element* element) const +void WebChromeClient::unavailablePluginButtonClicked(Element* element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const { ASSERT(element->hasTagName(objectTag) || element->hasTagName(embedTag)); + ASSERT(pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion); HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element); - m_page->send(Messages::WebPageProxy::MissingPluginButtonClicked(pluginElement->serviceType(), pluginElement->url(), pluginElement->getAttribute(pluginspageAttr))); + m_page->send(Messages::WebPageProxy::UnavailablePluginButtonClicked(pluginUnavailabilityReason, pluginElement->serviceType(), pluginElement->url(), pluginElement->getAttribute(pluginspageAttr))); } void WebChromeClient::scrollbarsModeDidChange() const diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h index 969049fac..59e7688cc 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h @@ -121,8 +121,8 @@ private: virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const OVERRIDE; virtual void scrollRectIntoView(const WebCore::IntRect&) const OVERRIDE; // Currently only Mac has a non empty implementation. - virtual bool shouldMissingPluginMessageBeButton() const OVERRIDE; - virtual void missingPluginButtonClicked(WebCore::Element*) const OVERRIDE; + virtual bool shouldUnavailablePluginMessageBeButton(WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const OVERRIDE; + virtual void unavailablePluginButtonClicked(WebCore::Element*, WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const OVERRIDE; virtual void scrollbarsModeDidChange() const OVERRIDE; virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags) OVERRIDE; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp index 5366cc9f4..36378d4db 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp @@ -1317,7 +1317,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn } #endif - RefPtr<Plugin> plugin = webPage->createPlugin(m_frame, parameters); + RefPtr<Plugin> plugin = webPage->createPlugin(m_frame, pluginElement, parameters); if (!plugin) return 0; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm index 37a684143..acf19c4bf 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm +++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm @@ -171,6 +171,9 @@ void InitWebCoreSystemInterface(void) INIT(CGPathAddRoundedRect); #endif +#if !defined(BUILDING_ON_SNOW_LEOPARD) + INIT(CFURLRequestAllowAllPostCaching); +#endif #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION) && !PLATFORM(IOS) INIT(FilterIsManagedSession); INIT(FilterCreateInstance); diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp index d710e99ec..ddadcb15f 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp @@ -705,7 +705,11 @@ void DrawingAreaImpl::setLayerHostingMode(uint32_t opaqueLayerHostingMode) if (!m_layerTreeHost) return; + LayerTreeContext oldLayerTreeContext = m_layerTreeHost->layerTreeContext(); m_layerTreeHost->setLayerHostingMode(layerHostingMode); + + if (m_layerTreeHost->layerTreeContext() != oldLayerTreeContext) + m_webPage->send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext())); } #endif diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 717f67371..413d0d7ab 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -91,6 +91,7 @@ #include <WebCore/FrameView.h> #include <WebCore/HTMLFormElement.h> #include <WebCore/HTMLInputElement.h> +#include <WebCore/HTMLPlugInElement.h> #include <WebCore/HistoryItem.h> #include <WebCore/KeyboardEvent.h> #include <WebCore/MouseEvent.h> @@ -224,6 +225,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) #if PLATFORM(WIN) , m_gestureReachedScrollingLimit(false) #endif +#if ENABLE(PAGE_VISIBILITY_API) + , m_visibilityState(WebCore::PageVisibilityStateVisible) +#endif { ASSERT(m_pageID); // FIXME: This is a non-ideal location for this Setting and @@ -382,13 +386,22 @@ void WebPage::initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenCli } #endif -PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, const Plugin::Parameters& parameters) +PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters) { String pluginPath; + bool blocked; if (!WebProcess::shared().connection()->sendSync( Messages::WebContext::GetPluginPath(parameters.mimeType, parameters.url.string()), - Messages::WebContext::GetPluginPath::Reply(pluginPath), 0)) { + Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0)) { + return 0; + } + + if (blocked) { + if (pluginElement->renderer()->isEmbeddedObject()) + toRenderEmbeddedObject(pluginElement->renderer())->setPluginUnavailabilityReason(RenderEmbeddedObject::InsecurePluginVersion); + + send(Messages::WebPageProxy::DidBlockInsecurePluginVersion(parameters.mimeType)); return 0; } @@ -3157,7 +3170,28 @@ void WebPage::setVisibilityState(int visibilityState, bool isInitialState) { if (!m_page) return; - m_page->setVisibilityState(static_cast<WebCore::PageVisibilityState>(visibilityState), isInitialState); + + WebCore::PageVisibilityState state = static_cast<WebCore::PageVisibilityState>(visibilityState); + + if (m_visibilityState == state) + return; + + FrameView* view = m_page->mainFrame() ? m_page->mainFrame()->view() : 0; + + if (state == WebCore::PageVisibilityStateVisible) { + m_page->didMoveOnscreen(); + if (view) + view->show(); + } + + m_page->setVisibilityState(state, isInitialState); + m_visibilityState = state; + + if (state == WebCore::PageVisibilityStateHidden) { + m_page->willMoveOffscreen(); + if (view) + view->hide(); + } } #endif diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index d9d2df72c..d18c401bf 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -52,6 +52,9 @@ #include <WebCore/Editor.h> #include <WebCore/FrameLoaderTypes.h> #include <WebCore/IntRect.h> +#if ENABLE(PAGE_VISIBILITY_API) +#include <WebCore/PageVisibilityState.h> +#endif #include <WebCore/PlatformScreen.h> #include <WebCore/ScrollTypes.h> #include <WebCore/WebCoreKeyboardUIMode.h> @@ -100,6 +103,7 @@ namespace WebCore { class GraphicsContext; class Frame; class FrameView; + class HTMLPlugInElement; class KeyboardEvent; class Page; class PrintContext; @@ -253,7 +257,7 @@ public: WebCore::Frame* mainFrame() const; // May return 0. WebCore::FrameView* mainFrameView() const; // May return 0. - PassRefPtr<Plugin> createPlugin(WebFrame*, const Plugin::Parameters&); + PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&); EditorState editorState() const; @@ -828,6 +832,9 @@ private: #if PLATFORM(QT) HashMap<String, QtNetworkReply*> m_applicationSchemeReplies; #endif +#if ENABLE(PAGE_VISIBILITY_API) + WebCore::PageVisibilityState m_visibilityState; +#endif }; } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp index 87e9cedbe..de3a2e38e 100644 --- a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp +++ b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp @@ -75,7 +75,7 @@ void LayerTreeHostCA::initialize() if (m_webPage->hasPageOverlay()) createPageOverlayLayer(); - platformInitialize(m_layerTreeContext); + platformInitialize(); setLayerFlushSchedulingEnabled(!m_webPage->drawingArea() || !m_webPage->drawingArea()->layerTreeStateIsFrozen()); scheduleLayerFlush(); diff --git a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h index 64233347d..92ae72674 100644 --- a/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h +++ b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h @@ -58,6 +58,8 @@ protected: bool m_layerFlushSchedulingEnabled; + LayerTreeContext m_layerTreeContext; + private: // LayerTreeHost. virtual const LayerTreeContext& layerTreeContext(); @@ -80,14 +82,11 @@ private: virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { } // LayerTreeHostCA - virtual void platformInitialize(LayerTreeContext&) = 0; + virtual void platformInitialize() = 0; void createPageOverlayLayer(); void destroyPageOverlayLayer(); - // The context for this layer tree. - LayerTreeContext m_layerTreeContext; - // Whether the layer tree host is valid or not. bool m_isValid; diff --git a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h index 375f8c6d6..6f6a37965 100644 --- a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h +++ b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h @@ -54,7 +54,7 @@ private: virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE; // LayerTreeHostCA - virtual void platformInitialize(LayerTreeContext&); + virtual void platformInitialize(); virtual void didPerformScheduledLayerFlush(); virtual bool flushPendingLayerChanges(); diff --git a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm index aeca22445..17ddbbe85 100644 --- a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm +++ b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm @@ -58,7 +58,7 @@ LayerTreeHostCAMac::~LayerTreeHostCAMac() ASSERT(!m_layerHostingContext); } -void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext) +void LayerTreeHostCAMac::platformInitialize() { switch (m_webPage->layerHostingMode()) { case LayerHostingModeDefault: @@ -70,9 +70,9 @@ void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext) break; #endif } - m_layerHostingContext->setRootLayer(rootLayer()->platformLayer()); - layerTreeContext.contextID = m_layerHostingContext->contextID(); + m_layerHostingContext->setRootLayer(rootLayer()->platformLayer()); + m_layerTreeContext.contextID = m_layerHostingContext->contextID(); } void LayerTreeHostCAMac::scheduleLayerFlush() @@ -169,6 +169,7 @@ void LayerTreeHostCAMac::setLayerHostingMode(LayerHostingMode layerHostingMode) } m_layerHostingContext->setRootLayer(rootLayer()->platformLayer()); + m_layerTreeContext.contextID = m_layerHostingContext->contextID(); scheduleLayerFlush(); } diff --git a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp index ef3c16a11..b086aa5ae 100644 --- a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp @@ -89,7 +89,7 @@ LayerTreeHostCAWin::~LayerTreeHostCAWin() { } -void LayerTreeHostCAWin::platformInitialize(LayerTreeContext& context) +void LayerTreeHostCAWin::platformInitialize() { m_view.adoptCF(WKCACFViewCreate(kWKCACFViewDrawingDestinationWindow)); WKCACFViewSetContextUserData(m_view.get(), static_cast<AbstractCACFLayerTreeHost*>(this)); @@ -106,7 +106,7 @@ void LayerTreeHostCAWin::platformInitialize(LayerTreeContext& context) CGRect bounds = m_webPage->bounds(); WKCACFViewUpdate(m_view.get(), m_window->window(), &bounds); - context.window = m_window->window(); + m_layerTreeContext.window = m_window->window(); } void LayerTreeHostCAWin::invalidate() diff --git a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h index d9d59678a..3d8d88513 100644 --- a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h +++ b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h @@ -64,7 +64,7 @@ private: virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&); // LayerTreeHostCA - virtual void platformInitialize(LayerTreeContext&); + virtual void platformInitialize(); virtual void setRootCompositingLayer(WebCore::GraphicsLayer*); // AbstractCACFLayerTreeHost diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm index 1fa87957b..48ac886d0 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm @@ -28,7 +28,7 @@ #import <WebCore/SoftLinking.h> -SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks) +SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A) namespace WebKit { diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp index c435221a7..20d9260b7 100644 --- a/Source/WebKit2/WebProcess/WebProcess.cpp +++ b/Source/WebKit2/WebProcess/WebProcess.cpp @@ -764,11 +764,12 @@ WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupDat static bool canPluginHandleResponse(const ResourceResponse& response) { String pluginPath; + bool blocked; - if (!WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebContext::GetPluginPath::Reply(pluginPath), 0)) + if (!WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0)) return false; - return !pluginPath.isEmpty(); + return !blocked && !pluginPath.isEmpty(); } bool WebProcess::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const |