diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-11 10:03:25 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-11 10:03:25 +0100 |
commit | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch) | |
tree | b318cf594dc1da2fa48224005945c9157f35bb41 /Source/WebKit/chromium/src | |
parent | 6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff) | |
download | qtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz |
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/WebKit/chromium/src')
-rw-r--r-- | Source/WebKit/chromium/src/ContextMenuClientImpl.cpp | 6 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/NonCompositedContentHost.cpp | 9 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/NonCompositedContentHost.h | 3 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/PlatformSupport.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebFrameImpl.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp | 4 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebLayerTreeView.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp | 11 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebSettingsImpl.cpp | 5 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebSettingsImpl.h | 1 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp | 3 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebViewImpl.cpp | 36 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebViewImpl.h | 3 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebWorkerClientImpl.cpp | 4 |
15 files changed, 72 insertions, 21 deletions
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index 830a23b23..cdceb0763 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2009, 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -234,6 +234,10 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(r.innerNonSharedNode()); data.srcURL = pluginElement->document()->completeURL(pluginElement->url()); data.mediaFlags |= WebContextMenuData::MediaCanSave; + + // Add context menu commands that are supported by the plugin. + if (plugin->plugin()->canRotateView()) + data.mediaFlags |= WebContextMenuData::MediaCanRotate; } } } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 46f96b508..72e71b960 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -68,7 +68,7 @@ #include "WebFrameImpl.h" #include "WebKit.h" #include "platform/WebKitPlatformSupport.h" -#include "platform/WebMimeRegistry.h" +#include <public/WebMimeRegistry.h> #include "WebNode.h" #include "WebPermissionClient.h" #include "WebPlugin.h" diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp index c3a5bb481..edf1da7a3 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp @@ -37,6 +37,7 @@ namespace WebKit { NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint) : m_contentPaint(contentPaint) + , m_showDebugBorders(false) { m_graphicsLayer = WebCore::GraphicsLayer::create(this); #ifndef NDEBUG @@ -143,9 +144,15 @@ void NonCompositedContentHost::paintContents(const WebCore::GraphicsLayer*, WebC m_contentPaint->paint(context, adjustedClipRect); } +void NonCompositedContentHost::setShowDebugBorders(bool showDebugBorders) +{ + m_showDebugBorders = showDebugBorders; + m_graphicsLayer->updateDebugIndicators(); +} + bool NonCompositedContentHost::showDebugBorders() const { - return false; + return m_showDebugBorders; } bool NonCompositedContentHost::showRepaintCounter() const diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.h b/Source/WebKit/chromium/src/NonCompositedContentHost.h index dd6958108..2ae85b736 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.h +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h @@ -61,6 +61,8 @@ public: void protectVisibleTileTextures(); WebCore::GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); } + void setShowDebugBorders(bool); + protected: explicit NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint); @@ -78,6 +80,7 @@ private: OwnPtr<WebCore::LayerPainterChromium> m_contentPaint; WebCore::IntSize m_viewportSize; int m_layerAdjustX; + bool m_showDebugBorders; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index 1d1e79778..24681ec96 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -57,11 +57,11 @@ #include "platform/WebDragData.h" #include "platform/WebImage.h" #include "platform/WebKitPlatformSupport.h" -#include "platform/WebMimeRegistry.h" #include "platform/WebSerializedScriptValue.h" #include "platform/WebString.h" #include "platform/WebURL.h" #include "platform/WebVector.h" +#include <public/WebMimeRegistry.h> #if USE(CG) #include <CoreGraphics/CGContext.h> diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index e5ae9c518..2e8a328f8 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -2093,7 +2093,7 @@ void WebFrameImpl::createFrameView() WebViewImpl* webView = viewImpl(); bool isMainFrame = webView->mainFrameImpl()->frame() == m_frame; m_frame->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0); - if (webView->shouldAutoResize()) + if (webView->shouldAutoResize() && isMainFrame) m_frame->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize()); #if ENABLE(GESTURE_RECOGNIZER) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index f40e020bb..447b993c6 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -101,8 +101,10 @@ void WebIDBDatabaseImpl::close() { // Use the callbacks that ::open gave us so that the backend in // multi-process chromium knows which database connection is closing. - ASSERT(m_databaseCallbacks); + if (!m_databaseCallbacks) + return; m_databaseBackend->close(m_databaseCallbacks); + m_databaseCallbacks = 0; } void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp index 44ac90541..b288b563b 100644 --- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp +++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp @@ -81,7 +81,7 @@ void WebLayerTreeView::composite() void WebLayerTreeView::setViewportSize(const WebSize& viewportSize) { - m_private->setViewport(viewportSize); + m_private->setViewportSize(viewportSize); } WebSize WebLayerTreeView::viewportSize() const diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index dd2bc221e..891c31f3f 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -31,11 +31,11 @@ #include "platform/WebCString.h" #include "platform/WebCanvas.h" #include "platform/WebKitPlatformSupport.h" -#include "platform/WebMimeRegistry.h" #include "platform/WebRect.h" #include "platform/WebSize.h" #include "platform/WebString.h" #include "platform/WebURL.h" +#include <public/WebMimeRegistry.h> #if USE(ACCELERATED_COMPOSITING) #include "RenderLayerCompositor.h" @@ -237,6 +237,9 @@ void WebMediaPlayerClientImpl::load(const String& url) m_url = url; if (m_preload == MediaPlayer::None) { +#if ENABLE(WEB_AUDIO) + m_audioSourceProvider.wrap(0); // Clear weak reference to m_webMediaPlayer's WebAudioSourceProvider. +#endif m_webMediaPlayer.clear(); m_delayingLoad = true; } else @@ -245,6 +248,10 @@ void WebMediaPlayerClientImpl::load(const String& url) void WebMediaPlayerClientImpl::loadInternal() { +#if ENABLE(WEB_AUDIO) + m_audioSourceProvider.wrap(0); // Clear weak reference to m_webMediaPlayer's WebAudioSourceProvider. +#endif + Frame* frame = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient())->document()->frame(); m_webMediaPlayer = createWebMediaPlayer(this, frame); if (m_webMediaPlayer) { @@ -688,8 +695,6 @@ WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() #if ENABLE(WEB_AUDIO) void WebMediaPlayerClientImpl::AudioSourceProviderImpl::wrap(WebAudioSourceProvider* provider) { - if (m_webAudioSourceProvider && m_webAudioSourceProvider != provider) - m_webAudioSourceProvider->setClient(0); m_webAudioSourceProvider = provider; if (m_webAudioSourceProvider) m_webAudioSourceProvider->setClient(m_client.get()); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index d11f45220..7733e2699 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -368,11 +368,6 @@ void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) m_settings->setAccelerated2dCanvasEnabled(enabled); } -void WebSettingsImpl::setLegacyAccelerated2dCanvasEnabled(bool enabled) -{ - m_settings->setLegacyAccelerated2dCanvasEnabled(enabled); -} - void WebSettingsImpl::setAcceleratedCompositingForFixedPositionEnabled(bool enabled) { m_settings->setAcceleratedCompositingForFixedPositionEnabled(enabled); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index 8fe9fe6ca..cc70d1316 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -107,7 +107,6 @@ public: virtual void setAcceleratedCompositingForAnimationEnabled(bool); virtual void setAccelerated2dCanvasEnabled(bool); virtual void setAcceleratedCompositingForFixedPositionEnabled(bool); - virtual void setLegacyAccelerated2dCanvasEnabled(bool); virtual void setMinimumAccelerated2dCanvasSize(int); virtual void setAcceleratedFiltersEnabled(bool); virtual void setMemoryInfoEnabled(bool); diff --git a/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp b/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp index 231aaac2e..a2e16847d 100644 --- a/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp +++ b/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp @@ -365,7 +365,8 @@ void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& { initializeLoader(url); WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerContextOnStart : DontPauseWorkerContextOnStart; - setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this, startMode)); + // FIXME: pass content-security-policy directives into shared worker. + setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this, startMode, "", ContentSecurityPolicy::ReportOnly)); workerThread()->start(); } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index b9355fc83..a14748353 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2011, 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -95,6 +95,7 @@ #include "ProgressTracker.h" #include "RenderLayerCompositor.h" #include "RenderView.h" +#include "RenderWidget.h" #include "ResourceHandle.h" #include "SchemeRegistry.h" #include "ScrollAnimator.h" @@ -125,6 +126,7 @@ #include "WebMediaPlayerAction.h" #include "WebNode.h" #include "WebPlugin.h" +#include "WebPluginAction.h" #include "WebPluginContainerImpl.h" #include "platform/WebPoint.h" #include "WebPopupMenuImpl.h" @@ -2183,7 +2185,7 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, HitTestResult result = hitTestResultForWindowPos(location); RefPtr<Node> node = result.innerNonSharedNode(); if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag)) - return; + return; RefPtr<HTMLMediaElement> mediaElement = static_pointer_cast<HTMLMediaElement>(node); @@ -2208,6 +2210,33 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, } } +void WebViewImpl::performPluginAction(const WebPluginAction& action, + const WebPoint& location) +{ + HitTestResult result = hitTestResultForWindowPos(location); + RefPtr<Node> node = result.innerNonSharedNode(); + if (!node->hasTagName(HTMLNames::objectTag) && !node->hasTagName(HTMLNames::embedTag)) + return; + + RenderObject* object = node->renderer(); + if (object && object->isWidget()) { + Widget* widget = toRenderWidget(object)->widget(); + if (widget && widget->isPluginContainer()) { + WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget); + switch (action.type) { + case WebPluginAction::Rotate90Clockwise: + plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise); + break; + case WebPluginAction::Rotate90Counterclockwise: + plugin->plugin()->rotateView(WebPlugin::RotationType90Counterclockwise); + break; + default: + ASSERT_NOT_REACHED(); + } + } + } +} + void WebViewImpl::copyImageAt(const WebPoint& point) { if (!m_page) @@ -2977,6 +3006,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) ccSettings.partialSwapEnabled = page()->settings()->partialSwapEnabled(); m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this)); + m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders()); m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings); if (m_layerTreeHost) { m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers); @@ -3089,7 +3119,7 @@ void WebViewImpl::updateLayerTreeViewport() layerAdjustX = -view->contentsSize().width() + view->visibleContentRect(false).width(); } m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, pageScaleFactor(), layerAdjustX); - m_layerTreeHost->setViewport(visibleRect.size()); + m_layerTreeHost->setViewportSize(visibleRect.size()); m_layerTreeHost->setPageScale(pageScaleFactor()); } diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index e5b5a525f..6ea196a75 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -186,6 +186,9 @@ public: virtual void performMediaPlayerAction( const WebMediaPlayerAction& action, const WebPoint& location); + virtual void performPluginAction( + const WebPluginAction&, + const WebPoint&); virtual void copyImageAt(const WebPoint& point); virtual void dragSourceEndedAt( const WebPoint& clientPoint, diff --git a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp index 5090affbc..d36e83a70 100644 --- a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp @@ -86,7 +86,9 @@ WorkerContextProxy* WebWorkerClientImpl::createWorkerContextProxy(Worker* worker void WebWorkerClientImpl::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode) { - RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode); + RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, + m_scriptExecutionContext->contentSecurityPolicy()->policy(), + m_scriptExecutionContext->contentSecurityPolicy()->headerType()); m_proxy->workerThreadCreated(thread); thread->start(); } |