diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
| commit | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch) | |
| tree | 52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebKit/chromium/src | |
| parent | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff) | |
| download | qtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz | |
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebKit/chromium/src')
30 files changed, 334 insertions, 142 deletions
diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp index 28712827d..1f93cf93e 100644 --- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp @@ -63,28 +63,44 @@ bool AsyncFileSystem::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type& if (!url.protocolIs("filesystem")) return false; - KURL originURL(ParsedURLString, url.path()); - String path = decodeURLEscapeSequences(originURL.path()); - if (path.isEmpty() || path[0] != '/') - return false; - path = path.substring(1); - - if (path.startsWith(temporaryPathPrefix)) { - type = Temporary; - path = path.substring(temporaryPathPrefixLength); - } else if (path.startsWith(persistentPathPrefix)) { - type = Persistent; - path = path.substring(persistentPathPrefixLength); - } else if (path.startsWith(externalPathPrefix)) { - type = externalType; - path = path.substring(externalPathPrefixLength); - } else - return false; - - if (path.isEmpty() || path[0] != '/') - return false; - - filePath.swap(path); + if (url.innerURL()) { + String typeString = url.innerURL()->path().substring(1); + if (typeString == temporaryPathPrefix) + type = Temporary; + else if (typeString == persistentPathPrefix) + type = Persistent; + else if (typeString == externalPathPrefix) + type = externalType; + else + return false; + + filePath = decodeURLEscapeSequences(url.path()); + } else { + // FIXME: Remove this clause once http://codereview.chromium.org/7811006 + // lands, which makes this dead code. + KURL originURL(ParsedURLString, url.path()); + String path = decodeURLEscapeSequences(originURL.path()); + if (path.isEmpty() || path[0] != '/') + return false; + path = path.substring(1); + + if (path.startsWith(temporaryPathPrefix)) { + type = Temporary; + path = path.substring(temporaryPathPrefixLength); + } else if (path.startsWith(persistentPathPrefix)) { + type = Persistent; + path = path.substring(persistentPathPrefixLength); + } else if (path.startsWith(externalPathPrefix)) { + type = externalType; + path = path.substring(externalPathPrefixLength); + } else + return false; + + if (path.isEmpty() || path[0] != '/') + return false; + + filePath.swap(path); + } return true; } diff --git a/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp b/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp index 72cccfcc2..c84ea12f6 100644 --- a/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp +++ b/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp @@ -196,7 +196,7 @@ PopupMenuStyle AutofillPopupMenuClient::menuStyle() const return *m_regularStyle; } -int AutofillPopupMenuClient::clientPaddingLeft() const +WebCore::LayoutUnit AutofillPopupMenuClient::clientPaddingLeft() const { // Bug http://crbug.com/7708 seems to indicate the style can be 0. RenderStyle* style = textFieldStyle(); @@ -206,7 +206,7 @@ int AutofillPopupMenuClient::clientPaddingLeft() const return RenderTheme::defaultTheme()->popupInternalPaddingLeft(style); } -int AutofillPopupMenuClient::clientPaddingRight() const +WebCore::LayoutUnit AutofillPopupMenuClient::clientPaddingRight() const { // Bug http://crbug.com/7708 seems to indicate the style can be 0. RenderStyle* style = textFieldStyle(); diff --git a/Source/WebKit/chromium/src/AutofillPopupMenuClient.h b/Source/WebKit/chromium/src/AutofillPopupMenuClient.h index 7d2b985a2..73cc180e0 100644 --- a/Source/WebKit/chromium/src/AutofillPopupMenuClient.h +++ b/Source/WebKit/chromium/src/AutofillPopupMenuClient.h @@ -84,8 +84,8 @@ public: virtual WebCore::PopupMenuStyle menuStyle() const; virtual int clientInsetLeft() const { return 0; } virtual int clientInsetRight() const { return 0; } - virtual int clientPaddingLeft() const; - virtual int clientPaddingRight() const; + virtual WebCore::LayoutUnit clientPaddingLeft() const; + virtual WebCore::LayoutUnit clientPaddingRight() const; virtual int listSize() const { return getSuggestionsCount(); } virtual int selectedIndex() const { return m_selectedIndex; } virtual void popupDidHide(); diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index cdceb0763..790a9c52b 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -259,8 +259,10 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( data.frameHistoryItem = WebHistoryItem(historyItem); } - if (r.isSelected()) - data.selectedText = selectedFrame->editor()->selectedText().stripWhiteSpace(); + if (r.isSelected()) { + if (!r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag) || !static_cast<HTMLInputElement*>(r.innerNonSharedNode())->isPasswordField()) + data.selectedText = selectedFrame->editor()->selectedText().stripWhiteSpace(); + } if (r.isContentEditable()) { data.isEditable = true; diff --git a/Source/WebKit/chromium/src/DatabaseObserver.cpp b/Source/WebKit/chromium/src/DatabaseObserver.cpp index 40b504803..2196c9b44 100644 --- a/Source/WebKit/chromium/src/DatabaseObserver.cpp +++ b/Source/WebKit/chromium/src/DatabaseObserver.cpp @@ -165,7 +165,10 @@ bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecut WorkerContext* workerContext = static_cast<WorkerContext*>(scriptExecutionContext); WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy(); WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy); - return allowDatabaseForWorker(webWorker->commonClient(), webWorker->view()->mainFrame(), name, displayName, estimatedSize); + WebView* view = webWorker->view(); + if (!view) + return false; + return allowDatabaseForWorker(webWorker->commonClient(), view->mainFrame(), name, displayName, estimatedSize); #else ASSERT_NOT_REACHED(); #endif diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 94958c94e..cbbf5c581 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -123,9 +123,6 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFro Chrome* chrome = static_cast<Chrome*>(hostWindow); WebKit::WebViewImpl* webViewImpl = chrome ? static_cast<WebKit::WebViewImpl*>(chrome->client()->webView()) : 0; - if (threadUsage == ForUseOnThisThread && !webContext->makeContextCurrent()) - return 0; - OwnPtr<GraphicsContext3DPrivate> priv = GraphicsContext3DPrivate::create(webViewImpl, webContext, attrs); if (!priv) return 0; diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 80b711a56..99a0afae4 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -183,7 +183,12 @@ void IDBFactoryBackendProxy::openFromWorker(const String& name, IDBCallbacks* ca } WorkerLoaderProxy* workerLoaderProxy = &context->thread()->workerLoaderProxy(); WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy); - WebFrame* webFrame = webWorker->view()->mainFrame(); + WebView* webView = webWorker->view(); + if (!webView) { + // Frame is closed, worker is terminaring. + return; + } + WebFrame* webFrame = webView->mainFrame(); m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir); #endif } diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp index 5f43a9ab3..c9be08a84 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp @@ -45,7 +45,9 @@ NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<WebCore::LayerPain #endif m_graphicsLayer->setDrawsContent(true); m_graphicsLayer->platformLayer()->setIsNonCompositedContent(true); +#if !ENABLE(RUBBER_BANDING) m_graphicsLayer->platformLayer()->setBackgroundCoversViewport(true); +#endif m_graphicsLayer->platformLayer()->setOpaque(true); } diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index 7ed80bb24..b4d479ca6 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -1092,17 +1092,17 @@ bool PlatformSupport::screenIsMonochrome(Widget* widget) return client->screenInfo().isMonochrome; } -IntRect PlatformSupport::screenRect(FrameView* frameView) +IntRect PlatformSupport::screenRect(Widget* widget) { - WebWidgetClient* client = toWebWidgetClient(frameView); + WebWidgetClient* client = toWebWidgetClient(widget); if (!client) return IntRect(); return client->screenInfo().rect; } -IntRect PlatformSupport::screenAvailableRect(FrameView* frameView) +IntRect PlatformSupport::screenAvailableRect(Widget* widget) { - WebWidgetClient* client = toWebWidgetClient(frameView); + WebWidgetClient* client = toWebWidgetClient(widget); if (!client) return IntRect(); return client->screenInfo().availableRect; diff --git a/Source/WebKit/chromium/src/ScrollbarGroup.cpp b/Source/WebKit/chromium/src/ScrollbarGroup.cpp index ad4ef83cc..579dc7aa7 100644 --- a/Source/WebKit/chromium/src/ScrollbarGroup.cpp +++ b/Source/WebKit/chromium/src/ScrollbarGroup.cpp @@ -26,7 +26,7 @@ #include "config.h" #include "ScrollbarGroup.h" -#include "Page.h" +#include "FrameView.h" #include "Scrollbar.h" #include "ScrollbarTheme.h" #include "platform/WebRect.h" @@ -36,20 +36,19 @@ using namespace WebCore; namespace WebKit { -ScrollbarGroup::ScrollbarGroup(Page* page) - : m_page(page) +ScrollbarGroup::ScrollbarGroup(FrameView* frameView) + : m_frameView(frameView) , m_horizontalScrollbar(0) , m_verticalScrollbar(0) { - m_page->addScrollableArea(this); + m_frameView->addScrollableArea(this); } ScrollbarGroup::~ScrollbarGroup() { ASSERT(!m_horizontalScrollbar); ASSERT(!m_verticalScrollbar); - if (m_page) - m_page->removeScrollableArea(this); + m_frameView->removeScrollableArea(this); } void ScrollbarGroup::scrollbarCreated(WebScrollbarImpl* scrollbar) @@ -249,9 +248,4 @@ bool ScrollbarGroup::isOnActivePage() const return true; } -void ScrollbarGroup::disconnectFromPage() -{ - m_page = 0; -} - } // namespace WebKit diff --git a/Source/WebKit/chromium/src/ScrollbarGroup.h b/Source/WebKit/chromium/src/ScrollbarGroup.h index 9093f33dd..44be2cf51 100644 --- a/Source/WebKit/chromium/src/ScrollbarGroup.h +++ b/Source/WebKit/chromium/src/ScrollbarGroup.h @@ -31,7 +31,7 @@ #include <wtf/RefPtr.h> namespace WebCore { -class Page; +class FrameView; } namespace WebKit { @@ -40,7 +40,7 @@ class WebScrollbarImpl; class ScrollbarGroup : public WebCore::ScrollableArea { public: - explicit ScrollbarGroup(WebCore::Page*); + explicit ScrollbarGroup(WebCore::FrameView*); ~ScrollbarGroup(); void scrollbarCreated(WebScrollbarImpl*); @@ -72,10 +72,9 @@ public: virtual bool shouldSuspendScrollAnimations() const; virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate); virtual bool isOnActivePage() const; - virtual void disconnectFromPage(); private: - WebCore::Page* m_page; + WebCore::FrameView* m_frameView; WebCore::IntPoint m_lastMousePosition; WebScrollbarImpl* m_horizontalScrollbar; WebScrollbarImpl* m_verticalScrollbar; diff --git a/Source/WebKit/chromium/src/UserMediaClientImpl.h b/Source/WebKit/chromium/src/UserMediaClientImpl.h index f0871236b..f6ab0416b 100644 --- a/Source/WebKit/chromium/src/UserMediaClientImpl.h +++ b/Source/WebKit/chromium/src/UserMediaClientImpl.h @@ -50,7 +50,7 @@ public: // WebCore::UserMediaClient ---------------------------------------------- virtual void pageDestroyed(); - virtual void requestUserMedia(PassRefPtr<WebCore::UserMediaRequest>, const WebCore::MediaStreamSourceVector&, const WebCore::MediaStreamSourceVector&); + virtual void requestUserMedia(PassRefPtr<WebCore::UserMediaRequest>, const WebCore::MediaStreamSourceVector& audioSources, const WebCore::MediaStreamSourceVector& videoSources); virtual void cancelUserMediaRequest(WebCore::UserMediaRequest*); private: diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp index 408f1264f..40c151dfd 100644 --- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp +++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp @@ -81,6 +81,11 @@ WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl(CCInputHandlerClien : m_client(0) , m_identifier(s_nextAvailableIdentifier++) , m_inputHandlerClient(inputHandlerClient) +#ifndef NDEBUG + , m_expectScrollUpdateEnd(false) + , m_expectPinchUpdateEnd(false) +#endif + , m_scrollStarted(false) { ASSERT(CCProxy::isImplThread()); @@ -131,6 +136,66 @@ void WebCompositorInputHandlerImpl::handleInputEvent(const WebInputEvent& event) case CCInputHandlerClient::ScrollFailed: break; } + } else if (event.type == WebInputEvent::GestureScrollBegin) { + ASSERT(!m_scrollStarted); + ASSERT(!m_expectScrollUpdateEnd); +#ifndef NDEBUG + m_expectScrollUpdateEnd = true; +#endif + const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); + CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y)); + switch (scrollStatus) { + case CCInputHandlerClient::ScrollStarted: + m_scrollStarted = true; + m_client->didHandleInputEvent(); + return; + case CCInputHandlerClient::ScrollIgnored: + m_client->didNotHandleInputEvent(false /* sendToWidget */); + return; + case CCInputHandlerClient::ScrollFailed: + break; + } + } else if (event.type == WebInputEvent::GestureScrollUpdate) { + ASSERT(m_expectScrollUpdateEnd); + if (m_scrollStarted) { + const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); + m_inputHandlerClient->scrollBy(IntSize(-gestureEvent.deltaX, -gestureEvent.deltaY)); + m_client->didHandleInputEvent(); + return; + } + } else if (event.type == WebInputEvent::GestureScrollEnd) { + ASSERT(m_expectScrollUpdateEnd); +#ifndef NDEBUG + m_expectScrollUpdateEnd = false; +#endif + if (m_scrollStarted) { + m_inputHandlerClient->scrollEnd(); + m_client->didHandleInputEvent(); + m_scrollStarted = false; + return; + } + } else if (event.type == WebInputEvent::GesturePinchBegin) { + ASSERT(!m_expectPinchUpdateEnd); +#ifndef NDEBUG + m_expectPinchUpdateEnd = true; +#endif + m_inputHandlerClient->pinchGestureBegin(); + m_client->didHandleInputEvent(); + return; + } else if (event.type == WebInputEvent::GesturePinchEnd) { + ASSERT(m_expectPinchUpdateEnd); +#ifndef NDEBUG + m_expectPinchUpdateEnd = false; +#endif + m_inputHandlerClient->pinchGestureEnd(); + m_client->didHandleInputEvent(); + return; + } else if (event.type == WebInputEvent::GesturePinchUpdate) { + ASSERT(m_expectPinchUpdateEnd); + const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); + m_inputHandlerClient->pinchGestureUpdate(gestureEvent.deltaX, IntPoint(gestureEvent.x, gestureEvent.y)); + m_client->didHandleInputEvent(); + return; } m_client->didNotHandleInputEvent(true /* sendToWidget */); } diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h index 1ebc1e155..a2f13025d 100644 --- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h +++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h @@ -70,6 +70,12 @@ private: int m_identifier; WebCore::CCInputHandlerClient* m_inputHandlerClient; +#ifndef NDEBUG + bool m_expectScrollUpdateEnd; + bool m_expectPinchUpdateEnd; +#endif + bool m_scrollStarted; + static int s_nextAvailableIdentifier; static HashSet<WebCompositorInputHandlerImpl*>* s_compositors; }; diff --git a/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp index c658ca0ca..dc126f0f5 100644 --- a/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp +++ b/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp @@ -123,7 +123,7 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa args.append(ToV8String(message)); v8::TryCatch tryCatch; tryCatch.SetVerbose(true); - V8Proxy::instrumentedCallFunction(frame->frame()->page(), function, inspectorBackend, args.size(), args.data()); + V8Proxy::instrumentedCallFunction(frame->frame(), function, inspectorBackend, args.size(), args.data()); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 2524cf45b..f8d2034fd 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -2105,10 +2105,6 @@ void WebFrameImpl::createFrameView() m_frame->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0); if (webView->shouldAutoResize() && isMainFrame) m_frame->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize()); - -#if ENABLE(GESTURE_RECOGNIZER) - webView->resetGestureRecognizer(); -#endif } WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame) diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.cpp b/Source/WebKit/chromium/src/WebInputEventConversion.cpp index ddd4736ab..64ba31170 100644 --- a/Source/WebKit/chromium/src/WebInputEventConversion.cpp +++ b/Source/WebKit/chromium/src/WebInputEventConversion.cpp @@ -155,6 +155,11 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W case WebInputEvent::GestureDoubleTap: m_type = PlatformEvent::GestureDoubleTap; break; + case WebInputEvent::GesturePinchBegin: + case WebInputEvent::GesturePinchEnd: + case WebInputEvent::GesturePinchUpdate: + // FIXME: Once PlatformGestureEvent is updated to support pinch, this should set m_type to appropriate PlatformEvent type. + ASSERT_NOT_REACHED(); default: ASSERT_NOT_REACHED(); } diff --git a/Source/WebKit/chromium/src/WebFloatQuad.cpp b/Source/WebKit/chromium/src/WebMediaStreamComponent.cpp index fe7d68a98..644bcf77b 100644 --- a/Source/WebKit/chromium/src/WebFloatQuad.cpp +++ b/Source/WebKit/chromium/src/WebMediaStreamComponent.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 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 @@ -29,18 +29,59 @@ */ #include "config.h" -#include "platform/WebFloatQuad.h" + +#if ENABLE(MEDIA_STREAM) + +#include "platform/WebMediaStreamComponent.h" + +#include "MediaStreamComponent.h" +#include "platform/WebMediaStreamSource.h" +#include "platform/WebString.h" +#include <wtf/Vector.h> + +using namespace WebCore; namespace WebKit { -WebRect WebFloatQuad::enclosingRect() const +WebMediaStreamComponent::WebMediaStreamComponent(WebCore::MediaStreamComponent* mediaStreamComponent) + : m_private(mediaStreamComponent) +{ +} + +WebMediaStreamComponent& WebMediaStreamComponent::operator=(WebCore::MediaStreamComponent* mediaStreamComponent) +{ + m_private = mediaStreamComponent; + return *this; +} + +void WebMediaStreamComponent::reset() { - int left = static_cast<int>(floorf(std::min(std::min(std::min(p[0].x, p[1].x), p[2].x), p[3].x))); - int top = static_cast<int>(floorf(std::min(std::min(std::min(p[0].y, p[1].y), p[2].y), p[3].y))); - int right = static_cast<int>(ceilf(std::max(std::max(std::max(p[0].x, p[1].x), p[2].x), p[3].x))); - int bottom = static_cast<int>(ceilf(std::max(std::max(std::max(p[0].y, p[1].y), p[2].y), p[3].y))); + m_private.reset(); +} - return WebRect(left, top, right - left, bottom - top); +WebMediaStreamComponent::operator PassRefPtr<MediaStreamComponent>() const +{ + return m_private.get(); +} + +WebMediaStreamComponent::operator MediaStreamComponent*() const +{ + return m_private.get(); +} + +bool WebMediaStreamComponent::isEnabled() const +{ + ASSERT(!m_private.isNull()); + return m_private.get()->enabled(); +} + +WebMediaStreamSource WebMediaStreamComponent::source() const +{ + ASSERT(!m_private.isNull()); + return WebMediaStreamSource(m_private.get()->source()); } } // namespace WebKit + +#endif // ENABLE(MEDIA_STREAM) + diff --git a/Source/WebKit/chromium/src/WebMediaStreamDescriptor.cpp b/Source/WebKit/chromium/src/WebMediaStreamDescriptor.cpp index 7daf329e5..9faa4fd85 100644 --- a/Source/WebKit/chromium/src/WebMediaStreamDescriptor.cpp +++ b/Source/WebKit/chromium/src/WebMediaStreamDescriptor.cpp @@ -37,6 +37,7 @@ #include "MediaStreamComponent.h" #include "MediaStreamDescriptor.h" #include "MediaStreamSource.h" +#include "platform/WebMediaStreamComponent.h" #include "platform/WebMediaStreamSource.h" #include "platform/WebString.h" #include <wtf/Vector.h> @@ -50,6 +51,11 @@ WebMediaStreamDescriptor::WebMediaStreamDescriptor(const PassRefPtr<WebCore::Med { } +WebMediaStreamDescriptor::WebMediaStreamDescriptor(WebCore::MediaStreamDescriptor* mediaStreamDescriptor) + : m_private(mediaStreamDescriptor) +{ +} + void WebMediaStreamDescriptor::reset() { m_private.reset(); @@ -74,21 +80,21 @@ void WebMediaStreamDescriptor::sources(WebVector<WebMediaStreamSource>& webSourc webSources.swap(result); } -void WebMediaStreamDescriptor::audioSources(WebVector<WebMediaStreamSource>& webSources) const +void WebMediaStreamDescriptor::audioSources(WebVector<WebMediaStreamComponent>& webSources) const { size_t numberOfSources = m_private->numberOfAudioComponents(); - WebVector<WebMediaStreamSource> result(numberOfSources); + WebVector<WebMediaStreamComponent> result(numberOfSources); for (size_t i = 0; i < numberOfSources; ++i) - result[i] = m_private->audioComponent(i)->source(); + result[i] = m_private->audioComponent(i); webSources.swap(result); } -void WebMediaStreamDescriptor::videoSources(WebVector<WebMediaStreamSource>& webSources) const +void WebMediaStreamDescriptor::videoSources(WebVector<WebMediaStreamComponent>& webSources) const { size_t numberOfSources = m_private->numberOfVideoComponents(); - WebVector<WebMediaStreamSource> result(numberOfSources); + WebVector<WebMediaStreamComponent> result(numberOfSources); for (size_t i = 0; i < numberOfSources; ++i) - result[i] = m_private->videoComponent(i)->source(); + result[i] = m_private->videoComponent(i); webSources.swap(result); } diff --git a/Source/WebKit/chromium/src/WebMediaStreamSourcesRequest.cpp b/Source/WebKit/chromium/src/WebMediaStreamSourcesRequest.cpp new file mode 100644 index 000000000..ea8868009 --- /dev/null +++ b/Source/WebKit/chromium/src/WebMediaStreamSourcesRequest.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 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 + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(MEDIA_STREAM) + +#include "platform/WebMediaStreamSourcesRequest.h" + +#include "MediaStreamCenter.h" +#include "MediaStreamSource.h" +#include "platform/WebMediaStreamSource.h" +#include "platform/WebVector.h" +#include <wtf/Vector.h> + +using namespace WebCore; + +namespace WebKit { + +WebMediaStreamSourcesRequest::WebMediaStreamSourcesRequest(const PassRefPtr<WebCore::MediaStreamSourcesQueryClient>& queryClient) + : m_private(queryClient) +{ +} + +void WebMediaStreamSourcesRequest::reset() +{ + m_private.reset(); +} + +bool WebMediaStreamSourcesRequest::audio() const +{ + ASSERT(!isNull()); + return m_private->audio(); +} + +bool WebMediaStreamSourcesRequest::video() const +{ + ASSERT(!isNull()); + return m_private->video(); +} + +void WebMediaStreamSourcesRequest::didCompleteQuery(const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources) const +{ + ASSERT(!isNull()); + MediaStreamSourceVector audio; + for (size_t i = 0; i < audioSources.size(); ++i) { + MediaStreamSource* curr = audioSources[i]; + audio.append(curr); + } + MediaStreamSourceVector video; + for (size_t i = 0; i < videoSources.size(); ++i) { + MediaStreamSource* curr = videoSources[i]; + video.append(curr); + } + m_private->didCompleteQuery(audio, video); +} + +} // namespace WebKit + +#endif // ENABLE(MEDIA_STREAM) + diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp index da0e32555..ca0583488 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -307,13 +307,12 @@ void WebPageSerializerImpl::openTagToString(Element* element, // Add open tag result += "<" + element->nodeName().lower(); // Go through all attributes and serialize them. - const NamedNodeMap *attrMap = element->updatedAttributes(); - if (attrMap) { - unsigned numAttrs = attrMap->length(); + if (element->hasAttributes()) { + unsigned numAttrs = element->attributeCount(); for (unsigned i = 0; i < numAttrs; i++) { result += " "; // Add attribute pair - const Attribute *attribute = attrMap->attributeItem(i); + const Attribute *attribute = element->attributeItem(i); result += attribute->name().toString(); result += "=\""; if (!attribute->value().isEmpty()) { diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index a8f6d126b..129088ef4 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -493,7 +493,7 @@ WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const ScrollbarGroup* WebPluginContainerImpl::scrollbarGroup() { if (!m_scrollbarGroup) - m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->page())); + m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->view())); return m_scrollbarGroup.get(); } diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp index 687b03360..3f328f55b 100644 --- a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp +++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp @@ -51,9 +51,8 @@ #include "platform/WebRect.h" #include <skia/ext/platform_canvas.h> -#if ENABLE(GESTURE_RECOGNIZER) +#if ENABLE(GESTURE_EVENTS) #include "PlatformGestureEvent.h" -#include "PlatformGestureRecognizer.h" #endif using namespace WebCore; @@ -73,9 +72,6 @@ WebPopupMenu* WebPopupMenu::create(WebWidgetClient* client) WebPopupMenuImpl::WebPopupMenuImpl(WebWidgetClient* client) : m_client(client) , m_widget(0) -#if ENABLE(GESTURE_RECOGNIZER) - , m_gestureRecognizer(WebCore::PlatformGestureRecognizer::create()) -#endif { // Set to impossible point so we always get the first mouse position. m_lastMousePosition = WebPoint(-1, -1); @@ -143,11 +139,6 @@ bool WebPopupMenuImpl::handleTouchEvent(const WebTouchEvent& event) PlatformTouchEventBuilder touchEventBuilder(m_widget, event); bool defaultPrevented(m_widget->handleTouchEvent(touchEventBuilder)); -#if ENABLE(GESTURE_RECOGNIZER) - OwnPtr<Vector<WebCore::PlatformGestureEvent> > gestureEvents(m_gestureRecognizer->processTouchEventForGestures(touchEventBuilder, defaultPrevented)); - for (unsigned int i = 0; i < gestureEvents->size(); i++) - m_widget->handleGestureEvent((*gestureEvents)[i]); -#endif return defaultPrevented; } #endif @@ -284,6 +275,12 @@ bool WebPopupMenuImpl::handleInputEvent(const WebInputEvent& inputEvent) case WebInputEvent::MouseEnter: case WebInputEvent::ContextMenu: return false; + + case WebInputEvent::GesturePinchBegin: + case WebInputEvent::GesturePinchEnd: + case WebInputEvent::GesturePinchUpdate: + // FIXME: Once PlatformGestureEvent is updated to support pinch, this should call handleGestureEvent, just like it currently does for gesture scroll. + return false; } return false; } diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.h b/Source/WebKit/chromium/src/WebPopupMenuImpl.h index 0ad03963a..a3fddb6d0 100644 --- a/Source/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.h @@ -139,10 +139,6 @@ public: // This is a non-owning ref. The popup will notify us via popupClosed() // before it is destroyed. WebCore::FramelessScrollView* m_widget; - -#if ENABLE(GESTURE_RECOGNIZER) - OwnPtr<WebCore::PlatformGestureRecognizer> m_gestureRecognizer; -#endif }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index 2723ca78b..11e9c337b 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -298,6 +298,11 @@ void WebSettingsImpl::setPrivilegedWebGLExtensionsEnabled(bool enabled) m_settings->setPrivilegedWebGLExtensionsEnabled(enabled); } +void WebSettingsImpl::setWebGLErrorsToConsoleEnabled(bool enabled) +{ + m_settings->setWebGLErrorsToConsoleEnabled(enabled); +} + void WebSettingsImpl::setShowDebugBorders(bool show) { m_settings->setShowDebugBorders(show); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index 63a00a099..45e62db6f 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -90,6 +90,7 @@ public: virtual void setExperimentalWebGLEnabled(bool); virtual void setOpenGLMultisamplingEnabled(bool); virtual void setPrivilegedWebGLExtensionsEnabled(bool); + virtual void setWebGLErrorsToConsoleEnabled(bool); virtual void setShowDebugBorders(bool); virtual void setShowFPSCounter(bool); virtual bool showFPSCounter() const { return m_showFPSCounter; } diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index 0f59a93d0..0d6e4db78 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -41,25 +41,11 @@ using namespace WebCore; namespace WebKit { -static TextCheckingType toCoreCheckingType(WebTextCheckingResult::Error error) -{ - if (error == WebTextCheckingResult::ErrorSpelling) - return TextCheckingTypeSpelling; - ASSERT(error == WebTextCheckingResult::ErrorGrammar); - return TextCheckingTypeGrammar; -} - static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) { Vector<TextCheckingResult> coreResults; - for (size_t i = 0; i < results.size(); ++i) { - TextCheckingResult coreResult; - coreResult.type = toCoreCheckingType(results[i].error); - coreResult.location = results[i].position; - coreResult.length = results[i].length; - coreResults.append(coreResult); - } - + for (size_t i = 0; i < results.size(); ++i) + coreResults.append(results[i]); return coreResults; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 84de7729c..a05e98920 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -148,10 +148,6 @@ #include "PlatformGestureEvent.h" #endif -#if ENABLE(GESTURE_RECOGNIZER) -#include "PlatformGestureRecognizer.h" -#endif - #if USE(CG) #include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> @@ -375,9 +371,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client) #endif , m_deviceOrientationClientProxy(adoptPtr(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))) , m_geolocationClientProxy(adoptPtr(new GeolocationClientProxy(client ? client->geolocationClient() : 0))) -#if ENABLE(GESTURE_RECOGNIZER) - , m_gestureRecognizer(WebCore::PlatformGestureRecognizer::create()) -#endif #if ENABLE(MEDIA_STREAM) , m_userMediaClientImpl(this) #endif @@ -800,13 +793,6 @@ bool WebViewImpl::touchEvent(const WebTouchEvent& event) PlatformTouchEventBuilder touchEventBuilder(mainFrameImpl()->frameView(), event); bool defaultPrevented = mainFrameImpl()->frame()->eventHandler()->handleTouchEvent(touchEventBuilder); - -#if ENABLE(GESTURE_RECOGNIZER) - OwnPtr<Vector<WebCore::PlatformGestureEvent> > gestureEvents(m_gestureRecognizer->processTouchEventForGestures(touchEventBuilder, defaultPrevented)); - for (unsigned int i = 0; i < gestureEvents->size(); i++) - mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(gestureEvents->at(i)); -#endif - return defaultPrevented; } #endif @@ -1206,7 +1192,7 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect RefPtr<ByteArray> pixelArray(ByteArray::create(rect.width() * rect.height() * 4)); if (imageBuffer && pixelArray) { m_layerTreeHost->compositeAndReadback(pixelArray->data(), invertRect); - imageBuffer->putPremultipliedImageData(pixelArray.get(), rect.size(), IntRect(IntPoint(), rect.size()), IntPoint()); + imageBuffer->putByteArray(Premultiplied, pixelArray.get(), rect.size(), IntRect(IntPoint(), rect.size()), IntPoint()); gc.save(); gc.translate(IntSize(0, bitmapHeight)); gc.scale(FloatSize(1.0f, -1.0f)); @@ -1430,6 +1416,15 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) break; #endif +#if ENABLE(GESTURE_EVENTS) + case WebInputEvent::GesturePinchBegin: + case WebInputEvent::GesturePinchEnd: + case WebInputEvent::GesturePinchUpdate: + // FIXME: Once PlatformGestureEvent is updated to support pinch, this should call handleGestureEvent, just like it currently does for gesture scroll. + handled = false; + break; +#endif + default: handled = false; } @@ -3180,13 +3175,6 @@ void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, #endif } -#if ENABLE(GESTURE_RECOGNIZER) -void WebViewImpl::resetGestureRecognizer() -{ - m_gestureRecognizer->reset(); -} -#endif - #if ENABLE(POINTER_LOCK) bool WebViewImpl::requestPointerLock() { diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index a039a09ce..800d18254 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -68,9 +68,6 @@ class PopupMenuClient; class Range; class RenderTheme; class Widget; -#if ENABLE(GESTURE_RECOGNIZER) -class PlatformGestureRecognizer; -#endif } namespace WebKit { @@ -458,10 +455,6 @@ public: // a plugin can update its own zoom, say because of its own UI. void fullFramePluginZoomLevelChanged(double zoomLevel); -#if ENABLE(GESTURE_RECOGNIZER) - void resetGestureRecognizer(); -#endif - void loseCompositorContext(int numTimes); void enterFullScreenForElement(WebCore::Element*); @@ -690,10 +683,6 @@ private: OwnPtr<DeviceOrientationClientProxy> m_deviceOrientationClientProxy; OwnPtr<GeolocationClientProxy> m_geolocationClientProxy; -#if ENABLE(GESTURE_RECOGNIZER) - OwnPtr<WebCore::PlatformGestureRecognizer> m_gestureRecognizer; -#endif - #if ENABLE(MEDIA_STREAM) UserMediaClientImpl m_userMediaClientImpl; #endif diff --git a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp index 799599ab3..796ab166d 100644 --- a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp @@ -187,8 +187,10 @@ void WebWorkerClientImpl::workerContextDestroyed() m_proxy->workerContextDestroyed(); } -bool WebWorkerClientImpl::allowFileSystem() +bool WebWorkerClientImpl::allowFileSystem() { + if (m_proxy->askedToTerminate()) + return false; WebKit::WebViewImpl* webView = m_webFrame->viewImpl(); if (!webView) return false; @@ -203,6 +205,8 @@ void WebWorkerClientImpl::openFileSystem(WebFileSystem::Type type, long long siz bool WebWorkerClientImpl::allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) { + if (m_proxy->askedToTerminate()) + return false; WebKit::WebViewImpl* webView = m_webFrame->viewImpl(); if (!webView) return false; @@ -210,7 +214,9 @@ bool WebWorkerClientImpl::allowDatabase(WebFrame*, const WebString& name, const } WebView* WebWorkerClientImpl::view() const -{ +{ + if (m_proxy->askedToTerminate()) + return 0; return m_webFrame->view(); } |
