diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-08 14:30:41 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-12 13:49:54 +0200 |
commit | ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch) | |
tree | 498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/third_party/WebKit/public | |
parent | 4ce69f7403811819800e7c5ae1318b2647e778d1 (diff) |
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/third_party/WebKit/public')
266 files changed, 4540 insertions, 4045 deletions
diff --git a/chromium/third_party/WebKit/public/BUILD.gn b/chromium/third_party/WebKit/public/BUILD.gn new file mode 100644 index 00000000000..8334c51bcc1 --- /dev/null +++ b/chromium/third_party/WebKit/public/BUILD.gn @@ -0,0 +1,72 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (!is_android) { + +# GYP version: WebKit/public/blink.gyp:blink +group("blink") { + deps = [ + ":blink_headers", + ":blink_minimal", + "//third_party/WebKit/Source/platform", + "//third_party/WebKit/Source/web", + ] +} + +# This target provides a minimal set of Blink APIs such as WebString to use in +# places that cannot link against the full Blink library. FIXME: We really +# shouldn't have this at all and should instead remove all uses of Blink's API +# types from places that can't link against Blink. crbug.com/248653 +# +# GYP version: WebKit/public/blink.gyp:blink_minimal +group("blink_minimal") { + deps = [ + "//third_party/WebKit/Source/platform:blink_common", + ] +} + +# TODO(GYP) enable this when web:test_support exists. +# GYP version: WebKit/public/blink.gyp:blink_test_support +#group("test_support") { +# deps = [ +# "//third_party/WebKit/Source/web:test_support", +# ] +#} + +# GYP version: WebKit/public/all.gyp:all_blink +group("all_blink") { + deps = [ + "//third_party/WebKit/Source/core", + "//third_party/WebKit/Source/modules", + "//third_party/WebKit/Source/platform", + "//third_party/WebKit/Source/web", + "//third_party/WebKit/Source/wtf:wtf_unittests", + ] +} + +} # !is_android + +config("blink_headers_config") { + include_dirs = [ ".." ] +} + +# Depend on this target to use public blink API headers for things like enums +# and public structures without actually linking against any Blink libraries. +source_set("blink_headers") { + direct_dependent_configs = [ ":blink_headers_config" ] +} + +# GYP version: WebKit/public/blink_devtools.gyp:blink_devtools_frontend_resources +group("blink_devtools_frontend_resources") { + deps = [ + "//third_party/WebKit/Source/devtools:devtools_frontend_resources", + ] +} + +# GYP version: WebKit/public/blink_devtools.gyp:blink_generate_devtools_grd +group("blink_generate_devtools_grd") { + deps = [ + "//third_party/WebKit/Source/devtools:generate_devtools_grd", + ] +} diff --git a/chromium/third_party/WebKit/public/DEPS b/chromium/third_party/WebKit/public/DEPS index 4e83c6f1263..2ca006ca349 100644 --- a/chromium/third_party/WebKit/public/DEPS +++ b/chromium/third_party/WebKit/public/DEPS @@ -1,3 +1,4 @@ include_rules = [ + "+platform/heap", "+wtf", ] diff --git a/chromium/third_party/WebKit/public/OWNERS b/chromium/third_party/WebKit/public/OWNERS index dfa63339866..aa439734214 100644 --- a/chromium/third_party/WebKit/public/OWNERS +++ b/chromium/third_party/WebKit/public/OWNERS @@ -5,3 +5,5 @@ jamesr@chromium.org jochen@chromium.org pfeldman@chromium.org tkent@chromium.org +per-file blink_skia_config.gyp=bungeman@chromium.org +per-file blink_skia_config.gyp=reed@chromium.org diff --git a/chromium/third_party/WebKit/public/README b/chromium/third_party/WebKit/public/README index 0da44c2203a..4e07a86a350 100644 --- a/chromium/third_party/WebKit/public/README +++ b/chromium/third_party/WebKit/public/README @@ -21,11 +21,10 @@ Blink's needs change. Organization ------------ -The API is organized into three parts: +The API is organized into two parts: - public/platform - public/web - - public/testing The public/platform directory defines an abstract platform upon which Blink runs. Rather than communicating directly with the underlying operating system, @@ -41,10 +40,6 @@ exploring the API. Note that public/platform should not depend on public/web. -The public/testing directory defines an interface for testing Blink. You can -use this part of the API to load the TestRunner module used in Blink's test -suite. - Basic Types ----------- diff --git a/chromium/third_party/WebKit/public/all.gyp b/chromium/third_party/WebKit/public/all.gyp index 5c691aa1b09..4ca4c519b68 100644 --- a/chromium/third_party/WebKit/public/all.gyp +++ b/chromium/third_party/WebKit/public/all.gyp @@ -33,22 +33,22 @@ ], 'targets': [ { + # GN version: //third_party/WebKit/public:all_blink 'target_name': 'all_blink', 'type': 'none', 'dependencies': [ - '../Source/testing/testing.gyp:TestRunner', - '../Source/heap/blink_heap_tests.gyp:blink_heap_unittests', + '../Source/platform/blink_platform_tests.gyp:blink_heap_unittests', '../Source/platform/blink_platform_tests.gyp:blink_platform_unittests', '../Source/web/web_tests.gyp:webkit_unit_tests', '../Source/wtf/wtf_tests.gyp:wtf_unittests', ], 'conditions': [ - # Special target to wrap a gtest_target_type==shared_library - # webkit_unit_tests into an android apk for execution. See - # base.gyp for TODO(jrg)s about this strategy. - ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', { + ['OS=="android" and android_webview_build==0', { 'dependencies': [ + '../Source/platform/blink_platform_tests.gyp:blink_heap_unittests_apk', + '../Source/platform/blink_platform_tests.gyp:blink_platform_unittests_apk', '../Source/web/web_tests.gyp:webkit_unit_tests_apk', + '../Source/wtf/wtf_tests.gyp:wtf_unittests_apk', ], }], ], diff --git a/chromium/third_party/WebKit/public/blink.gyp b/chromium/third_party/WebKit/public/blink.gyp index ec528d7b44b..a389b2185cb 100644 --- a/chromium/third_party/WebKit/public/blink.gyp +++ b/chromium/third_party/WebKit/public/blink.gyp @@ -33,15 +33,17 @@ ], 'targets': [ { + # GN version: //third_party/WebKit/public:blink 'target_name': 'blink', 'type': 'none', 'dependencies': [ - '../Source/web/web.gyp:webkit', '../Source/platform/blink_platform.gyp:blink_platform', + '../Source/web/web.gyp:blink_web', + 'blink_headers.gyp:blink_headers', 'blink_minimal', ], 'export_dependent_settings': [ - '../Source/web/web.gyp:webkit', + '../Source/web/web.gyp:blink_web', '../Source/platform/blink_platform.gyp:blink_platform', 'blink_minimal', ], @@ -51,6 +53,8 @@ # places that cannot link against the full Blink library. # FIXME: We really shouldn't have this at all and should instead remove all uses # of Blink's API types from places that can't link against Blink. crbug.com/248653 + # + # GN version: //third_party/WebKit/public:blink_minimal 'target_name': 'blink_minimal', 'type': 'none', 'dependencies': [ @@ -60,5 +64,16 @@ '../Source/platform/blink_platform.gyp:blink_common', ], }, + { + # GN version: //third_party/WebKit/public:test_support + 'target_name': 'blink_test_support', + 'type': 'none', + 'dependencies': [ + '../Source/web/web.gyp:blink_web_test_support', + ], + 'export_dependent_settings': [ + '../Source/web/web.gyp:blink_web_test_support', + ], + }, ], } diff --git a/chromium/third_party/WebKit/public/blink_devtools.gyp b/chromium/third_party/WebKit/public/blink_devtools.gyp index 2cec4df789a..6c88f482878 100644 --- a/chromium/third_party/WebKit/public/blink_devtools.gyp +++ b/chromium/third_party/WebKit/public/blink_devtools.gyp @@ -30,6 +30,7 @@ { 'targets': [ { + # GN version: //third_party/WebKit/public:blink_devtools_frontend_resources 'target_name': 'blink_devtools_frontend_resources', 'type': 'none', 'dependencies': [ @@ -37,6 +38,7 @@ ], }, { + # GN version: //third_party/WebKit/public:blink_generate_devtools_grd 'target_name': 'blink_generate_devtools_grd', 'type': 'none', 'dependencies': [ diff --git a/chromium/third_party/WebKit/public/blink_headers.gyp b/chromium/third_party/WebKit/public/blink_headers.gyp new file mode 100644 index 00000000000..b0aecff6156 --- /dev/null +++ b/chromium/third_party/WebKit/public/blink_headers.gyp @@ -0,0 +1,18 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'targets': [ + { + # Depend on this target to use public blink API headers for things + # like enums and public structures without actually linking against any Blink + # libraries. + 'target_name': 'blink_headers', + 'type': 'none', + 'direct_dependent_settings': { + 'include_dirs': [ '..' ], + }, + }, + ] +} + diff --git a/chromium/third_party/WebKit/public/blink_test_plugin.gyp b/chromium/third_party/WebKit/public/blink_test_plugin.gyp deleted file mode 100644 index 2c3f4a2f9eb..00000000000 --- a/chromium/third_party/WebKit/public/blink_test_plugin.gyp +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (C) 2013 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. -# -{ - 'targets': [ - { - 'target_name': 'blink_test_plugin', - 'type': 'none', - 'dependencies': [ - '../Source/testing/testing.gyp:copy_TestNetscapePlugIn', - ], - 'export_dependent_settings': [ - '../Source/testing/testing.gyp:copy_TestNetscapePlugIn', - ], - }, - ], -} diff --git a/chromium/third_party/WebKit/public/blink_test_runner.gyp b/chromium/third_party/WebKit/public/blink_test_runner.gyp deleted file mode 100644 index e875e45c078..00000000000 --- a/chromium/third_party/WebKit/public/blink_test_runner.gyp +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (C) 2013 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. -# -{ - 'targets': [ - { - 'target_name': 'blink_test_runner', - 'type': 'none', - 'dependencies': [ - '../Source/testing/testing.gyp:TestRunner', - ], - 'export_dependent_settings': [ - '../Source/testing/testing.gyp:TestRunner', - ], - }, - ], -} diff --git a/chromium/third_party/WebKit/public/platform/DEPS b/chromium/third_party/WebKit/public/platform/DEPS new file mode 100644 index 00000000000..85c30cab46c --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + "+platform", + "+third_party/skia", +] diff --git a/chromium/third_party/WebKit/public/platform/Platform.h b/chromium/third_party/WebKit/public/platform/Platform.h index b4f463dc9b2..32a77166405 100644 --- a/chromium/third_party/WebKit/public/platform/Platform.h +++ b/chromium/third_party/WebKit/public/platform/Platform.h @@ -38,10 +38,14 @@ #include "WebAudioDevice.h" #include "WebCommon.h" #include "WebData.h" +#include "WebGamepadListener.h" #include "WebGamepads.h" +#include "WebGestureDevice.h" #include "WebGraphicsContext3D.h" #include "WebLocalizedString.h" +#include "WebLockOrientationCallback.h" #include "WebSpeechSynthesizer.h" +#include "WebStorageQuotaCallbacks.h" #include "WebStorageQuotaType.h" #include "WebString.h" #include "WebURLError.h" @@ -52,13 +56,16 @@ class GrContext; namespace blink { class WebAudioBus; +class WebBatteryStatusListener; class WebBlobRegistry; class WebContentDecryptionModule; class WebClipboard; class WebCompositorSupport; +class WebConvertableToTraceFormat; class WebCookieJar; class WebCrypto; class WebDatabaseObserver; +class WebDeviceLightListener; class WebDeviceMotionListener; class WebDeviceOrientationListener; class WebDiscardableMemory; @@ -82,19 +89,20 @@ class WebPublicSuffixList; class WebRTCPeerConnectionHandler; class WebRTCPeerConnectionHandlerClient; class WebSandboxSupport; +class WebScrollbarBehavior; class WebSocketHandle; class WebSocketStreamHandle; class WebSpeechSynthesizer; class WebSpeechSynthesizerClient; class WebStorageNamespace; -class WebStorageQuotaCallbacks; -class WebUnitTestSupport; +struct WebFloatPoint; class WebThemeEngine; class WebThread; class WebURL; class WebURLLoader; +class WebUnitTestSupport; +class WebWaitableEvent; class WebWorkerRunLoop; -struct WebFloatPoint; struct WebLocalizedString; struct WebSize; @@ -136,12 +144,6 @@ public: virtual WebSpeechSynthesizer* createSpeechSynthesizer(WebSpeechSynthesizerClient*) { return 0; } - // Media -------------------------------------------------------------- - - // May return null. - virtual WebContentDecryptionModule* createContentDecryptionModule(const WebString& keySystem) { return 0; } - - // Audio -------------------------------------------------------------- virtual double audioHardwareSampleRate() { return 0; } @@ -152,10 +154,6 @@ public: // Pass in (numberOfInputChannels > 0) if live/local audio input is desired. virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*, const WebString& deviceId) { return 0; } - // FIXME: remove deprecated APIs once chromium switches over to new method. - virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*) { return 0; } - virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*) { return 0; } - // MIDI ---------------------------------------------------------------- @@ -164,6 +162,12 @@ public: virtual WebMIDIAccessor* createMIDIAccessor(WebMIDIAccessorClient*) { return 0; } + // Battery ------------------------------------------------------------- + + // Sets the listener for watching battery status updates. + virtual void setBatteryStatusListener(blink::WebBatteryStatusListener*) { } + + // Blob ---------------------------------------------------------------- // Must return non-null. @@ -216,6 +220,8 @@ public: virtual void sampleGamepads(WebGamepads& into) { into.length = 0; } + virtual void setGamepadListener(WebGamepadListener*) { } + // History ------------------------------------------------------------- @@ -252,6 +258,10 @@ public: // Return the physical memory of the current machine, in MB. virtual size_t physicalMemoryMB() { return 0; } + // Return the available virtual memory of the current machine, in MB. Or + // zero, if there is no limit. + virtual size_t virtualMemoryLimitMB() { return 0; } + // Return the number of of processors of the current machine. virtual size_t numberOfProcessors() { return 0; } @@ -301,9 +311,9 @@ public: // Message Ports ------------------------------------------------------- - // Creates a Message Port Channel. This can be called on any thread. - // The returned object should only be used on the thread it was created on. - virtual WebMessagePortChannel* createMessagePortChannel() { return 0; } + // Creates a Message Port Channel pair. This can be called on any thread. + // The returned objects should only be used on the thread they were created on. + virtual void createMessageChannel(WebMessagePortChannel** channel1, WebMessagePortChannel** channel2) { *channel1 = 0; *channel2 = 0; } // Network ------------------------------------------------------------- @@ -320,8 +330,8 @@ public: // Returns a new WebSocketHandle instance. virtual WebSocketHandle* createWebSocketHandle() { return 0; } - // Returns the User-Agent string that should be used for the given URL. - virtual WebString userAgent(const WebURL&) { return WebString(); } + // Returns the User-Agent string. + virtual WebString userAgent() { return WebString(); } // A suggestion to cache this metadata in association with this URL. virtual void cacheMetadata(const WebURL&, double responseTime, const char* data, size_t dataSize) { } @@ -363,6 +373,18 @@ public: virtual WebThread* currentThread() { return 0; } + // WaitableEvent ------------------------------------------------------- + + // Creates an embedder-defined waitable event object. + virtual WebWaitableEvent* createWaitableEvent() { return 0; } + + // Waits on multiple events and returns the event object that has been + // signaled. This may return 0 if it fails to wait events. + // Any event objects given to this method must not deleted while this + // wait is happening. + virtual WebWaitableEvent* waitMultipleEvents(const WebVector<WebWaitableEvent*>& events) { return 0; } + + // Profiling ----------------------------------------------------------- virtual void decrementStatsCounter(const char* name) { } @@ -377,8 +399,7 @@ public: // Decodes the in-memory audio file data and returns the linear PCM audio data in the destinationBus. // A sample-rate conversion to sampleRate will occur if the file data is at a different sample-rate. // Returns true on success. - virtual bool loadAudioResource(WebAudioBus* destinationBus, const char* audioFileData, size_t dataSize, double sampleRate) { return false; } - + virtual bool loadAudioResource(WebAudioBus* destinationBus, const char* audioFileData, size_t dataSize) { return false; } // Screen ------------------------------------------------------------- @@ -386,6 +407,12 @@ public: virtual void screenColorProfile(WebVector<char>* profile) { } + // Scrollbar ---------------------------------------------------------- + + // Must return non-null. + virtual WebScrollbarBehavior* scrollbarBehavior() { return 0; } + + // Sudden Termination -------------------------------------------------- // Disable/Enable sudden termination. @@ -430,7 +457,6 @@ public: // Testing ------------------------------------------------------------- -#define HAVE_WEBUNITTESTSUPPORT 1 // Get a pointer to testing support interfaces. Will not be available in production builds. virtual WebUnitTestSupport* unitTestSupport() { return 0; } @@ -491,8 +517,12 @@ public: // - POINTER (5): void* // - STRING (6): char* (long-lived null-terminated char* string) // - COPY_STRING (7): char* (temporary null-terminated char* string) + // - CONVERTABLE (8): WebConvertableToTraceFormat // - argValues is the array of argument values. Each value is the unsigned // long long member of a union of all supported types. + // - convertableValues is the array of WebConvertableToTraceFormat classes + // that may be converted to trace format by calling asTraceFormat method. + // ConvertableToTraceFormat interface. // - thresholdBeginId optionally specifies the value returned by a previous // call to addTraceEvent with a BEGIN phase. // - threshold is used on an END phase event in conjunction with the @@ -516,6 +546,7 @@ public: const char** argNames, const unsigned char* argTypes, const unsigned long long* argValues, + const WebConvertableToTraceFormat* convertableValues, unsigned char flags) { return 0; @@ -537,6 +568,8 @@ public: // // May return null if GPU is not supported. // Returns newly allocated and initialized offscreen WebGraphicsContext3D instance. + // Passing an existing context to shareContext will create the new context in the same share group as the passed context. + virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&, WebGraphicsContext3D* shareContext) { return 0; } virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&) { return 0; } // Returns a newly allocated and initialized offscreen context provider. The provider may return a null @@ -558,8 +591,7 @@ public: // Creates a new fling animation curve instance for device |deviceSource| // with |velocity| and already scrolled |cumulativeScroll| pixels. - virtual WebGestureCurve* createFlingAnimationCurve(int deviceSource, const WebFloatPoint& velocity, const WebSize& cumulativeScroll) { return 0; } - + virtual WebGestureCurve* createFlingAnimationCurve(WebGestureDevice deviceSource, const WebFloatPoint& velocity, const WebSize& cumulativeScroll) { return 0; } // WebRTC ---------------------------------------------------------- @@ -582,16 +614,20 @@ public: virtual WebCrypto* crypto() { return 0; } - // Device Motion / Orientation ---------------------------------------- + // Device Motion / Orientation / Light ---------------------------------------- // Sets a Listener to listen for device motion data updates. // If null, the platform stops providing device motion data to the current listener. virtual void setDeviceMotionListener(blink::WebDeviceMotionListener*) { } // Sets a Listener to listen for device orientation data updates. - // If null, the platform stops proving device orientation data to the current listener. + // If null, the platform stops providing device orientation data to the current listener. virtual void setDeviceOrientationListener(blink::WebDeviceOrientationListener*) { } + // Sets a Listener to listen for device light data updates. + // If null, the platform stops providing device light data to the current listener. + virtual void setDeviceLightListener(blink::WebDeviceLightListener*) { } + // Quota ----------------------------------------------------------- @@ -600,12 +636,10 @@ public: // with the current usage and quota information for the partition. When // an error occurs WebStorageQuotaCallbacks::didFail is called with an // error code. - // The callbacks object is deleted when the callback method is called - // and does not need to be (and should not be) deleted manually. virtual void queryStorageUsageAndQuota( const WebURL& storagePartition, WebStorageQuotaType, - WebStorageQuotaCallbacks*) { } + WebStorageQuotaCallbacks) { } // WebDatabase -------------------------------------------------------- diff --git a/chromium/third_party/WebKit/public/platform/WebAnimationDelegate.h b/chromium/third_party/WebKit/public/platform/WebAnimationDelegate.h index e233e5db69b..6240e715bbf 100644 --- a/chromium/third_party/WebKit/public/platform/WebAnimationDelegate.h +++ b/chromium/third_party/WebKit/public/platform/WebAnimationDelegate.h @@ -33,10 +33,8 @@ namespace blink { class WebAnimationDelegate { public: - // FIXME: Remove wallClockTime once the legacy implementation of CSS - // animations and transitions is removed. - virtual void notifyAnimationStarted(double wallClockTime, double monotonicTime, WebAnimation::TargetProperty) = 0; - virtual void notifyAnimationFinished(double wallClockTime, double monotonicTime, WebAnimation::TargetProperty) = 0; + virtual void notifyAnimationStarted(double monotonicTime, WebAnimation::TargetProperty) = 0; + virtual void notifyAnimationFinished(double monotonicTime, WebAnimation::TargetProperty) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebApplicationCacheHost.h b/chromium/third_party/WebKit/public/platform/WebApplicationCacheHost.h index d45369394fa..ccd0b6a1a33 100644 --- a/chromium/third_party/WebKit/public/web/WebApplicationCacheHost.h +++ b/chromium/third_party/WebKit/public/platform/WebApplicationCacheHost.h @@ -31,14 +31,13 @@ #ifndef WebApplicationCacheHost_h #define WebApplicationCacheHost_h -#include "../platform/WebCommon.h" -#include "../platform/WebURL.h" -#include "../platform/WebVector.h" +#include "WebCommon.h" +#include "WebURL.h" +#include "WebVector.h" namespace blink { class WebApplicationCacheHostClient; -class WebFrame; class WebURL; class WebURLRequest; class WebURLResponse; @@ -71,10 +70,21 @@ public: ObsoleteEvent }; + enum ErrorReason { + ManifestError, + SignatureError, + ResourceError, + ChangedError, + AbortError, + QuotaError, + PolicyError, + UnknownError + }; + virtual ~WebApplicationCacheHost() { } // Called for every request made within the context. - virtual void willStartMainResourceRequest(WebURLRequest& r, const WebFrame*) { } + virtual void willStartMainResourceRequest(WebURLRequest& r, const WebApplicationCacheHost* spawningHost) { } virtual void willStartSubResourceRequest(WebURLRequest&) { } // One or the other selectCache methods is called after having parsed the <html> tag. @@ -117,6 +127,6 @@ public: virtual void deleteAssociatedCacheGroup() { } }; -} // namespace blink +} // namespace blink -#endif // WebApplicationCacheHost_h +#endif // WebApplicationCacheHost_h diff --git a/chromium/third_party/WebKit/public/web/WebApplicationCacheHostClient.h b/chromium/third_party/WebKit/public/platform/WebApplicationCacheHostClient.h index 72f841282e6..6c49d2b2e5e 100644 --- a/chromium/third_party/WebKit/public/web/WebApplicationCacheHostClient.h +++ b/chromium/third_party/WebKit/public/platform/WebApplicationCacheHostClient.h @@ -31,8 +31,8 @@ #ifndef WebApplicationCacheHostClient_h #define WebApplicationCacheHostClient_h -#include "../platform/WebCommon.h" #include "WebApplicationCacheHost.h" +#include "WebCommon.h" namespace blink { @@ -45,13 +45,13 @@ public: // Called to fire events in the scriptable interface. virtual void notifyEventListener(WebApplicationCacheHost::EventID) = 0; virtual void notifyProgressEventListener(const WebURL&, int num_total, int num_complete) = 0; + virtual void notifyErrorEventListener(WebApplicationCacheHost::ErrorReason, const WebURL&, int status, const WebString& message) = 0; protected: // Should not be deleted by the embedder. virtual ~WebApplicationCacheHostClient() { } }; -} // namespace blink - -#endif // WebApplicationCacheHostClient_h +} // namespace blink +#endif // WebApplicationCacheHostClient_h diff --git a/chromium/third_party/WebKit/public/platform/WebArrayBuffer.h b/chromium/third_party/WebKit/public/platform/WebArrayBuffer.h index 85f61bf16be..c5bc61badad 100644 --- a/chromium/third_party/WebKit/public/platform/WebArrayBuffer.h +++ b/chromium/third_party/WebKit/public/platform/WebArrayBuffer.h @@ -41,6 +41,10 @@ template <class T> class Handle; namespace WTF { class ArrayBuffer; } +#if INSIDE_BLINK +namespace WTF { template <typename T> class PassRefPtr; } +#endif + namespace blink { class WebArrayBuffer { @@ -55,22 +59,19 @@ public: return *this; } - BLINK_EXPORT static WebArrayBuffer create(unsigned numElements, unsigned elementByteSize); + BLINK_PLATFORM_EXPORT static WebArrayBuffer create(unsigned numElements, unsigned elementByteSize); - BLINK_EXPORT void reset(); - BLINK_EXPORT void assign(const WebArrayBuffer&); + BLINK_PLATFORM_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void assign(const WebArrayBuffer&); bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT void* data() const; - BLINK_EXPORT unsigned byteLength() const; - - BLINK_EXPORT v8::Handle<v8::Value> toV8Value(); - BLINK_EXPORT static WebArrayBuffer* createFromV8Value(v8::Handle<v8::Value>); + BLINK_PLATFORM_EXPORT void* data() const; + BLINK_PLATFORM_EXPORT unsigned byteLength() const; -#if BLINK_IMPLEMENTATION - WebArrayBuffer(const WTF::PassRefPtr<WTF::ArrayBuffer>&); - WebArrayBuffer& operator=(const PassRefPtr<WTF::ArrayBuffer>&); - operator WTF::PassRefPtr<WTF::ArrayBuffer>() const; +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebArrayBuffer(const WTF::PassRefPtr<WTF::ArrayBuffer>&); + BLINK_PLATFORM_EXPORT WebArrayBuffer& operator=(const WTF::PassRefPtr<WTF::ArrayBuffer>&); + BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WTF::ArrayBuffer>() const; #endif protected: diff --git a/chromium/third_party/WebKit/public/platform/WebAudioSourceProvider.h b/chromium/third_party/WebKit/public/platform/WebAudioSourceProvider.h index af8664f7eba..438426427ce 100644 --- a/chromium/third_party/WebKit/public/platform/WebAudioSourceProvider.h +++ b/chromium/third_party/WebKit/public/platform/WebAudioSourceProvider.h @@ -34,14 +34,13 @@ class WebAudioSourceProviderClient; // Abstract interface for a pull-model client. class WebAudioSourceProvider { public: + virtual ~WebAudioSourceProvider() { } + // provideInput() gets called repeatedly to render time-slices of a continuous audio stream. virtual void provideInput(const WebVector<float*>& audioData, size_t numberOfFrames) = 0; // If a client is set, we call it back when the audio format is available. virtual void setClient(WebAudioSourceProviderClient*) { }; - -protected: - virtual ~WebAudioSourceProvider() { } }; } // WebKit diff --git a/chromium/third_party/WebKit/public/platform/WebBatteryStatus.h b/chromium/third_party/WebKit/public/platform/WebBatteryStatus.h new file mode 100644 index 00000000000..e6951fc30c8 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebBatteryStatus.h @@ -0,0 +1,30 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebBatteryStatus_h +#define WebBatteryStatus_h + +#include <limits> + +namespace blink { + +class WebBatteryStatus { +public: + WebBatteryStatus() + : charging(true) + , chargingTime(0.0) + , dischargingTime(std::numeric_limits<double>::infinity()) + , level(1.0) + { + } + + bool charging; + double chargingTime; + double dischargingTime; + double level; +}; + +} // namespace blink + +#endif // WebBatteryStatus_h diff --git a/chromium/third_party/WebKit/public/platform/WebBatteryStatusListener.h b/chromium/third_party/WebKit/public/platform/WebBatteryStatusListener.h new file mode 100644 index 00000000000..f385b15b8f8 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebBatteryStatusListener.h @@ -0,0 +1,24 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebBatteryStatusListener_h +#define WebBatteryStatusListener_h + +#include "WebBatteryStatus.h" + +namespace blink { + +class WebBatteryStatus; + +class WebBatteryStatusListener { +public: + // This method is called when a new battery status is available. + virtual void updateBatteryStatus(const WebBatteryStatus&) = 0; + + virtual ~WebBatteryStatusListener() { } +}; + +} // namespace blink + +#endif // WebBatteryStatusListener_h diff --git a/chromium/third_party/WebKit/public/platform/WebBlobData.h b/chromium/third_party/WebKit/public/platform/WebBlobData.h index 06d0d7fcd93..15e9a68dad1 100644 --- a/chromium/third_party/WebKit/public/platform/WebBlobData.h +++ b/chromium/third_party/WebKit/public/platform/WebBlobData.h @@ -71,8 +71,6 @@ public: BLINK_PLATFORM_EXPORT WebString contentType() const; - BLINK_PLATFORM_EXPORT WebString contentDisposition() const; - #if INSIDE_BLINK BLINK_PLATFORM_EXPORT WebBlobData(const WTF::PassOwnPtr<WebCore::BlobData>&); BLINK_PLATFORM_EXPORT WebBlobData& operator=(const WTF::PassOwnPtr<WebCore::BlobData>&); diff --git a/chromium/third_party/WebKit/public/platform/WebBlobInfo.h b/chromium/third_party/WebKit/public/platform/WebBlobInfo.h new file mode 100644 index 00000000000..d3a66ecef7b --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebBlobInfo.h @@ -0,0 +1,90 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebBlobInfo_h +#define WebBlobInfo_h + +#include "WebCommon.h" +#include "WebString.h" + +namespace blink { + +class WebBlobInfo { +public: + WebBlobInfo() + : m_isFile(false) + , m_size(-1) + , m_lastModified(0) + { + } + WebBlobInfo(const WebString& uuid, const WebString& type, long long size) + : m_isFile(false) + , m_uuid(uuid) + , m_type(type) + , m_size(size) + , m_lastModified(0) + { + } + WebBlobInfo(const WebString& uuid, const WebString& filePath, const WebString& fileName, const WebString& type) + : m_isFile(true) + , m_uuid(uuid) + , m_type(type) + , m_size(-1) + , m_filePath(filePath) + , m_fileName(fileName) + , m_lastModified(0) + { + } + WebBlobInfo(const WebString& uuid, const WebString& filePath, const WebString& fileName, const WebString& type, double lastModified, long long size) + : m_isFile(true) + , m_uuid(uuid) + , m_type(type) + , m_size(size) + , m_filePath(filePath) + , m_fileName(fileName) + , m_lastModified(lastModified) + { + } + bool isFile() const + { + return m_isFile; + } + const WebString& uuid() const + { + return m_uuid; + } + const WebString& type() const + { + return m_type; + } + long long size() const + { + return m_size; + } + const WebString& filePath() const + { + return m_filePath; + } + const WebString& fileName() const + { + return m_fileName; + } + double lastModified() const + { + return m_lastModified; + } + +private: + bool m_isFile; + WebString m_uuid; + WebString m_type; // MIME type + long long m_size; + WebString m_filePath; // Only for File + WebString m_fileName; // Only for File + double m_lastModified; // Only for File +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallback.h b/chromium/third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallback.h new file mode 100644 index 00000000000..45a61be2332 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallback.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2014 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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. + */ + +#ifndef WebCompositeAndReadbackAsyncCallback_h +#define WebCompositeAndReadbackAsyncCallback_h + +class SkBitmap; + +namespace blink { + +class WebCompositeAndReadbackAsyncCallback { +public: + virtual void didCompositeAndReadback(const SkBitmap&) = 0; +}; + +} // namespace blink + +#endif // WebCompositeAndReadbackAsyncCallback_h diff --git a/chromium/third_party/WebKit/public/platform/WebCompositingReasons.h b/chromium/third_party/WebKit/public/platform/WebCompositingReasons.h deleted file mode 100644 index 4affa6d25b0..00000000000 --- a/chromium/third_party/WebKit/public/platform/WebCompositingReasons.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef WebCompositingReasons_h -#define WebCompositingReasons_h - -#include "WebCommon.h" -#include <stdint.h> - -namespace blink { - -// This is a clone of CompositingReasons in RenderLayer.h. -const uint64_t CompositingReasonUnknown = 0; -const uint64_t CompositingReason3DTransform = static_cast<uint64_t>(1) << 0; -const uint64_t CompositingReasonVideo = static_cast<uint64_t>(1) << 1; -const uint64_t CompositingReasonCanvas = static_cast<uint64_t>(1) << 2; -const uint64_t CompositingReasonPlugin = static_cast<uint64_t>(1) << 3; -const uint64_t CompositingReasonIFrame = static_cast<uint64_t>(1) << 4; -const uint64_t CompositingReasonBackfaceVisibilityHidden = static_cast<uint64_t>(1) << 5; -const uint64_t CompositingReasonAnimation = static_cast<uint64_t>(1) << 6; -const uint64_t CompositingReasonFilters = static_cast<uint64_t>(1) << 7; -const uint64_t CompositingReasonPositionFixed = static_cast<uint64_t>(1) << 8; -const uint64_t CompositingReasonPositionSticky = static_cast<uint64_t>(1) << 9; -const uint64_t CompositingReasonOverflowScrollingTouch = static_cast<uint64_t>(1) << 10; -const uint64_t CompositingReasonAssumedOverlap = static_cast<uint64_t>(1) << 12; -const uint64_t CompositingReasonOverlap = static_cast<uint64_t>(1) << 13; -const uint64_t CompositingReasonNegativeZIndexChildren = static_cast<uint64_t>(1) << 14; -const uint64_t CompositingReasonTransformWithCompositedDescendants = static_cast<uint64_t>(1) << 15; -const uint64_t CompositingReasonOpacityWithCompositedDescendants = static_cast<uint64_t>(1) << 16; -const uint64_t CompositingReasonMaskWithCompositedDescendants = static_cast<uint64_t>(1) << 17; -const uint64_t CompositingReasonReflectionWithCompositedDescendants = static_cast<uint64_t>(1) << 18; -const uint64_t CompositingReasonFilterWithCompositedDescendants = static_cast<uint64_t>(1) << 19; -const uint64_t CompositingReasonBlendingWithCompositedDescendants = static_cast<uint64_t>(1) << 20; -const uint64_t CompositingReasonClipsCompositingDescendants = static_cast<uint64_t>(1) << 21; -const uint64_t CompositingReasonPerspective = static_cast<uint64_t>(1) << 22; -const uint64_t CompositingReasonPreserve3D = static_cast<uint64_t>(1) << 23; -const uint64_t CompositingReasonReflectionOfCompositedParent = static_cast<uint64_t>(1) << 24; -const uint64_t CompositingReasonRoot = static_cast<uint64_t>(1) << 25; -const uint64_t CompositingReasonLayerForClip = static_cast<uint64_t>(1) << 26; -const uint64_t CompositingReasonLayerForScrollbar = static_cast<uint64_t>(1) << 27; -const uint64_t CompositingReasonLayerForScrollingContainer = static_cast<uint64_t>(1) << 28; -const uint64_t CompositingReasonLayerForForeground = static_cast<uint64_t>(1) << 29; -const uint64_t CompositingReasonLayerForBackground = static_cast<uint64_t>(1) << 30; -const uint64_t CompositingReasonLayerForMask = static_cast<uint64_t>(1) << 31; -const uint64_t CompositingReasonOverflowScrollingParent = static_cast<uint64_t>(1) << 32; -const uint64_t CompositingReasonOutOfFlowClipping = static_cast<uint64_t>(1) << 33; -const uint64_t CompositingReasonIsolateCompositedDescendants = static_cast<uint64_t>(1) << 35; - -typedef uint64_t WebCompositingReasons; - -} // namespace blink - -#endif // WebCompositingReasons_h diff --git a/chromium/third_party/WebKit/public/platform/WebCompositorSupport.h b/chromium/third_party/WebKit/public/platform/WebCompositorSupport.h index 9f33d321c78..140cfd2e124 100644 --- a/chromium/third_party/WebKit/public/platform/WebCompositorSupport.h +++ b/chromium/third_party/WebKit/public/platform/WebCompositorSupport.h @@ -74,12 +74,13 @@ public: virtual WebNinePatchLayer* createNinePatchLayer() { return 0; } + // TODO(dshwang): This isn't used anymore. virtual WebSolidColorLayer* createSolidColorLayer() { return 0; } // The ownership of the WebScrollbarThemeGeometry pointer is passed to Chromium. virtual WebScrollbarLayer* createScrollbarLayer(WebScrollbar*, WebScrollbarThemePainter, WebScrollbarThemeGeometry*) { return 0; } - virtual WebScrollbarLayer* createSolidColorScrollbarLayer(WebScrollbar::Orientation, int thumbThickness, bool isLeftSideVerticalScrollbar) { return 0; } + virtual WebScrollbarLayer* createSolidColorScrollbarLayer(WebScrollbar::Orientation, int thumbThickness, int trackStart, bool isLeftSideVerticalScrollbar) { return 0; } // Animation ---------------------------------------------------- diff --git a/chromium/third_party/WebKit/public/web/WebPasswordGeneratorClient.h b/chromium/third_party/WebKit/public/platform/WebConnectionType.h index 254bedd15cb..db5b2aac298 100644 --- a/chromium/third_party/WebKit/public/web/WebPasswordGeneratorClient.h +++ b/chromium/third_party/WebKit/public/platform/WebConnectionType.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Google Inc. All rights reserved. + * Copyright (C) 2014 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 @@ -28,20 +28,22 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebPasswordGeneratorClient_h -#define WebPasswordGeneratorClient_h +#ifndef WebConnectionType_h +#define WebConnectionType_h namespace blink { -class WebInputElement; - -class WebPasswordGeneratorClient { -public: - virtual void openPasswordGenerator(WebInputElement&) = 0; - - virtual ~WebPasswordGeneratorClient() { } +// Connection types from http://w3c.github.io/netinfo/. +enum WebConnectionType { + ConnectionTypeCellular = 0, + ConnectionTypeBluetooth, + ConnectionTypeEthernet, + ConnectionTypeWifi, + ConnectionTypeOther, + ConnectionTypeNone, + ConnectionTypeLast = ConnectionTypeNone }; -} +} // namespace blink -#endif // WebPasswordGeneratorClient_h +#endif // WebConnectionType_h diff --git a/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleException.h b/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleException.h new file mode 100644 index 00000000000..e17dc79b506 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleException.h @@ -0,0 +1,22 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebContentDecryptionModuleException_h +#define WebContentDecryptionModuleException_h + +namespace blink { + +enum WebContentDecryptionModuleException { + WebContentDecryptionModuleExceptionNotSupportedError, + WebContentDecryptionModuleExceptionInvalidStateError, + WebContentDecryptionModuleExceptionInvalidAccessError, + WebContentDecryptionModuleExceptionQuotaExceededError, + WebContentDecryptionModuleExceptionUnknownError, + WebContentDecryptionModuleExceptionClientError, + WebContentDecryptionModuleExceptionOutputError, +}; + +} // namespace blink + +#endif // WebContentDecryptionModuleException_h diff --git a/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h b/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h new file mode 100644 index 00000000000..5106b59dfc3 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h @@ -0,0 +1,73 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebContentDecryptionModuleResult_h +#define WebContentDecryptionModuleResult_h + +#include "WebCommon.h" +#include "WebContentDecryptionModuleException.h" +#include "WebPrivatePtr.h" + +namespace WebCore { +class ContentDecryptionModuleResult; +} + +namespace blink { + +class WebString; + +class WebContentDecryptionModuleResult { +public: + enum SessionStatus { + // New session has been initialized. + NewSession, + + // CDM could not find the requested session. + SessionNotFound, + + // CDM already has a non-closed session that matches the provided + // parameters. + SessionAlreadyExists, + }; + + WebContentDecryptionModuleResult(const WebContentDecryptionModuleResult& o) + { + assign(o); + } + + ~WebContentDecryptionModuleResult() + { + reset(); + } + + WebContentDecryptionModuleResult& operator=(const WebContentDecryptionModuleResult& o) + { + assign(o); + return *this; + } + + // Called when the CDM completes an operation and has no additional data to + // pass back. + BLINK_PLATFORM_EXPORT void complete(); + + // Called when the CDM completes a session operation. + BLINK_PLATFORM_EXPORT void completeWithSession(SessionStatus); + + // Called when the operation fails. + BLINK_PLATFORM_EXPORT void completeWithError(WebContentDecryptionModuleException, unsigned long systemCode, const WebString& message); + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT explicit WebContentDecryptionModuleResult(WebCore::ContentDecryptionModuleResult*); +#endif + +private: + BLINK_PLATFORM_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void assign(const WebContentDecryptionModuleResult&); + + WebPrivatePtr<WebCore::ContentDecryptionModuleResult> m_impl; +}; + +} // namespace blink + +#endif // WebContentDecryptionModuleSession_h diff --git a/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleSession.h b/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleSession.h index 4b01c4f14ec..f5d9db22cbc 100644 --- a/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleSession.h +++ b/chromium/third_party/WebKit/public/platform/WebContentDecryptionModuleSession.h @@ -32,6 +32,8 @@ #define WebContentDecryptionModuleSession_h #include "WebCommon.h" +#include "public/platform/WebContentDecryptionModuleException.h" +#include "public/platform/WebContentDecryptionModuleResult.h" namespace blink { @@ -47,9 +49,12 @@ public: MediaKeyErrorCodeClient, }; - virtual void keyAdded() = 0; - virtual void keyError(MediaKeyErrorCode, unsigned long systemCode) = 0; - virtual void keyMessage(const unsigned char* message, size_t messageLength, const blink::WebURL& destinationURL) = 0; + virtual void message(const unsigned char* message, size_t messageLength, const WebURL& destinationURL) = 0; + virtual void ready() = 0; + virtual void close() = 0; + // FIXME: Remove this method once Chromium updated to use the new parameters. + virtual void error(MediaKeyErrorCode, unsigned long systemCode) = 0; + virtual void error(WebContentDecryptionModuleException, unsigned long systemCode, const WebString& message) = 0; protected: virtual ~Client(); @@ -58,9 +63,15 @@ public: virtual ~WebContentDecryptionModuleSession(); virtual WebString sessionId() const = 0; - virtual void generateKeyRequest(const WebString& mimeType, const unsigned char* initData, size_t initDataLength) = 0; - virtual void update(const unsigned char* key, size_t keyLength) = 0; - virtual void close() = 0; + + // FIXME: Remove these methods once the new methods are implemented in Chromium. + virtual void initializeNewSession(const WebString& mimeType, const unsigned char* initData, size_t initDataLength) = 0; + virtual void update(const unsigned char* response, size_t responseLength) = 0; + virtual void release() = 0; + + virtual void initializeNewSession(const WebString& initDataType, const unsigned char* initData, size_t initDataLength, const WebString& sessionType, const WebContentDecryptionModuleResult&); + virtual void update(const unsigned char* response, size_t responseLength, const WebContentDecryptionModuleResult&); + virtual void release(const WebContentDecryptionModuleResult&); }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebContentLayerClient.h b/chromium/third_party/WebKit/public/platform/WebContentLayerClient.h index 80efd0b1765..ec500d974b4 100644 --- a/chromium/third_party/WebKit/public/platform/WebContentLayerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebContentLayerClient.h @@ -35,6 +35,8 @@ struct WebFloatRect; class BLINK_PLATFORM_EXPORT WebContentLayerClient { public: + enum GraphicsContextStatus { GraphicsContextEnabled, GraphicsContextDisabled }; + // Paints the content area for the layer, typically dirty rects submitted // through WebContentLayer::setNeedsDisplay, submitting drawing commands // through the WebCanvas. @@ -42,7 +44,9 @@ public: // Optionally, the implementation may set |opaque| to a rect covering pixels that // the implementation knows are opaque. This information can be used for various // optimizations. - virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque) = 0; + // The |disableContext| enum controls most processing in + // GraphicsContext to isolate the painting code in performance tests. + virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque, GraphicsContextStatus = GraphicsContextEnabled) = 0; protected: virtual ~WebContentLayerClient() { } diff --git a/chromium/third_party/WebKit/public/platform/WebConvertableToTraceFormat.h b/chromium/third_party/WebKit/public/platform/WebConvertableToTraceFormat.h new file mode 100644 index 00000000000..ee944acb727 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebConvertableToTraceFormat.h @@ -0,0 +1,44 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebConvertableToTraceFormat_h +#define WebConvertableToTraceFormat_h + +#include "WebPrivatePtr.h" +#include "WebString.h" + +namespace WebCore { +namespace TraceEvent { +class ConvertableToTraceFormat; +} +} + +namespace blink { + +class WebConvertableToTraceFormat { +public: + WebConvertableToTraceFormat() { } +#if INSIDE_BLINK + WebConvertableToTraceFormat(WebCore::TraceEvent::ConvertableToTraceFormat*); +#endif + ~WebConvertableToTraceFormat() { reset(); } + + BLINK_PLATFORM_EXPORT WebString asTraceFormat() const; + BLINK_PLATFORM_EXPORT void assign(const WebConvertableToTraceFormat&); + BLINK_PLATFORM_EXPORT void reset(); + + WebConvertableToTraceFormat(const WebConvertableToTraceFormat& r) { assign(r); } + WebConvertableToTraceFormat& operator=(const WebConvertableToTraceFormat& r) + { + assign(r); + return *this; + } + +private: + WebPrivatePtr<WebCore::TraceEvent::ConvertableToTraceFormat> m_private; +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebCrypto.h b/chromium/third_party/WebKit/public/platform/WebCrypto.h index 225e3ee0c64..cc8d15b910b 100644 --- a/chromium/third_party/WebKit/public/platform/WebCrypto.h +++ b/chromium/third_party/WebKit/public/platform/WebCrypto.h @@ -32,18 +32,36 @@ #define WebCrypto_h #include "WebCommon.h" +#include "WebCryptoAlgorithm.h" #include "WebCryptoKey.h" #include "WebPrivatePtr.h" +#include "WebString.h" +#include "WebVector.h" namespace WebCore { class CryptoResult; } -#if BLINK_IMPLEMENTATION +#if INSIDE_BLINK namespace WTF { template <typename T> class PassRefPtr; } #endif +// FIXME: Remove once chromium side rolls. +#define WEBCRYPTO_RESULT_HAS_CANCELLED 1 + namespace blink { class WebArrayBuffer; +class WebString; + +enum WebCryptoErrorType { + WebCryptoErrorTypeType, + WebCryptoErrorTypeNotSupported, + WebCryptoErrorTypeSyntax, + WebCryptoErrorTypeInvalidState, + WebCryptoErrorTypeInvalidAccess, + WebCryptoErrorTypeUnknown, + WebCryptoErrorTypeData, + WebCryptoErrorTypeOperation, +}; class WebCryptoResult { public: @@ -63,54 +81,201 @@ public: return *this; } - BLINK_EXPORT void completeWithError(); - BLINK_EXPORT void completeWithBuffer(const WebArrayBuffer&); - BLINK_EXPORT void completeWithBuffer(const void*, unsigned); - BLINK_EXPORT void completeWithBoolean(bool); - BLINK_EXPORT void completeWithKey(const WebCryptoKey&); - BLINK_EXPORT void completeWithKeyPair(const WebCryptoKey& publicKey, const WebCryptoKey& privateKey); + // Note that WebString is NOT safe to pass across threads. + // + // Error details are surfaced in an exception, and MUST NEVER reveal any + // secret information such as bytes of the key or plain text. An + // appropriate error would be something like: + // "iv must be 16 bytes long". + BLINK_PLATFORM_EXPORT void completeWithError(WebCryptoErrorType, const WebString&); + + // Note that WebArrayBuffer is NOT safe to create from another thread. + BLINK_PLATFORM_EXPORT void completeWithBuffer(const WebArrayBuffer&); + // Makes a copy of the input data given as a pointer and byte length. + BLINK_PLATFORM_EXPORT void completeWithBuffer(const void*, unsigned); + BLINK_PLATFORM_EXPORT void completeWithJson(const char* utf8Data, unsigned length); + BLINK_PLATFORM_EXPORT void completeWithBoolean(bool); + BLINK_PLATFORM_EXPORT void completeWithKey(const WebCryptoKey&); + BLINK_PLATFORM_EXPORT void completeWithKeyPair(const WebCryptoKey& publicKey, const WebCryptoKey& privateKey); + + // Returns true if the underlying operation was cancelled. + // This method can be called from any thread. + BLINK_PLATFORM_EXPORT bool cancelled() const; -#if BLINK_IMPLEMENTATION - explicit WebCryptoResult(const WTF::PassRefPtr<WebCore::CryptoResult>&); +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT explicit WebCryptoResult(const WTF::PassRefPtr<WebCore::CryptoResult>&); #endif private: - BLINK_EXPORT void reset(); - BLINK_EXPORT void assign(const WebCryptoResult&); + BLINK_PLATFORM_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void assign(const WebCryptoResult&); WebPrivatePtr<WebCore::CryptoResult> m_impl; }; +class WebCryptoDigestor { +public: + virtual ~WebCryptoDigestor() { } + + // consume() will return |true| on the successful addition of data to the + // partially generated digest. It will return |false| when that fails. After + // a return of |false|, consume() should not be called again (nor should + // finish() be called). + virtual bool consume(const unsigned char* data, unsigned dataSize) { return false; } + + // finish() will return |true| if the digest has been successfully computed + // and put into the result buffer, otherwise it will return |false|. In + // either case, neither finish() nor consume() should be called again after + // a call to finish(). resultData is valid until the WebCrytpoDigestor + // object is destroyed. + virtual bool finish(unsigned char*& resultData, unsigned& resultDataSize) { return false; } + +protected: + WebCryptoDigestor() { } +}; + class WebCrypto { public: - // Starts a one-shot cryptographic operation which can complete either - // synchronously, or asynchronously. - // - // Let the WebCryptoResult be called "result". - // - // The result should be set exactly once, from the same thread which - // initiated the operation. - // - // * WebCryptoAlgorithms parameters are guaranteed to be !isNull(), - // unless noted otherwise. - // * WebCryptoKey parameters are guaranteeed to be !isNull(). - // * const unsigned char* data buffers are not valid after return. - virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } - virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } - virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } - virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* signature, unsigned signatureSize, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } - virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } - virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } - // The WebCryptoAlgorithm for importKey may be "isNull()" meaning that it - // was unspecified by the caller. - virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, unsigned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } - virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoResult result) { result.completeWithError(); } - - virtual void wrapKey(WebCryptoKeyFormat, const WebCryptoKey& key, const WebCryptoKey& wrappingKey, const WebCryptoAlgorithm&, WebCryptoResult result) { result.completeWithError(); } - - // It is possible for unwrappedKeyAlgorithm.isNull() meaning that it was - // unspecified by the caller. - virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey, unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAlgorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } + // WebCrypto is the interface for starting one-shot cryptographic + // operations. + // + // ----------------------- + // Completing the request + // ----------------------- + // + // Implementations signal completion by calling one of the methods on + // "result". Only a single result/error should be set for the request. + // Different operations expect different result types based on the + // algorithm parameters; see the Web Crypto standard for details. + // + // The result can be set either synchronously while handling the request, + // or asynchronously after the method has returned. When completing + // asynchronously make a copy of the WebCryptoResult and call it from the + // same thread that started the request. + // + // If the request was cancelled it is not necessary for implementations to + // set the result. + // + // ----------------------- + // Threading + // ----------------------- + // + // The WebCrypto interface will be called from blink threads (main or + // web worker). All communication back to Blink must be on this same thread. + // + // Notably: + // + // * The WebCryptoResult can be copied between threads, however all + // methods other than the destructor must be called from the origin + // Blink thread. + // + // * WebCryptoKey and WebCryptoAlgorithm ARE threadsafe. They can be + // safely copied between threads and accessed. Copying is cheap because + // they are internally reference counted. + // + // * WebArrayBuffer is NOT threadsafe. It should only be created from the + // target Blink thread. This means threaded implementations may have to + // make a copy of the output buffer. + // + // ----------------------- + // Inputs + // ----------------------- + // + // * Data buffers are passed as (basePointer, byteLength) pairs. + // These buffers are only valid during the call itself. Asynchronous + // implementations wishing to access it after the function returns + // should make a copy. + // + // * All WebCryptoKeys are guaranteeed to be !isNull(). + // + // * All WebCryptoAlgorithms are guaranteed to be !isNull() + // + // * Look to the Web Crypto spec for an explanation of the parameter. The + // method names here have a 1:1 correspondence with those of + // crypto.subtle, with the exception of "verify" which is here called + // "verifySignature". + // + // ----------------------- + // Guarantees on input validity + // ----------------------- + // + // Implementations MUST carefully sanitize algorithm inputs before using + // them, as they come directly from the user. Few checks have been done on + // algorithm parameters prior to passing to the embedder. + // + // Only the following checks can be assumed as having already passed: + // + // * The key is extractable when calling into exportKey/wrapKey. + // * The key usages permit the operation being requested. + // * The key's algorithm matches that of the requested operation. + // + virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* signature, unsigned signatureSize, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, unsigned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void wrapKey(WebCryptoKeyFormat, const WebCryptoKey& key, const WebCryptoKey& wrappingKey, const WebCryptoAlgorithm&, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey, unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAlgorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } + + // This is the exception to the "Completing the request" guarantees + // outlined above. This is useful for Blink internal crypto and is not part + // of the WebCrypto standard. createDigestor must provide the result via + // the WebCryptoDigestor object synchronously. createDigestor may return 0 + // if it fails to create a WebCryptoDigestor. If it succeeds, the + // WebCryptoDigestor returned by createDigestor must be freed by the + // caller. + virtual WebCryptoDigestor* createDigestor(WebCryptoAlgorithmId algorithmId) { return 0; } + + // ----------------------- + // Structured clone + // ----------------------- + // + // deserializeKeyForClone() and serializeKeyForClone() are used for + // implementing structured cloning of WebCryptoKey. + // + // Blink is responsible for saving and restoring all of the attributes of + // WebCryptoKey EXCEPT for the actual key data: + // + // In other words, Blink takes care of serializing: + // * Key usages + // * Key extractability + // * Key algorithm + // * Key type (public, private, secret) + // + // The embedder is responsible for saving the key data itself. + // + // Visibility of the serialized key data: + // + // The serialized key data will NOT be visible to web pages. So if the + // serialized format were to include key bytes as plain text, this wouldn't + // make it available to web pages. + // + // Longevity of the key data: + // + // The serialized key data is intended to be long lived (years) and MUST + // be using a stable format. For instance a key might be persisted to + // IndexedDB and should be able to be deserialized correctly in the + // future. + // + // Error handling and asynchronous completion: + // + // Serialization/deserialization must complete synchronously, and will + // block the JavaScript thread. + // + // The only reasons to fail serialization/deserialization are: + // * Key serialization not yet implemented + // * The bytes to deserialize were corrupted + + // Creates a new key given key data which was written using + // serializeKeyForClone(). Returns true on success. + virtual bool deserializeKeyForClone(const WebCryptoKeyAlgorithm&, WebCryptoKeyType, bool extractable, WebCryptoKeyUsageMask, const unsigned char* keyData, unsigned keyDataSize, WebCryptoKey&) { return false; } + + // Writes the key data into the given WebVector. + // Returns true on success. + virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned char>&) { return false; } protected: virtual ~WebCrypto() { } diff --git a/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithm.h b/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithm.h index a981a892ca6..09896b44f6b 100644 --- a/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithm.h +++ b/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithm.h @@ -40,13 +40,26 @@ namespace blink { +enum WebCryptoOperation { + WebCryptoOperationEncrypt, + WebCryptoOperationDecrypt, + WebCryptoOperationSign, + WebCryptoOperationVerify, + WebCryptoOperationDigest, + WebCryptoOperationGenerateKey, + WebCryptoOperationImportKey, + WebCryptoOperationDeriveKey, + WebCryptoOperationDeriveBits, + WebCryptoOperationWrapKey, + WebCryptoOperationUnwrapKey, + WebCryptoOperationLast = WebCryptoOperationUnwrapKey, +}; + enum WebCryptoAlgorithmId { WebCryptoAlgorithmIdAesCbc, WebCryptoAlgorithmIdHmac, WebCryptoAlgorithmIdRsaSsaPkcs1v1_5, - WebCryptoAlgorithmIdRsaEsPkcs1v1_5, WebCryptoAlgorithmIdSha1, - WebCryptoAlgorithmIdSha224, WebCryptoAlgorithmIdSha256, WebCryptoAlgorithmIdSha384, WebCryptoAlgorithmIdSha512, @@ -55,7 +68,7 @@ enum WebCryptoAlgorithmId { WebCryptoAlgorithmIdAesCtr, WebCryptoAlgorithmIdAesKw, #if INSIDE_BLINK - NumberOfWebCryptoAlgorithmId, + WebCryptoAlgorithmIdLast = WebCryptoAlgorithmIdAesKw, #endif }; @@ -63,24 +76,38 @@ enum WebCryptoAlgorithmParamsType { WebCryptoAlgorithmParamsTypeNone, WebCryptoAlgorithmParamsTypeAesCbcParams, WebCryptoAlgorithmParamsTypeAesKeyGenParams, - WebCryptoAlgorithmParamsTypeHmacParams, - WebCryptoAlgorithmParamsTypeHmacKeyParams, - WebCryptoAlgorithmParamsTypeRsaSsaParams, - WebCryptoAlgorithmParamsTypeRsaKeyGenParams, + WebCryptoAlgorithmParamsTypeHmacImportParams, + WebCryptoAlgorithmParamsTypeHmacKeyGenParams, + WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams, + WebCryptoAlgorithmParamsTypeRsaHashedImportParams, WebCryptoAlgorithmParamsTypeAesGcmParams, WebCryptoAlgorithmParamsTypeRsaOaepParams, WebCryptoAlgorithmParamsTypeAesCtrParams, }; +struct WebCryptoAlgorithmInfo { + typedef char ParamsTypeOrUndefined; + static const ParamsTypeOrUndefined Undefined = -1; + + // The canonical (case-sensitive) name for the algorithm as a + // null-terminated C-string literal. + const char* name; + + // A map from the operation to the expected parameter type of the algorithm. + // If an operation is not applicable for the algorithm, set to Undefined. + const ParamsTypeOrUndefined operationToParamsType[WebCryptoOperationLast + 1]; +}; + + class WebCryptoAesCbcParams; class WebCryptoAesKeyGenParams; -class WebCryptoHmacParams; -class WebCryptoHmacKeyParams; -class WebCryptoRsaSsaParams; -class WebCryptoRsaKeyGenParams; +class WebCryptoHmacImportParams; +class WebCryptoHmacKeyGenParams; class WebCryptoAesGcmParams; class WebCryptoRsaOaepParams; class WebCryptoAesCtrParams; +class WebCryptoRsaHashedKeyGenParams; +class WebCryptoRsaHashedImportParams; class WebCryptoAlgorithmParams; class WebCryptoAlgorithmPrivate; @@ -102,6 +129,11 @@ public: BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm createNull(); BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgorithmId, WebCryptoAlgorithmParams*); + // Returns a WebCryptoAlgorithmInfo for the algorithm with the given ID. If + // the ID is invalid, return 0. The caller can assume the pointer will be + // valid for the program's entire runtime. + BLINK_PLATFORM_EXPORT static const WebCryptoAlgorithmInfo* lookupAlgorithmInfo(WebCryptoAlgorithmId); + ~WebCryptoAlgorithm() { reset(); } WebCryptoAlgorithm(const WebCryptoAlgorithm& other) { assign(other); } @@ -121,13 +153,16 @@ public: // type of parameters. Retrieving an invalid parameter will return 0. BLINK_PLATFORM_EXPORT const WebCryptoAesCbcParams* aesCbcParams() const; BLINK_PLATFORM_EXPORT const WebCryptoAesKeyGenParams* aesKeyGenParams() const; - BLINK_PLATFORM_EXPORT const WebCryptoHmacParams* hmacParams() const; - BLINK_PLATFORM_EXPORT const WebCryptoHmacKeyParams* hmacKeyParams() const; - BLINK_PLATFORM_EXPORT const WebCryptoRsaSsaParams* rsaSsaParams() const; - BLINK_PLATFORM_EXPORT const WebCryptoRsaKeyGenParams* rsaKeyGenParams() const; + BLINK_PLATFORM_EXPORT const WebCryptoHmacImportParams* hmacImportParams() const; + BLINK_PLATFORM_EXPORT const WebCryptoHmacKeyGenParams* hmacKeyGenParams() const; BLINK_PLATFORM_EXPORT const WebCryptoAesGcmParams* aesGcmParams() const; BLINK_PLATFORM_EXPORT const WebCryptoRsaOaepParams* rsaOaepParams() const; BLINK_PLATFORM_EXPORT const WebCryptoAesCtrParams* aesCtrParams() const; + BLINK_PLATFORM_EXPORT const WebCryptoRsaHashedImportParams* rsaHashedImportParams() const; + BLINK_PLATFORM_EXPORT const WebCryptoRsaHashedKeyGenParams* rsaHashedKeyGenParams() const; + + // Returns true if the provided algorithm ID is for a hash (in other words, SHA-*) + BLINK_PLATFORM_EXPORT static bool isHash(WebCryptoAlgorithmId); private: BLINK_PLATFORM_EXPORT void assign(const WebCryptoAlgorithm& other); diff --git a/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h b/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h index e2de88e19e4..1038c538f13 100644 --- a/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h +++ b/chromium/third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h @@ -51,42 +51,51 @@ namespace blink { class WebCryptoAlgorithmParams { public: - explicit WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsType type) - : m_type(type) + WebCryptoAlgorithmParams() { } + virtual ~WebCryptoAlgorithmParams() { } + virtual WebCryptoAlgorithmParamsType type() const = 0; +}; + +class WebCryptoAesCbcParams : public WebCryptoAlgorithmParams { +public: + WebCryptoAesCbcParams(const unsigned char* iv, unsigned ivSize) + : m_iv(iv, ivSize) { } - virtual ~WebCryptoAlgorithmParams() { } + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeAesCbcParams; } - WebCryptoAlgorithmParamsType type() const { return m_type; } + const WebVector<unsigned char>& iv() const { return m_iv; } private: - const WebCryptoAlgorithmParamsType m_type; + const WebVector<unsigned char> m_iv; }; -class WebCryptoAesCbcParams : public WebCryptoAlgorithmParams { +class WebCryptoAlgorithmParamsWithHash : public WebCryptoAlgorithmParams { public: - WebCryptoAesCbcParams(const unsigned char* iv, unsigned ivSize) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeAesCbcParams) - , m_iv(iv, ivSize) + explicit WebCryptoAlgorithmParamsWithHash(const WebCryptoAlgorithm& hash) + : m_hash(hash) { + BLINK_ASSERT(!hash.isNull()); } - const WebVector<unsigned char>& iv() const { return m_iv; } + const WebCryptoAlgorithm& hash() const { return m_hash; } private: - const WebVector<unsigned char> m_iv; + const WebCryptoAlgorithm m_hash; }; class WebCryptoAesCtrParams : public WebCryptoAlgorithmParams { public: WebCryptoAesCtrParams(unsigned char lengthBits, const unsigned char* counter, unsigned counterSize) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeAesCtrParams) + : WebCryptoAlgorithmParams() , m_counter(counter, counterSize) , m_lengthBits(lengthBits) { } + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeAesCtrParams; } + const WebVector<unsigned char>& counter() const { return m_counter; } unsigned char lengthBits() const { return m_lengthBits; } @@ -98,13 +107,11 @@ private: class WebCryptoAesKeyGenParams : public WebCryptoAlgorithmParams { public: explicit WebCryptoAesKeyGenParams(unsigned short lengthBits) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeAesKeyGenParams) - , m_lengthBits(lengthBits) + : m_lengthBits(lengthBits) { } - // FIXME: Delete once no longer referenced by chromium. - unsigned short length() const { return m_lengthBits; } + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeAesKeyGenParams; } unsigned short lengthBits() const { return m_lengthBits; } @@ -112,94 +119,41 @@ private: const unsigned short m_lengthBits; }; -class WebCryptoHmacParams : public WebCryptoAlgorithmParams { +class WebCryptoHmacImportParams : public WebCryptoAlgorithmParamsWithHash { public: - explicit WebCryptoHmacParams(const WebCryptoAlgorithm& hash) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeHmacParams) - , m_hash(hash) + explicit WebCryptoHmacImportParams(const WebCryptoAlgorithm& hash) + : WebCryptoAlgorithmParamsWithHash(hash) { - BLINK_ASSERT(!hash.isNull()); } - const WebCryptoAlgorithm& hash() const { return m_hash; } - -private: - const WebCryptoAlgorithm m_hash; + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeHmacImportParams; } }; -class WebCryptoHmacKeyParams : public WebCryptoAlgorithmParams { +class WebCryptoHmacKeyGenParams : public WebCryptoAlgorithmParamsWithHash { public: - WebCryptoHmacKeyParams(const WebCryptoAlgorithm& hash, bool hasLengthBytes, unsigned lengthBytes) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeHmacKeyParams) - , m_hash(hash) - , m_hasLengthBytes(hasLengthBytes) - , m_optionalLengthBytes(lengthBytes) + WebCryptoHmacKeyGenParams(const WebCryptoAlgorithm& hash, bool hasLengthBits, unsigned lengthBits) + : WebCryptoAlgorithmParamsWithHash(hash) + , m_hasLengthBits(hasLengthBits) + , m_optionalLengthBits(lengthBits) { - BLINK_ASSERT(!hash.isNull()); - BLINK_ASSERT(hasLengthBytes || !lengthBytes); - } - - const WebCryptoAlgorithm& hash() const { return m_hash; } - - bool hasLengthBytes() const { return m_hasLengthBytes; } - - // FIXME: Delete once no longer referenced by chromium. - bool getLength(unsigned& length) const - { - if (!m_hasLengthBytes) - return false; - length = m_optionalLengthBytes; - return true; - } - - unsigned optionalLengthBytes() const { return m_optionalLengthBytes; } - -private: - const WebCryptoAlgorithm m_hash; - const bool m_hasLengthBytes; - const unsigned m_optionalLengthBytes; -}; - -class WebCryptoRsaSsaParams : public WebCryptoAlgorithmParams { -public: - explicit WebCryptoRsaSsaParams(const WebCryptoAlgorithm& hash) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaSsaParams) - , m_hash(hash) - { - BLINK_ASSERT(!hash.isNull()); + BLINK_ASSERT(hasLengthBits || !lengthBits); } - const WebCryptoAlgorithm& hash() const { return m_hash; } + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeHmacKeyGenParams; } -private: - const WebCryptoAlgorithm m_hash; -}; + bool hasLengthBits() const { return m_hasLengthBits; } -class WebCryptoRsaKeyGenParams : public WebCryptoAlgorithmParams { -public: - WebCryptoRsaKeyGenParams(unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaKeyGenParams) - , m_modulusLengthBits(modulusLengthBits) - , m_publicExponent(publicExponent, publicExponentSize) - { - } - - // FIXME: Delete once no longer referenced by chromium. - unsigned modulusLength() const { return m_modulusLengthBits; } - - unsigned modulusLengthBits() const { return m_modulusLengthBits; } - const WebVector<unsigned char>& publicExponent() const { return m_publicExponent; } + unsigned optionalLengthBits() const { return m_optionalLengthBits; } private: - const unsigned m_modulusLengthBits; - const WebVector<unsigned char> m_publicExponent; + const bool m_hasLengthBits; + const unsigned m_optionalLengthBits; }; class WebCryptoAesGcmParams : public WebCryptoAlgorithmParams { public: WebCryptoAesGcmParams(const unsigned char* iv, unsigned ivSize, bool hasAdditionalData, const unsigned char* additionalData, unsigned additionalDataSize, bool hasTagLengthBits, unsigned char tagLengthBits) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeAesGcmParams) - , m_iv(iv, ivSize) + : m_iv(iv, ivSize) , m_hasAdditionalData(hasAdditionalData) , m_optionalAdditionalData(additionalData, additionalDataSize) , m_hasTagLengthBits(hasTagLengthBits) @@ -209,6 +163,8 @@ public: BLINK_ASSERT(hasTagLengthBits || !tagLengthBits); } + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeAesGcmParams; } + const WebVector<unsigned char>& iv() const { return m_iv; } bool hasAdditionalData() const { return m_hasAdditionalData; } @@ -225,25 +181,53 @@ private: const unsigned char m_optionalTagLengthBits; }; -class WebCryptoRsaOaepParams : public WebCryptoAlgorithmParams { +class WebCryptoRsaHashedImportParams : public WebCryptoAlgorithmParamsWithHash { +public: + explicit WebCryptoRsaHashedImportParams(const WebCryptoAlgorithm& hash) + : WebCryptoAlgorithmParamsWithHash(hash) + { + } + + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaHashedImportParams; } +}; + +class WebCryptoRsaHashedKeyGenParams : public WebCryptoAlgorithmParams { public: - WebCryptoRsaOaepParams(const WebCryptoAlgorithm& hash, bool hasLabel, const unsigned char* label, unsigned labelSize) - : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaOaepParams) + explicit WebCryptoRsaHashedKeyGenParams(const WebCryptoAlgorithm& hash, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize) + : m_modulusLengthBits(modulusLengthBits) + , m_publicExponent(publicExponent, publicExponentSize) , m_hash(hash) - , m_hasLabel(hasLabel) - , m_optionalLabel(label, labelSize) { BLINK_ASSERT(!hash.isNull()); - BLINK_ASSERT(hasLabel || !labelSize); } + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams; } + + unsigned modulusLengthBits() const { return m_modulusLengthBits; } + const WebVector<unsigned char>& publicExponent() const { return m_publicExponent; } const WebCryptoAlgorithm& hash() const { return m_hash; } +private: + const unsigned m_modulusLengthBits; + const WebVector<unsigned char> m_publicExponent; + const WebCryptoAlgorithm m_hash; +}; + +class WebCryptoRsaOaepParams : public WebCryptoAlgorithmParams { +public: + WebCryptoRsaOaepParams(bool hasLabel, const unsigned char* label, unsigned labelSize) + : m_hasLabel(hasLabel) + , m_optionalLabel(label, labelSize) + { + BLINK_ASSERT(hasLabel || !labelSize); + } + + virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaOaepParams; } + bool hasLabel() const { return m_hasLabel; } const WebVector<unsigned char>& optionalLabel() const { return m_optionalLabel; } private: - const WebCryptoAlgorithm m_hash; const bool m_hasLabel; const WebVector<unsigned char> m_optionalLabel; }; diff --git a/chromium/third_party/WebKit/public/platform/WebCryptoKey.h b/chromium/third_party/WebKit/public/platform/WebCryptoKey.h index eea6bb2db72..d8c6f8ac077 100644 --- a/chromium/third_party/WebKit/public/platform/WebCryptoKey.h +++ b/chromium/third_party/WebKit/public/platform/WebCryptoKey.h @@ -50,6 +50,7 @@ enum WebCryptoKeyUsage { WebCryptoKeyUsageDeriveKey = 1 << 4, WebCryptoKeyUsageWrapKey = 1 << 5, WebCryptoKeyUsageUnwrapKey = 1 << 6, + WebCryptoKeyUsageDeriveBits = 1 << 7, #if INSIDE_BLINK EndOfWebCryptoKeyUsage, #endif @@ -65,7 +66,7 @@ enum WebCryptoKeyFormat { WebCryptoKeyFormatJwk, }; -class WebCryptoAlgorithm; +class WebCryptoKeyAlgorithm; class WebCryptoKeyPrivate; class WebCryptoKeyHandle; @@ -86,11 +87,6 @@ class WebCryptoKeyHandle; // // If WebCryptoKey "isNull()" then it is invalid to call any of the other // methods on it (other than destruction, assignment, or isNull()). -// -// FIXME: Define the interface to use for structured clone. -// Cloning across a process boundary will need serialization, -// however cloning for in-process workers could just share the same -// (threadsafe) handle. class WebCryptoKey { public: ~WebCryptoKey() { reset(); } @@ -106,7 +102,7 @@ public: // https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#key-interface-members // // Note that the caller is passing ownership of the WebCryptoKeyHandle*. - BLINK_PLATFORM_EXPORT static WebCryptoKey create(WebCryptoKeyHandle*, WebCryptoKeyType, bool extractable, const WebCryptoAlgorithm&, WebCryptoKeyUsageMask); + BLINK_PLATFORM_EXPORT static WebCryptoKey create(WebCryptoKeyHandle*, WebCryptoKeyType, bool extractable, const WebCryptoKeyAlgorithm&, WebCryptoKeyUsageMask); BLINK_PLATFORM_EXPORT static WebCryptoKey createNull(); @@ -117,7 +113,7 @@ public: BLINK_PLATFORM_EXPORT WebCryptoKeyType type() const; BLINK_PLATFORM_EXPORT bool extractable() const; - BLINK_PLATFORM_EXPORT const WebCryptoAlgorithm& algorithm() const; + BLINK_PLATFORM_EXPORT const WebCryptoKeyAlgorithm& algorithm() const; BLINK_PLATFORM_EXPORT WebCryptoKeyUsageMask usages() const; BLINK_PLATFORM_EXPORT bool isNull() const; diff --git a/chromium/third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h b/chromium/third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h new file mode 100644 index 00000000000..dd1b6897782 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef WebCryptoKeyAlgorithm_h +#define WebCryptoKeyAlgorithm_h + +#include "WebCommon.h" +#include "WebCryptoAlgorithm.h" +#include "WebCryptoKeyAlgorithmParams.h" +#include "WebPrivatePtr.h" + +#if INSIDE_BLINK +#include "wtf/PassOwnPtr.h" +#endif + +namespace blink { + +class WebCryptoKeyAlgorithmPrivate; + +// WebCryptoKeyAlgorithm represents the algorithm used to generate a key. +// * Immutable +// * Threadsafe +// * Copiable (cheaply) +class WebCryptoKeyAlgorithm { +public: + WebCryptoKeyAlgorithm() { } + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebCryptoKeyAlgorithm(WebCryptoAlgorithmId, PassOwnPtr<WebCryptoKeyAlgorithmParams>); +#endif + + // FIXME: Delete this in favor of the create*() functions. + BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm adoptParamsAndCreate(WebCryptoAlgorithmId, WebCryptoKeyAlgorithmParams*); + + BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createAes(WebCryptoAlgorithmId, unsigned short keyLengthBits); + BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createHmac(WebCryptoAlgorithmId hash, unsigned keyLengthBits); + BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createRsaHashed(WebCryptoAlgorithmId, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize, WebCryptoAlgorithmId hash); + + ~WebCryptoKeyAlgorithm() { reset(); } + + WebCryptoKeyAlgorithm(const WebCryptoKeyAlgorithm& other) { assign(other); } + WebCryptoKeyAlgorithm& operator=(const WebCryptoKeyAlgorithm& other) + { + assign(other); + return *this; + } + + BLINK_PLATFORM_EXPORT bool isNull() const; + + BLINK_PLATFORM_EXPORT WebCryptoAlgorithmId id() const; + + BLINK_PLATFORM_EXPORT WebCryptoKeyAlgorithmParamsType paramsType() const; + + // Returns the type-specific parameters for this key. If the requested + // parameters are not applicable (for instance an HMAC key does not have + // any AES parameters) then returns 0. + BLINK_PLATFORM_EXPORT WebCryptoAesKeyAlgorithmParams* aesParams() const; + BLINK_PLATFORM_EXPORT WebCryptoHmacKeyAlgorithmParams* hmacParams() const; + BLINK_PLATFORM_EXPORT WebCryptoRsaHashedKeyAlgorithmParams* rsaHashedParams() const; + +private: + BLINK_PLATFORM_EXPORT void assign(const WebCryptoKeyAlgorithm& other); + BLINK_PLATFORM_EXPORT void reset(); + + WebPrivatePtr<WebCryptoKeyAlgorithmPrivate> m_private; +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebCryptoKeyAlgorithmParams.h b/chromium/third_party/WebKit/public/platform/WebCryptoKeyAlgorithmParams.h new file mode 100644 index 00000000000..d71c6f086f3 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebCryptoKeyAlgorithmParams.h @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef WebCryptoKeyAlgorithmParams_h +#define WebCryptoKeyAlgorithmParams_h + +#include "WebCommon.h" +#include "WebCryptoAlgorithm.h" +#include "WebVector.h" + +namespace blink { + +enum WebCryptoKeyAlgorithmParamsType { + WebCryptoKeyAlgorithmParamsTypeNone, + WebCryptoKeyAlgorithmParamsTypeHmac, + WebCryptoKeyAlgorithmParamsTypeAes, + WebCryptoKeyAlgorithmParamsTypeRsaHashed +}; + +class WebCryptoKeyAlgorithmParams { +public: + virtual ~WebCryptoKeyAlgorithmParams() { } + virtual WebCryptoKeyAlgorithmParamsType type() const + { + return WebCryptoKeyAlgorithmParamsTypeNone; + } +}; + +class WebCryptoAesKeyAlgorithmParams : public WebCryptoKeyAlgorithmParams { +public: + explicit WebCryptoAesKeyAlgorithmParams(unsigned short lengthBits) + : m_lengthBits(lengthBits) + { + } + + unsigned short lengthBits() const + { + return m_lengthBits; + } + + virtual WebCryptoKeyAlgorithmParamsType type() const + { + return WebCryptoKeyAlgorithmParamsTypeAes; + } + +private: + unsigned short m_lengthBits; +}; + +class WebCryptoHmacKeyAlgorithmParams : public WebCryptoKeyAlgorithmParams { +public: + WebCryptoHmacKeyAlgorithmParams(const WebCryptoAlgorithm& hash, unsigned lengthBits) + : m_hash(hash) + , m_lengthBits(lengthBits) + { + } + + const WebCryptoAlgorithm& hash() const + { + return m_hash; + } + + unsigned lengthBits() const + { + return m_lengthBits; + } + + virtual WebCryptoKeyAlgorithmParamsType type() const + { + return WebCryptoKeyAlgorithmParamsTypeHmac; + } + +private: + WebCryptoAlgorithm m_hash; + unsigned m_lengthBits; +}; + +class WebCryptoRsaHashedKeyAlgorithmParams : public WebCryptoKeyAlgorithmParams { +public: + WebCryptoRsaHashedKeyAlgorithmParams(unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize, const WebCryptoAlgorithm& hash) + : m_modulusLengthBits(modulusLengthBits) + , m_publicExponent(publicExponent, publicExponentSize) + , m_hash(hash) + { + } + + unsigned modulusLengthBits() const + { + return m_modulusLengthBits; + } + + const WebVector<unsigned char>& publicExponent() const + { + return m_publicExponent; + } + + const WebCryptoAlgorithm& hash() const + { + return m_hash; + } + + virtual WebCryptoKeyAlgorithmParamsType type() const + { + return WebCryptoKeyAlgorithmParamsTypeRsaHashed; + } + +private: + unsigned m_modulusLengthBits; + WebVector<unsigned char> m_publicExponent; + WebCryptoAlgorithm m_hash; +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebDeviceLightListener.h b/chromium/third_party/WebKit/public/platform/WebDeviceLightListener.h new file mode 100644 index 00000000000..4b40842c898 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebDeviceLightListener.h @@ -0,0 +1,20 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebDeviceLightListener_h +#define WebDeviceLightListener_h + +namespace blink { + +class WebDeviceLightListener { +public: + // This method is called every time new device light data is available. + virtual void didChangeDeviceLight(double) = 0; + + virtual ~WebDeviceLightListener() { } +}; + +} // namespace blink + +#endif // WebDeviceLightListener_h diff --git a/chromium/third_party/WebKit/public/platform/WebDeviceMotionListener.h b/chromium/third_party/WebKit/public/platform/WebDeviceMotionListener.h index 50ef2a43182..820271c07ad 100644 --- a/chromium/third_party/WebKit/public/platform/WebDeviceMotionListener.h +++ b/chromium/third_party/WebKit/public/platform/WebDeviceMotionListener.h @@ -39,6 +39,8 @@ class WebDeviceMotionListener { public: // This method is called every time new device motion data is available. virtual void didChangeDeviceMotion(const WebDeviceMotionData&) = 0; + + virtual ~WebDeviceMotionListener() { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebDeviceOrientationListener.h b/chromium/third_party/WebKit/public/platform/WebDeviceOrientationListener.h index 0acfab69089..5c88835753d 100644 --- a/chromium/third_party/WebKit/public/platform/WebDeviceOrientationListener.h +++ b/chromium/third_party/WebKit/public/platform/WebDeviceOrientationListener.h @@ -39,6 +39,8 @@ class WebDeviceOrientationListener { public: // This method is called every time new device orientation data is available. virtual void didChangeDeviceOrientation(const WebDeviceOrientationData&) = 0; + + virtual ~WebDeviceOrientationListener() { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebDragData.h b/chromium/third_party/WebKit/public/platform/WebDragData.h index c40ce24060b..73e778c90ec 100644 --- a/chromium/third_party/WebKit/public/platform/WebDragData.h +++ b/chromium/third_party/WebKit/public/platform/WebDragData.h @@ -36,10 +36,7 @@ #include "WebString.h" #include "WebURL.h" -#if BLINK_IMPLEMENTATION -namespace WebCore { class ChromiumDataObject; } -namespace WTF { template <typename T> class PassRefPtr; } -#endif +namespace WebCore { class DataObject; } namespace blink { @@ -60,6 +57,8 @@ public: // An image being dragged out of the renderer. Contains a buffer holding the image data // as well as the suggested name for saving the image to. StorageTypeBinaryData, + // Stores the filesystem URL of one file being dragged into the renderer. + StorageTypeFileSystemFile, }; StorageType storageType; @@ -79,26 +78,29 @@ public: // Filename when storageType == StorageTypeBinaryData. WebString title; + // Only valid when storageType == StorageTypeFileSystemFile. + WebURL fileSystemURL; + long long fileSystemFileSize; + // Only valid when stringType == "text/html". WebURL baseURL; }; - ~WebDragData() { reset(); } - - WebDragData() : m_private(0) { } - WebDragData(const WebDragData& d) : m_private(0) { assign(d); } - WebDragData& operator=(const WebDragData& d) + WebDragData() { } + WebDragData(const WebDragData& object) { assign(object); } + WebDragData& operator=(const WebDragData& object) { - assign(d); + assign(object); return *this; } + ~WebDragData() { reset(); } + + bool isNull() const { return m_private.isNull(); } BLINK_EXPORT void initialize(); BLINK_EXPORT void reset(); BLINK_EXPORT void assign(const WebDragData&); - bool isNull() const { return !m_private; } - BLINK_EXPORT WebVector<Item> items() const; BLINK_EXPORT void setItems(const WebVector<Item>&); BLINK_EXPORT void addItem(const Item&); @@ -107,15 +109,14 @@ public: BLINK_EXPORT void setFilesystemId(const WebString&); #if BLINK_IMPLEMENTATION - WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&); - WebDragData& operator=(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&); - operator WTF::PassRefPtr<WebCore::ChromiumDataObject>() const; + explicit WebDragData(const PassRefPtrWillBeRawPtr<WebCore::DataObject>&); + WebDragData& operator=(const PassRefPtrWillBeRawPtr<WebCore::DataObject>&); + WebCore::DataObject* getValue() const; #endif private: - void assign(WebDragDataPrivate*); void ensureMutable(); - WebDragDataPrivate* m_private; + WebPrivatePtr<WebCore::DataObject> m_private; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebExternalTextureLayerClient.h b/chromium/third_party/WebKit/public/platform/WebExternalTextureLayerClient.h index 99b743bdf69..148e63ffb9d 100644 --- a/chromium/third_party/WebKit/public/platform/WebExternalTextureLayerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebExternalTextureLayerClient.h @@ -37,8 +37,6 @@ struct WebExternalTextureMailbox; class BLINK_PLATFORM_EXPORT WebExternalTextureLayerClient { public: - virtual WebGraphicsContext3D* context() = 0; - // Returns true and provides a mailbox if a new frame is available. If the WebExternalBitmap // isn't 0, then it should also be filled in with the contents of this frame. // Returns false if no new data is available and the old mailbox and bitmap are to be reused. diff --git a/chromium/third_party/WebKit/public/platform/WebExternalTextureMailbox.h b/chromium/third_party/WebKit/public/platform/WebExternalTextureMailbox.h index d8703c6a949..c596d572162 100644 --- a/chromium/third_party/WebKit/public/platform/WebExternalTextureMailbox.h +++ b/chromium/third_party/WebKit/public/platform/WebExternalTextureMailbox.h @@ -36,14 +36,21 @@ namespace blink { struct WebExternalTextureMailbox { signed char name[64]; unsigned syncPoint; + bool allowOverlay; WebExternalTextureMailbox() : syncPoint(0) + , allowOverlay(false) { memset(name, 0, sizeof(name)); } }; +inline bool nameEquals(const WebExternalTextureMailbox& a, const WebExternalTextureMailbox& b) +{ + return !memcmp(a.name, b.name, sizeof(a.name)); +} + } // namespace blink #endif // WebExternalTextureMailbox_h diff --git a/chromium/third_party/WebKit/public/platform/WebFallbackThemeEngine.h b/chromium/third_party/WebKit/public/platform/WebFallbackThemeEngine.h index e8719b05feb..a130e4033d1 100644 --- a/chromium/third_party/WebKit/public/platform/WebFallbackThemeEngine.h +++ b/chromium/third_party/WebKit/public/platform/WebFallbackThemeEngine.h @@ -52,6 +52,7 @@ public: PartScrollbarVerticalThumb, PartScrollbarHorizontalTrack, PartScrollbarVerticalTrack, + PartScrollbarCorner, // RenderTheme parts PartCheckbox, diff --git a/chromium/third_party/WebKit/public/platform/WebFileSystem.h b/chromium/third_party/WebKit/public/platform/WebFileSystem.h index a25cf60d256..3e7ec5986d9 100644 --- a/chromium/third_party/WebKit/public/platform/WebFileSystem.h +++ b/chromium/third_party/WebKit/public/platform/WebFileSystem.h @@ -38,9 +38,6 @@ namespace blink { -// FIXME: Remove this after the switch is over. -#define NON_SELFDESTRUCT_WEBFILESYSTEMCALLBACKS - class WebFileWriter; class WebFileWriterClient; @@ -136,16 +133,10 @@ public: // WebFileSystemCallbacks::didFail() must be called otherwise. virtual void directoryExists(const WebURL& path, WebFileSystemCallbacks) { BLINK_ASSERT_NOT_REACHED(); } - // Reads directory entries of a given directory at |path|. + // Reads directory entries of a given directory at |path| and returns a callbacks ID which can be used to wait for additional results. // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully. // WebFileSystemCallbacks::didFail() must be called otherwise. - virtual void readDirectory(const WebURL& path, WebFileSystemCallbacks) { BLINK_ASSERT_NOT_REACHED(); } - - // Creates a WebFileWriter that can be used to write to the given file. - // This is a fast, synchronous call, and should not stat the filesystem. - // FIXME: deprecate this after async version of createFileWriter is - // implemented. - virtual WebFileWriter* createFileWriter(const WebURL& path, WebFileWriterClient*) { BLINK_ASSERT_NOT_REACHED(); return 0; } + virtual int readDirectory(const WebURL& path, WebFileSystemCallbacks) { BLINK_ASSERT_NOT_REACHED(); return 0; } // Creates a WebFileWriter that can be used to write to the given file. // WebFileSystemCallbacks::didCreateFileWriter() must be called with the created WebFileWriter when the operation is completed successfully. @@ -162,6 +153,11 @@ public: // WebFileSystemCallbacks::didFail() must be called otherwise. virtual void createSnapshotFileAndReadMetadata(const WebURL& path, WebFileSystemCallbacks) { BLINK_ASSERT_NOT_REACHED(); } + // Waits for additional results returned for the method call and returns true if possible. + // Returns false if there is no running method call corresponding for the given ID. + // |callbacksId| must be the value returned by the original method call. + virtual bool waitForAdditionalResult(int callbacksId) { BLINK_ASSERT_NOT_REACHED(); return false; } + protected: virtual ~WebFileSystem() { } }; diff --git a/chromium/third_party/WebKit/public/platform/WebFloatPoint3D.h b/chromium/third_party/WebKit/public/platform/WebFloatPoint3D.h new file mode 100644 index 00000000000..9194890e4f7 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebFloatPoint3D.h @@ -0,0 +1,93 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + + +#ifndef WebFloatPoint3D_h +#define WebFloatPoint3D_h + +#include "WebCommon.h" + +#if INSIDE_BLINK +#include "platform/geometry/FloatPoint3D.h" +#else +#include <ui/gfx/point3_f.h> +#endif + +namespace blink { + +struct WebFloatPoint3D { + float x; + float y; + float z; + + WebFloatPoint3D() + : x(0.0f) + , y(0.0f) + , z(0.0f) + { + } + + WebFloatPoint3D(float x, float y, float z) + : x(x) + , y(y) + , z(z) + { + } + +#if INSIDE_BLINK + WebFloatPoint3D(const WebCore::FloatPoint3D& p) + : x(p.x()) + , y(p.y()) + , z(p.z()) + { + } + + WebFloatPoint3D& operator=(const WebCore::FloatPoint3D& p) + { + x = p.x(); + y = p.y(); + z = p.z(); + return *this; + } + + operator WebCore::FloatPoint3D() const + { + return WebCore::FloatPoint3D(x, y, z); + } +#else + WebFloatPoint3D(const gfx::Point3F& p) + : x(p.x()) + , y(p.y()) + , z(p.z()) + { + } + + WebFloatPoint3D& operator=(const gfx::Point3F& p) + { + x = p.x(); + y = p.y(); + return *this; + } + + operator gfx::Point3F() const + { + return gfx::Point3F(x, y, z); + } + +#endif +}; + +inline bool operator==(const WebFloatPoint3D& a, const WebFloatPoint3D& b) +{ + return a.x == b.x && a.y == b.y && a.z == b.z; +} + +inline bool operator!=(const WebFloatPoint3D& a, const WebFloatPoint3D& b) +{ + return !(a == b); +} + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebGamepad.h b/chromium/third_party/WebKit/public/platform/WebGamepad.h index 93df8a28b67..63d63f10be5 100644 --- a/chromium/third_party/WebKit/public/platform/WebGamepad.h +++ b/chromium/third_party/WebKit/public/platform/WebGamepad.h @@ -34,12 +34,29 @@ namespace blink { #pragma pack(push, 1) +class WebGamepadButton { +public: + WebGamepadButton() + : pressed(false) + , value(0.) + { + } + WebGamepadButton(bool pressed, double value) + : pressed(pressed) + , value(value) + { + } + bool pressed; + double value; +}; + // This structure is intentionally POD and fixed size so that it can be shared // memory between hardware polling threads and the rest of the browser. See // also WebGamepads.h. class WebGamepad { public: static const size_t idLengthCap = 128; + static const size_t mappingLengthCap = 16; static const size_t axesLengthCap = 16; static const size_t buttonsLengthCap = 32; @@ -50,6 +67,7 @@ public: , buttonsLength(0) { id[0] = 0; + mapping[0] = 0; } // Is there a gamepad connected at this index? @@ -66,17 +84,20 @@ public: unsigned axesLength; // Normalized values representing axes, in the range [-1..1]. - float axes[axesLengthCap]; + double axes[axesLengthCap]; // Number of valid entries in the buttons array. unsigned buttonsLength; - // Normalized values representing buttons, in the range [0..1]. - float buttons[buttonsLengthCap]; + // Button states + WebGamepadButton buttons[buttonsLengthCap]; + + // Mapping type (for example "standard") + WebUChar mapping[mappingLengthCap]; }; #if BLINK_IMPLEMENTATION -COMPILE_ASSERT(sizeof(WebGamepad) == 465, WebGamepad_has_wrong_size); +COMPILE_ASSERT(sizeof(WebGamepad) == 721, WebGamepad_has_wrong_size); #endif #pragma pack(pop) diff --git a/chromium/third_party/WebKit/public/platform/WebGamepadListener.h b/chromium/third_party/WebKit/public/platform/WebGamepadListener.h new file mode 100644 index 00000000000..f73049e4612 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebGamepadListener.h @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebGamepadListener_h +#define WebGamepadListener_h + +namespace blink { + +class WebGamepad; + +class WebGamepadListener { +public: + virtual void didConnectGamepad(unsigned index, const blink::WebGamepad&) = 0; + virtual void didDisconnectGamepad(unsigned index, const blink::WebGamepad&) = 0; + +protected: + virtual ~WebGamepadListener() { } +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebGamepads.h b/chromium/third_party/WebKit/public/platform/WebGamepads.h index aeb565bd3e0..1fa1e817d4e 100644 --- a/chromium/third_party/WebKit/public/platform/WebGamepads.h +++ b/chromium/third_party/WebKit/public/platform/WebGamepads.h @@ -30,10 +30,10 @@ #include "wtf/Assertions.h" #endif -namespace blink { - #pragma pack(push, 1) +namespace blink { + // This structure is intentionally POD and fixed size so that it can be stored // in shared memory between hardware polling threads and the rest of the // browser. @@ -52,7 +52,7 @@ public: }; #if BLINK_IMPLEMENTATION -COMPILE_ASSERT(sizeof(WebGamepads) == 1864, WebGamepads_has_wrong_size); +COMPILE_ASSERT(sizeof(WebGamepads) == 2888, WebGamepads_has_wrong_size); #endif #pragma pack(pop) diff --git a/chromium/third_party/WebKit/public/platform/WebGestureCurveTarget.h b/chromium/third_party/WebKit/public/platform/WebGestureCurveTarget.h index 5433387992e..1b8bfa83027 100644 --- a/chromium/third_party/WebKit/public/platform/WebGestureCurveTarget.h +++ b/chromium/third_party/WebKit/public/platform/WebGestureCurveTarget.h @@ -32,9 +32,7 @@ namespace blink { class WebGestureCurveTarget { public: - virtual void scrollBy(const WebFloatSize& delta) = 0; - - virtual void notifyCurrentFlingVelocity(const WebFloatSize&) { } + virtual bool scrollBy(const WebFloatSize& delta, const WebFloatSize& velocity) = 0; protected: virtual ~WebGestureCurveTarget() { } diff --git a/chromium/third_party/WebKit/public/web/WebSpeechInputResult.h b/chromium/third_party/WebKit/public/platform/WebGestureDevice.h index 2222690eb53..41b8856c33e 100644 --- a/chromium/third_party/WebKit/public/web/WebSpeechInputResult.h +++ b/chromium/third_party/WebKit/public/platform/WebGestureDevice.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2014 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,49 +23,16 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebSpeechInputResult_h -#define WebSpeechInputResult_h - -#include "../platform/WebCommon.h" -#include "../platform/WebPrivatePtr.h" -#include "../platform/WebString.h" -#include "../platform/WebVector.h" - -namespace WebCore { -class SpeechInputResult; -} +#ifndef WebGestureDevice_h +#define WebGestureDevice_h namespace blink { -// This class holds one speech recognition result including the text and other related -// fields, as received from the embedder. -class WebSpeechInputResult { -public: - WebSpeechInputResult() { } - WebSpeechInputResult(const WebSpeechInputResult& other) { assign(other); } - ~WebSpeechInputResult() { reset(); } - - WebSpeechInputResult& operator=(const WebSpeechInputResult& other) - { - assign(other); - return *this; - } - - BLINK_EXPORT void assign(const WebString& utterance, double confidence); - BLINK_EXPORT void assign(const WebSpeechInputResult& other); - BLINK_EXPORT void reset(); - -#if BLINK_IMPLEMENTATION - WebSpeechInputResult(const WTF::PassRefPtr<WebCore::SpeechInputResult>&); - operator WTF::PassRefPtr<WebCore::SpeechInputResult>() const; -#endif - -private: - WebPrivatePtr<WebCore::SpeechInputResult> m_private; +enum WebGestureDevice { + WebGestureDeviceTouchpad, + WebGestureDeviceTouchscreen, }; -typedef WebVector<WebSpeechInputResult> WebSpeechInputResultArray; - } // namespace blink -#endif // WebSpeechInputResult_h +#endif // WebGestureDevice_h diff --git a/chromium/third_party/WebKit/public/platform/WebGraphicsContext3D.h b/chromium/third_party/WebKit/public/platform/WebGraphicsContext3D.h index b740cc2851c..0a4d4aaddd8 100644 --- a/chromium/third_party/WebKit/public/platform/WebGraphicsContext3D.h +++ b/chromium/third_party/WebKit/public/platform/WebGraphicsContext3D.h @@ -42,16 +42,16 @@ namespace blink { // WGC3D types match the corresponding GL types as defined in OpenGL ES 2.0 // header file gl2.h from khronos.org. typedef char WGC3Dchar; -typedef unsigned int WGC3Denum; +typedef unsigned WGC3Denum; typedef unsigned char WGC3Dboolean; -typedef unsigned int WGC3Dbitfield; +typedef unsigned WGC3Dbitfield; typedef signed char WGC3Dbyte; typedef unsigned char WGC3Dubyte; typedef short WGC3Dshort; typedef unsigned short WGC3Dushort; typedef int WGC3Dint; typedef int WGC3Dsizei; -typedef unsigned int WGC3Duint; +typedef unsigned WGC3Duint; typedef float WGC3Dfloat; typedef float WGC3Dclampf; typedef signed long int WGC3Dintptr; @@ -203,12 +203,6 @@ public: // GL_CHROMIUM_rate_limit_offscreen_context virtual void rateLimitOffscreenContextCHROMIUM() { } - // GL_CHROMIUM_stream_texture - // Returns the stream end point identifier created for the given texture. - virtual WebGLId createStreamTextureCHROMIUM(WebGLId texture) { return 0; } - // Destroys the stream for the given texture. - virtual void destroyStreamTextureCHROMIUM(WebGLId texture) { } - // GL_CHROMIUM_lose_context virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other) { } @@ -268,7 +262,6 @@ public: virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) = 0; virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) = 0; virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) = 0; - virtual Attributes getContextAttributes() = 0; virtual WGC3Denum getError() = 0; virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) = 0; virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) = 0; @@ -397,9 +390,7 @@ public: // state is sticky, rather than reported only once. virtual WGC3Denum getGraphicsResetStatusARB() { return 0; /* GL_NO_ERROR */ } - // FIXME: make this function pure virtual once it is implemented in - // both command buffer port and in-process port. - virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) { return WebString(); } + virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) = 0; // GL_CHROMIUM_iosurface virtual void texImageIOSurface2DCHROMIUM(WGC3Denum target, WGC3Dint width, WGC3Dint height, WGC3Duint ioSurfaceId, WGC3Duint plane) { } @@ -431,7 +422,10 @@ public: // GL_CHROMIUM_texture_mailbox virtual void genMailboxCHROMIUM(WGC3Dbyte* mailbox) { } virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) { } + virtual void produceTextureDirectCHROMIUM(WebGLId texture, WGC3Denum target, const WGC3Dbyte* mailbox) { } + virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) { } + virtual WebGLId createAndConsumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) { return 0; } // GL_EXT_debug_marker virtual void insertEventMarkerEXT(const WGC3Dchar* marker) { } @@ -463,16 +457,20 @@ public: virtual GrGLInterface* createGrGLInterface() { return 0; } // GL_CHROMIUM_map_image - virtual WGC3Duint createImageCHROMIUM(WGC3Dsizei width, WGC3Dsizei height, WGC3Denum internalformat) { return 0; } + virtual WGC3Duint createImageCHROMIUM(WGC3Dsizei width, WGC3Dsizei height, WGC3Denum internalformat, WGC3Denum usage) { return 0; } virtual void destroyImageCHROMIUM(WGC3Duint imageId) { } virtual void getImageParameterivCHROMIUM(WGC3Duint imageId, WGC3Denum pname, WGC3Dint* params) { } - virtual void* mapImageCHROMIUM(WGC3Duint imageId, WGC3Denum access) { return 0; } + virtual void* mapImageCHROMIUM(WGC3Duint imageId) { return 0; } virtual void unmapImageCHROMIUM(WGC3Duint imageId) { } // GL_ANGLE_instanced_arrays virtual void drawArraysInstancedANGLE(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count, WGC3Dsizei primcount) { } virtual void drawElementsInstancedANGLE(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset, WGC3Dsizei primcount) { } virtual void vertexAttribDivisorANGLE(WGC3Duint index, WGC3Duint divisor) { } + + // GL_EXT_multisampled_render_to_texture + virtual void framebufferTexture2DMultisampleEXT(WGC3Denum target, WGC3Denum attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level, WGC3Dsizei samples) { } + virtual void renderbufferStorageMultisampleEXT(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebIDBCallbacks.h b/chromium/third_party/WebKit/public/platform/WebIDBCallbacks.h index 75d887e920b..5ba28295911 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBCallbacks.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBCallbacks.h @@ -32,6 +32,7 @@ namespace blink { +class WebBlobInfo; class WebData; class WebIDBCursor; class WebIDBDatabase; @@ -48,14 +49,14 @@ public: // Pointers transfer ownership. virtual void onError(const WebIDBDatabaseError&) { BLINK_ASSERT_NOT_REACHED(); } virtual void onSuccess(const WebVector<WebString>&) { BLINK_ASSERT_NOT_REACHED(); } - virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&) { BLINK_ASSERT_NOT_REACHED(); } + virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&, const WebVector<WebBlobInfo>&) { BLINK_ASSERT_NOT_REACHED(); } virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) { BLINK_ASSERT_NOT_REACHED(); } virtual void onSuccess(const WebIDBKey&) { BLINK_ASSERT_NOT_REACHED(); } - virtual void onSuccess(const WebData&) { BLINK_ASSERT_NOT_REACHED(); } - virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath&) { BLINK_ASSERT_NOT_REACHED(); } + virtual void onSuccess(const WebData&, const WebVector<WebBlobInfo>&) { BLINK_ASSERT_NOT_REACHED(); } + virtual void onSuccess(const WebData&, const WebVector<WebBlobInfo>&, const WebIDBKey&, const WebIDBKeyPath&) { BLINK_ASSERT_NOT_REACHED(); } virtual void onSuccess(long long) { BLINK_ASSERT_NOT_REACHED(); } virtual void onSuccess() { BLINK_ASSERT_NOT_REACHED(); } - virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&) { BLINK_ASSERT_NOT_REACHED(); } + virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&, const WebVector<WebBlobInfo>&) { BLINK_ASSERT_NOT_REACHED(); } virtual void onBlocked(long long oldVersion) { BLINK_ASSERT_NOT_REACHED(); } virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMetadata&, unsigned short dataLoss, WebString dataLossMessage) { BLINK_ASSERT_NOT_REACHED(); } }; diff --git a/chromium/third_party/WebKit/public/platform/WebIDBCursor.h b/chromium/third_party/WebKit/public/platform/WebIDBCursor.h index b9997ff403f..cc35c70fda7 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBCursor.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBCursor.h @@ -29,6 +29,7 @@ #include "WebCommon.h" #include "WebIDBCallbacks.h" #include "WebIDBKey.h" +#include "WebIDBTypes.h" #include "WebString.h" namespace blink { @@ -38,12 +39,13 @@ class WebIDBCursor { public: virtual ~WebIDBCursor() { } - enum Direction { - Next = 0, - NextNoDuplicate = 1, - Prev = 2, - PrevNoDuplicate = 3, - }; + // FIXME: Remove once Chromium is updated to use the new enums. + typedef WebIDBCursorDirection Direction; + static const WebIDBCursorDirection Next = WebIDBCursorDirectionNext; + static const WebIDBCursorDirection NextNoDuplicate =WebIDBCursorDirectionNextNoDuplicate; + static const WebIDBCursorDirection Prev = WebIDBCursorDirectionPrev; + static const WebIDBCursorDirection PrevNoDuplicate =WebIDBCursorDirectionPrevNoDuplicate; + static const WebIDBCursorDirection DirectionLast =WebIDBCursorDirectionLast; virtual void advance(unsigned long, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } virtual void continueFunction(const WebIDBKey&, const WebIDBKey& primaryKey, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } diff --git a/chromium/third_party/WebKit/public/platform/WebIDBDatabase.h b/chromium/third_party/WebKit/public/platform/WebIDBDatabase.h index 1dbddf681ca..61f3ae14f6b 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBDatabase.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBDatabase.h @@ -26,8 +26,11 @@ #ifndef WebIDBDatabase_h #define WebIDBDatabase_h +#include "WebBlobInfo.h" #include "WebCommon.h" +#include "WebIDBCursor.h" #include "WebIDBMetadata.h" +#include "public/platform/WebIDBTypes.h" namespace blink { @@ -44,9 +47,15 @@ class WebIDBDatabase { public: virtual ~WebIDBDatabase() { } + // FIXME: Remove once Chromium is updated to use the new enums. + typedef WebIDBTransactionMode TransactionMode; + static const WebIDBTransactionMode TransactionReadOnly = WebIDBTransactionModeReadOnly; + static const WebIDBTransactionMode TransactionReadWrite = WebIDBTransactionModeReadWrite; + static const WebIDBTransactionMode TransactionVersionChange = WebIDBTransactionModeVersionChange; + virtual void createObjectStore(long long transactionId, long long objectStoreId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) { BLINK_ASSERT_NOT_REACHED(); } virtual void deleteObjectStore(long long transactionId, long long objectStoreId) { BLINK_ASSERT_NOT_REACHED(); } - virtual void createTransaction(long long id, WebIDBDatabaseCallbacks* callbacks, const WebVector<long long>&, unsigned short mode) { BLINK_ASSERT_NOT_REACHED(); } + virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>& scope, blink::WebIDBTransactionMode) { BLINK_ASSERT_NOT_REACHED(); } virtual void close() { BLINK_ASSERT_NOT_REACHED(); } virtual void forceClose() { BLINK_ASSERT_NOT_REACHED(); } @@ -56,30 +65,32 @@ public: virtual void createIndex(long long transactionId, long long objectStoreId, long long indexId, const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry) { BLINK_ASSERT_NOT_REACHED(); } virtual void deleteIndex(long long transactionId, long long objectStoreId, long long indexId) { BLINK_ASSERT_NOT_REACHED(); } - enum TaskType { - NormalTask = 0, - PreemptiveTask - }; + // FIXME: Remove once Chromium is updated to use the new enums. + typedef WebIDBTaskType TaskType; + static const WebIDBTaskType NormalTask = WebIDBTaskTypeNormal; + static const WebIDBTaskType PreemptiveTask = WebIDBTaskTypePreemptive; + static const WebIDBTaskType TaskTypeLast = WebIDBTaskTypeLast; - enum PutMode { - AddOrUpdate, - AddOnly, - CursorUpdate - }; + // FIXME: Remove once Chromium is updated to use the new enums. + typedef WebIDBPutMode PutMode; + static const WebIDBPutMode AddOrUpdate = WebIDBPutModeAddOrUpdate; + static const WebIDBPutMode AddOnly = WebIDBPutModeAddOnly; + static const WebIDBPutMode CursorUpdate = WebIDBPutModeCursorUpdate; + static const WebIDBPutMode PutModeLast = WebIDBPutModeLast; static const long long minimumIndexId = 30; typedef WebVector<WebIDBKey> WebIndexKeys; virtual void get(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, bool keyOnly, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } - // Note that 'value' may be consumed/adopted by this call. - virtual void put(long long transactionId, long long objectStoreId, const WebData& value, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); } + virtual void put(long long transactionId, long long objectStoreId, const WebData& value, const WebVector<WebBlobInfo>&, const WebIDBKey&, blink::WebIDBPutMode, WebIDBCallbacks*, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); } virtual void setIndexKeys(long long transactionId, long long objectStoreId, const WebIDBKey&, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); } virtual void setIndexesReady(long long transactionId, long long objectStoreId, const WebVector<long long>& indexIds) { BLINK_ASSERT_NOT_REACHED(); } - virtual void openCursor(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, unsigned short direction, bool keyOnly, TaskType, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } + virtual void openCursor(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, blink::WebIDBCursorDirection, bool keyOnly, blink::WebIDBTaskType, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } virtual void count(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } virtual void deleteRange(long long transactionId, long long objectStoreId, const WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } virtual void clear(long long transactionId, long long objectStoreId, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } + virtual void ackReceivedBlobs(const WebVector<WebString>& uuids) { BLINK_ASSERT_NOT_REACHED(); } protected: WebIDBDatabase() { } diff --git a/chromium/third_party/WebKit/public/platform/WebIDBDatabaseError.h b/chromium/third_party/WebKit/public/platform/WebIDBDatabaseError.h index d614e18a5d0..a50fcbdb6e8 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBDatabaseError.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBDatabaseError.h @@ -55,7 +55,7 @@ public: BLINK_EXPORT void reset(); #if BLINK_IMPLEMENTATION - operator WTF::PassRefPtr<WebCore::DOMError>() const; + operator PassRefPtrWillBeRawPtr<WebCore::DOMError>() const; #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebIDBKey.h b/chromium/third_party/WebKit/public/platform/WebIDBKey.h index b76d49087a0..2c9a7a07197 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBKey.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBKey.h @@ -77,9 +77,9 @@ public: BLINK_EXPORT double number() const; // Only valid for NumberType. #if BLINK_IMPLEMENTATION - WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); - WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); - operator WTF::PassRefPtr<WebCore::IDBKey>() const; + WebIDBKey(WebCore::IDBKey*); + WebIDBKey& operator=(WebCore::IDBKey*); + operator WebCore::IDBKey*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebIDBKeyRange.h b/chromium/third_party/WebKit/public/platform/WebIDBKeyRange.h index bc8f3f3f288..62fe27c9070 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBKeyRange.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBKeyRange.h @@ -53,9 +53,9 @@ public: BLINK_EXPORT void reset(); #if BLINK_IMPLEMENTATION - WebIDBKeyRange(const WTF::PassRefPtr<WebCore::IDBKeyRange>&); - WebIDBKeyRange& operator=(const WTF::PassRefPtr<WebCore::IDBKeyRange>&); - operator WTF::PassRefPtr<WebCore::IDBKeyRange>() const; + WebIDBKeyRange(WebCore::IDBKeyRange*); + WebIDBKeyRange& operator=(WebCore::IDBKeyRange*); + operator WebCore::IDBKeyRange*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebIDBTypes.h b/chromium/third_party/WebKit/public/platform/WebIDBTypes.h index 7f8f7b12f1d..06837b0d66b 100644 --- a/chromium/third_party/WebKit/public/platform/WebIDBTypes.h +++ b/chromium/third_party/WebKit/public/platform/WebIDBTypes.h @@ -50,6 +50,34 @@ enum WebIDBDataLoss { WebIDBDataLossTotal, }; +enum WebIDBCursorDirection { + WebIDBCursorDirectionNext = 0, + WebIDBCursorDirectionNextNoDuplicate = 1, + WebIDBCursorDirectionPrev = 2, + WebIDBCursorDirectionPrevNoDuplicate = 3, + WebIDBCursorDirectionLast = WebIDBCursorDirectionPrevNoDuplicate +}; + +enum WebIDBTaskType { + WebIDBTaskTypeNormal = 0, + WebIDBTaskTypePreemptive, + WebIDBTaskTypeLast = WebIDBTaskTypePreemptive +}; + +enum WebIDBPutMode { + WebIDBPutModeAddOrUpdate, + WebIDBPutModeAddOnly, + WebIDBPutModeCursorUpdate, + WebIDBPutModeLast = WebIDBPutModeCursorUpdate +}; + +enum WebIDBTransactionMode { + WebIDBTransactionModeReadOnly = 0, + WebIDBTransactionModeReadWrite, + WebIDBTransactionModeVersionChange, + WebIDBTransactionModeLast = WebIDBTransactionModeVersionChange +}; + } // namespace blink #endif // WebIDBTypes_h diff --git a/chromium/third_party/WebKit/public/platform/WebLayer.h b/chromium/third_party/WebKit/public/platform/WebLayer.h index c44dce9f025..c8fabb52c29 100644 --- a/chromium/third_party/WebKit/public/platform/WebLayer.h +++ b/chromium/third_party/WebKit/public/platform/WebLayer.h @@ -30,9 +30,10 @@ #include "WebBlendMode.h" #include "WebColor.h" #include "WebCommon.h" -#include "WebCompositingReasons.h" +#include "WebFloatPoint3D.h" #include "WebPoint.h" #include "WebRect.h" +#include "WebSize.h" #include "WebString.h" #include "WebVector.h" @@ -47,7 +48,6 @@ class WebLayerScrollClient; struct WebFloatPoint; struct WebFloatRect; struct WebLayerPositionConstraint; -struct WebSize; class WebLayer { public: @@ -69,12 +69,6 @@ public: virtual void removeFromParent() = 0; virtual void removeAllChildren() = 0; - virtual void setAnchorPoint(const WebFloatPoint&) = 0; - virtual WebFloatPoint anchorPoint() const = 0; - - virtual void setAnchorPointZ(float) = 0; - virtual float anchorPointZ() const = 0; - virtual void setBounds(const WebSize&) = 0; virtual WebSize bounds() const = 0; @@ -99,17 +93,23 @@ public: virtual void setPosition(const WebFloatPoint&) = 0; virtual WebFloatPoint position() const = 0; - virtual void setSublayerTransform(const SkMatrix44&) = 0; - virtual SkMatrix44 sublayerTransform() const = 0; - virtual void setTransform(const SkMatrix44&) = 0; virtual SkMatrix44 transform() const = 0; + virtual void setTransformOrigin(const WebFloatPoint3D&) { } + virtual WebFloatPoint3D transformOrigin() const { return WebFloatPoint3D(); } + // Sets whether the layer draws its content when compositing. virtual void setDrawsContent(bool) = 0; virtual bool drawsContent() const = 0; - virtual void setPreserves3D(bool) = 0; + // Sets whether the layer's transform should be flattened. + virtual void setShouldFlattenTransform(bool) = 0; + + // Sets the id of the layer's 3d rendering context. Layers in the same 3d + // rendering context id are sorted with one another according to their 3d + // position rather than their tree order. + virtual void setRenderingContext(int id) = 0; // Mark that this layer should use its parent's transform and double-sided // properties in determining this layer's backface visibility instead of @@ -134,9 +134,6 @@ public: // (opacity, transforms), it may conflict and hide the background filters. virtual void setBackgroundFilters(const WebFilterOperations&) = 0; - // Provides a bitfield that describe why this composited layer was created. - virtual void setCompositingReasons(WebCompositingReasons) = 0; - // An animation delegate is notified when animations are started and // stopped. The WebLayer does not take ownership of the delegate, and it is // the responsibility of the client to reset the layer's delegate before @@ -174,12 +171,9 @@ public: virtual void setScrollPosition(WebPoint) = 0; virtual WebPoint scrollPosition() const = 0; - virtual void setMaxScrollPosition(WebSize) = 0; - virtual WebSize maxScrollPosition() const = 0; - - virtual void setScrollable(bool) = 0; + // To set a WebLayer as scrollable we must specify the corresponding clip layer. + virtual void setScrollClipLayer(WebLayer*) = 0; virtual bool scrollable() const = 0; - virtual void setUserScrollable(bool horizontal, bool vertical) = 0; virtual bool userScrollableHorizontal() const = 0; virtual bool userScrollableVertical() const = 0; @@ -187,6 +181,9 @@ public: virtual void setHaveWheelEventHandlers(bool) = 0; virtual bool haveWheelEventHandlers() const = 0; + virtual void setHaveScrollEventHandlers(bool) = 0; + virtual bool haveScrollEventHandlers() const = 0; + virtual void setShouldScrollOnMainThread(bool) = 0; virtual bool shouldScrollOnMainThread() const = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebLayerClient.h b/chromium/third_party/WebKit/public/platform/WebLayerClient.h index 52dd7c729e0..74cd3f0aae8 100644 --- a/chromium/third_party/WebKit/public/platform/WebLayerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebLayerClient.h @@ -39,12 +39,11 @@ class WebGraphicsLayerDebugInfo; class BLINK_PLATFORM_EXPORT WebLayerClient { public: - virtual WebString debugName(WebLayer*) = 0; - // Returns a pointer to a debug info object, if one has been computed. // If not, returns 0. If the returned pointer is non-zero, the caller takes - // ownership of the pointer. - virtual WebGraphicsLayerDebugInfo* takeDebugInfo() = 0; + // ownership of the pointer. The parameter allows us to return WebLayer- + // specific information, too (only the debug name for now). + virtual WebGraphicsLayerDebugInfo* takeDebugInfoFor(WebLayer*) = 0; protected: virtual ~WebLayerClient() { } diff --git a/chromium/third_party/WebKit/public/platform/WebLayerTreeView.h b/chromium/third_party/WebKit/public/platform/WebLayerTreeView.h index afd0c8b41bb..13420164183 100644 --- a/chromium/third_party/WebKit/public/platform/WebLayerTreeView.h +++ b/chromium/third_party/WebKit/public/platform/WebLayerTreeView.h @@ -36,6 +36,7 @@ class SkBitmap; namespace blink { +class WebCompositeAndReadbackAsyncCallback; class WebGraphicsContext3D; class WebLayer; struct WebPoint; @@ -60,12 +61,8 @@ public: // View properties --------------------------------------------------- - virtual void setViewportSize(const WebSize& layoutViewportSize, const WebSize& deviceViewportSize) = 0; - // Gives the viewport size in layer space. - virtual WebSize layoutViewportSize() const = 0; - // Gives the viewport size in physical device pixels (may be different - // from the above if there exists page scale, device scale or fixed layout - // mode). + virtual void setViewportSize(const WebSize& deviceViewportSize) = 0; + // Gives the viewport size in physical device pixels. virtual WebSize deviceViewportSize() const = 0; virtual void setDeviceScaleFactor(float) = 0; @@ -92,6 +89,8 @@ public: // If useAnchor is false, destination is the final top-left scroll position. virtual void startPageScaleAnimation(const WebPoint& destination, bool useAnchor, float newPageScale, double durationSec) = 0; + virtual void heuristicsForGpuRasterizationUpdated(bool) { } + // Flow control and scheduling --------------------------------------- @@ -104,13 +103,9 @@ public: // Relays the end of a fling animation. virtual void didStopFlinging() { } - // Composites and attempts to read back the result into the provided - // buffer. If it wasn't possible, e.g. due to context lost, will return - // false. Pixel format is 32bit (RGBA), and the provided buffer must be - // large enough contain viewportSize().width() * viewportSize().height() - // pixels. The WebLayerTreeView does not assume ownership of the buffer. - // The buffer is not modified if the false is returned. - virtual bool compositeAndReadback(void *pixels, const WebRect&) = 0; + // The caller is responsible for keeping the WebCompositeAndReadbackAsyncCallback + // object alive until it is called. + virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*) { } // Blocks until the most recently composited frame has finished rendering on the GPU. // This can have a significant performance impact and should be used with care. diff --git a/chromium/third_party/WebKit/public/platform/WebLocalizedString.h b/chromium/third_party/WebKit/public/platform/WebLocalizedString.h index ae0ffea594d..da679e18e16 100644 --- a/chromium/third_party/WebKit/public/platform/WebLocalizedString.h +++ b/chromium/third_party/WebKit/public/platform/WebLocalizedString.h @@ -63,14 +63,6 @@ struct WebLocalizedString { AXMediaPauseButtonHelp, AXMediaPlayButton, AXMediaPlayButtonHelp, - AXMediaReturnToRealTime, - AXMediaReturnToRealTimeHelp, - AXMediaRewindButton, - AXMediaRewindButtonHelp, - AXMediaSeekBackButton, - AXMediaSeekBackButtonHelp, - AXMediaSeekForwardButton, - AXMediaSeekForwardButtonHelp, AXMediaShowClosedCaptionsButton, AXMediaShowClosedCaptionsButtonHelp, AXMediaSlider, // Deprecated. @@ -132,6 +124,7 @@ struct WebLocalizedString { SearchMenuClearRecentSearchesText, // Deprecated. SearchMenuNoRecentSearchesText, // Deprecated. SearchMenuRecentSearchesText, // Deprecated. + SelectMenuListText, SubmitButtonDefaultLabel, ThisMonthButtonLabel, ThisWeekButtonLabel, diff --git a/chromium/third_party/WebKit/public/platform/WebLockOrientationCallback.h b/chromium/third_party/WebKit/public/platform/WebLockOrientationCallback.h new file mode 100644 index 00000000000..fcfbc75780f --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebLockOrientationCallback.h @@ -0,0 +1,38 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebLockOrientationCallback_h +#define WebLockOrientationCallback_h + +#include "public/platform/WebLockOrientationError.h" +#include "public/platform/WebScreenOrientationType.h" + +namespace blink { + +// WebScreenOrientationType is an interface to be used by the embedder in order +// to inform Blink when a screen lock operation has succeeded or failed. +// A success notification comes with the new orientation angle and orientation +// type and a failure notification comes with an information about the type of +// failure. +class WebLockOrientationCallback { +public: + enum ErrorType { + ErrorTypeNotAvailable, // If locking isn't available on the platform. + ErrorTypeFullScreenRequired, // If fullscreen is required to lock. + ErrorTypeCanceled, // If another lock/unlock got called before that one ended. + }; + + virtual ~WebLockOrientationCallback() { } + + virtual void onSuccess(unsigned angle, WebScreenOrientationType) = 0; + + // FIXME: those methods are defined and not virtual pure to not break the + // embedder during the transition period. + virtual void onError(ErrorType) { } + virtual void onError(WebLockOrientationError) { } +}; + +} // namespace blink + +#endif // WebLockOrientationCallback_h diff --git a/chromium/third_party/WebKit/public/platform/WebLockOrientationError.h b/chromium/third_party/WebKit/public/platform/WebLockOrientationError.h new file mode 100644 index 00000000000..d0624568d58 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebLockOrientationError.h @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebLockOrientationError_h +#define WebLockOrientationError_h + +namespace blink { + +enum WebLockOrientationError { + // If locking isn't available on the platform. + WebLockOrientationErrorNotAvailable, + + // If fullscreen is required to lock. + WebLockOrientationErrorFullScreenRequired, + + // If another lock/unlock got called before that one ended. + WebLockOrientationErrorCanceled, +}; + +} // namespace blink + +#endif // WebLockOrientationError_h diff --git a/chromium/third_party/WebKit/public/platform/WebMIDIAccessorClient.h b/chromium/third_party/WebKit/public/platform/WebMIDIAccessorClient.h index a7d92bdbfd0..0192a798a35 100644 --- a/chromium/third_party/WebKit/public/platform/WebMIDIAccessorClient.h +++ b/chromium/third_party/WebKit/public/platform/WebMIDIAccessorClient.h @@ -40,7 +40,7 @@ public: virtual void didAddInputPort(const WebString& id, const WebString& manufacturer, const WebString& name, const WebString& version) = 0; virtual void didAddOutputPort(const WebString& id, const WebString& manufacturer, const WebString& name, const WebString& version) = 0; - virtual void didStartSession(bool success) = 0; + virtual void didStartSession(bool success, const WebString& error, const WebString& message) = 0; // |timeStamp| is in milliseconds according to the Web MIDI API. virtual void didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebMediaConstraints.h b/chromium/third_party/WebKit/public/platform/WebMediaConstraints.h index a5be50e5ede..82ccbf41d54 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaConstraints.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaConstraints.h @@ -37,13 +37,10 @@ #include "WebString.h" #include "WebVector.h" -namespace WebCore { -struct MediaConstraint; -class MediaConstraints; -} - namespace blink { +class WebMediaConstraintsPrivate; + struct WebMediaConstraint { WebMediaConstraint() { @@ -55,10 +52,6 @@ struct WebMediaConstraint { { } -#if INSIDE_BLINK - BLINK_PLATFORM_EXPORT WebMediaConstraint(const WebCore::MediaConstraint&); -#endif - WebString m_name; WebString m_value; }; @@ -80,19 +73,17 @@ public: BLINK_PLATFORM_EXPORT void reset(); bool isNull() const { return m_private.isNull(); } - BLINK_PLATFORM_EXPORT void getMandatoryConstraints(WebVector<WebMediaConstraint>&) const; BLINK_PLATFORM_EXPORT void getOptionalConstraints(WebVector<WebMediaConstraint>&) const; + BLINK_PLATFORM_EXPORT void getMandatoryConstraints(WebVector<WebMediaConstraint>&) const; - BLINK_PLATFORM_EXPORT bool getMandatoryConstraintValue(const WebString& name, WebString& value) const; BLINK_PLATFORM_EXPORT bool getOptionalConstraintValue(const WebString& name, WebString& value) const; + BLINK_PLATFORM_EXPORT bool getMandatoryConstraintValue(const WebString& name, WebString& value) const; -#if INSIDE_BLINK - BLINK_PLATFORM_EXPORT WebMediaConstraints(const WTF::PassRefPtr<WebCore::MediaConstraints>&); - BLINK_PLATFORM_EXPORT WebMediaConstraints(WebCore::MediaConstraints*); -#endif + BLINK_PLATFORM_EXPORT void initialize(); + BLINK_PLATFORM_EXPORT void initialize(const WebVector<WebMediaConstraint>& optional, const WebVector<WebMediaConstraint>& mandatory); private: - WebPrivatePtr<WebCore::MediaConstraints> m_private; + WebPrivatePtr<WebMediaConstraintsPrivate> m_private; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebMediaDeviceInfo.h b/chromium/third_party/WebKit/public/platform/WebMediaDeviceInfo.h new file mode 100644 index 00000000000..6406f17aa5e --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebMediaDeviceInfo.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2014 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``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 GOOGLE INC. 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. + */ + +#ifndef WebMediaDeviceInfo_h +#define WebMediaDeviceInfo_h + +#include "WebCommon.h" +#include "WebNonCopyable.h" +#include "WebPrivatePtr.h" +#include "WebString.h" + +namespace blink { + +class WebMediaDeviceInfoPrivate; + +class WebMediaDeviceInfo { +public: + enum MediaDeviceKind { + MediaDeviceKindAudioInput, + MediaDeviceKindAudioOutput, + MediaDeviceKindVideoInput + }; + + WebMediaDeviceInfo() { } + WebMediaDeviceInfo(const WebMediaDeviceInfo& other) { assign(other); } + ~WebMediaDeviceInfo() { reset(); } + + WebMediaDeviceInfo& operator=(const WebMediaDeviceInfo& other) + { + assign(other); + return *this; + } + + BLINK_PLATFORM_EXPORT void assign(const WebMediaDeviceInfo&); + + BLINK_PLATFORM_EXPORT void initialize(const WebString& deviceId, MediaDeviceKind, const WebString& label, const WebString& groupId); + BLINK_PLATFORM_EXPORT void reset(); + bool isNull() const { return m_private.isNull(); } + + BLINK_PLATFORM_EXPORT WebString deviceId() const; + BLINK_PLATFORM_EXPORT MediaDeviceKind kind() const; + BLINK_PLATFORM_EXPORT WebString label() const; + BLINK_PLATFORM_EXPORT WebString groupId() const; + +private: + WebPrivatePtr<WebMediaDeviceInfoPrivate> m_private; +}; + +} // namespace blink + +#endif // WebMediaDeviceInfo_h diff --git a/chromium/third_party/WebKit/public/platform/WebMediaPlayer.h b/chromium/third_party/WebKit/public/platform/WebMediaPlayer.h index 8762e530e58..edff006aa20 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaPlayer.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaPlayer.h @@ -40,6 +40,7 @@ namespace blink { class WebAudioSourceProvider; class WebAudioSourceProviderClient; +class WebContentDecryptionModule; class WebMediaPlayerClient; class WebString; class WebURL; @@ -94,6 +95,8 @@ public: LoadTypeMediaStream, }; + typedef unsigned TrackId; + virtual ~WebMediaPlayer() { } virtual void load(LoadType, const WebURL&, CORSMode) = 0; @@ -101,13 +104,12 @@ public: // Playback controls. virtual void play() = 0; virtual void pause() = 0; - virtual bool supportsFullscreen() const = 0; virtual bool supportsSave() const = 0; virtual void seek(double seconds) = 0; virtual void setRate(double) = 0; virtual void setVolume(double) = 0; virtual void setPreload(Preload) { }; - virtual const WebTimeRanges& buffered() = 0; + virtual WebTimeRanges buffered() const = 0; virtual double maxTimeSeekable() const = 0; virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha) = 0; @@ -129,7 +131,7 @@ public: virtual NetworkState networkState() const = 0; virtual ReadyState readyState() const = 0; - virtual bool didLoadingProgress() const = 0; + virtual bool didLoadingProgress() = 0; virtual bool hasSingleSecurityOrigin() const = 0; virtual bool didPassCORSAccessCheck() const = 0; @@ -152,12 +154,20 @@ public: virtual MediaKeyException generateKeyRequest(const WebString& keySystem, const unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionKeySystemNotSupported; } virtual MediaKeyException addKey(const WebString& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataLength, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } + virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm) { } + + // Sets the poster image URL. + virtual void setPoster(const WebURL& poster) { } // Instruct WebMediaPlayer to enter/exit fullscreen. virtual void enterFullscreen() { } virtual void exitFullscreen() { } // Returns true if the player can enter fullscreen. virtual bool canEnterFullscreen() const { return false; } + + virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrackIds) { } + // |selectedTrackId| is null if no track is selected. + virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebMediaPlayerClient.h b/chromium/third_party/WebKit/public/platform/WebMediaPlayerClient.h index d86108ca0fd..14ecddc9e37 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaPlayerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaPlayerClient.h @@ -35,7 +35,6 @@ namespace blink { -class WebFrame; class WebInbandTextTrack; class WebLayer; class WebMediaSource; @@ -54,26 +53,45 @@ public: MediaKeyErrorCodeDomain, }; + enum VideoTrackKind { + VideoTrackKindNone, + VideoTrackKindAlternative, + VideoTrackKindCaptions, + VideoTrackKindMain, + VideoTrackKindSign, + VideoTrackKindSubtitles, + VideoTrackKindCommentary + }; + + enum AudioTrackKind { + AudioTrackKindNone, + AudioTrackKindAlternative, + AudioTrackKindDescriptions, + AudioTrackKindMain, + AudioTrackKindMainDescriptions, + AudioTrackKindTranslation, + AudioTrackKindCommentary + }; + virtual void networkStateChanged() = 0; virtual void readyStateChanged() = 0; virtual void timeChanged() = 0; virtual void repaint() = 0; virtual void durationChanged() = 0; virtual void sizeChanged() = 0; - virtual void setOpaque(bool) = 0; + // FIXME: Remove once calls on the Chromium-side have been removed. virtual double volume() const = 0; virtual void playbackStateChanged() = 0; virtual WebMediaPlayer::Preload preload() const = 0; virtual void keyAdded(const WebString& keySystem, const WebString& sessionId) = 0; virtual void keyError(const WebString& keySystem, const WebString& sessionId, MediaKeyErrorCode, unsigned short systemCode) = 0; virtual void keyMessage(const WebString& keySystem, const WebString& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL) = 0; - virtual void keyNeeded(const WebString& keySystem, const WebString& sessionId, const unsigned char* initData, unsigned initDataLength) = 0; - // The returned pointer is valid until closeHelperPlugin() is called. - // Returns 0 if the plugin could not be instantiated. - virtual WebPlugin* createHelperPlugin(const WebString& pluginType, WebFrame*) = 0; - virtual void closeHelperPluginSoon(WebFrame*) = 0; - virtual bool needsWebLayerForVideo() const = 0; + virtual void keyNeeded(const WebString& contentType, const unsigned char* initData, unsigned initDataLength) = 0; virtual void setWebLayer(WebLayer*) = 0; + virtual WebMediaPlayer::TrackId addAudioTrack(const WebString& id, AudioTrackKind, const WebString& label, const WebString& language, bool enabled) = 0; + virtual void removeAudioTrack(WebMediaPlayer::TrackId) = 0; + virtual WebMediaPlayer::TrackId addVideoTrack(const WebString& id, VideoTrackKind, const WebString& label, const WebString& language, bool selected) = 0; + virtual void removeVideoTrack(WebMediaPlayer::TrackId) = 0; virtual void addTextTrack(WebInbandTextTrack*) = 0; virtual void removeTextTrack(WebInbandTextTrack*) = 0; virtual void mediaSourceOpened(WebMediaSource*) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebMediaSource.h b/chromium/third_party/WebKit/public/platform/WebMediaSource.h index 1ba3be7f869..3d57563712f 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaSource.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaSource.h @@ -31,6 +31,7 @@ #ifndef WebMediaSource_h #define WebMediaSource_h +#include "WebCommon.h" #include "WebTimeRange.h" #include "WebURL.h" @@ -52,9 +53,27 @@ public: EndOfStreamStatusDecodeError, }; + enum FrameProcessorChoice { + UseLegacyFrameProcessor, + UseNewFrameProcessor + }; + virtual ~WebMediaSource() { } + // FIXME: Remove addSourceBuffer() that has FrameProcessorChoice, and remove + // the default implementations for addSourceBuffer() once Chromium + // implementation of the addSourceBuffer() with no FrameProcessorChoice has + // landed. See http://crbug.com/249422. + virtual AddStatus addSourceBuffer(const WebString& type, const WebVector<WebString>& codecs, const FrameProcessorChoice, WebSourceBuffer** webSourceBuffer) + { + // This default implementation should never be called for real. + BLINK_ASSERT_NOT_REACHED(); + return AddStatusReachedIdLimit; + } + virtual AddStatus addSourceBuffer(const WebString& type, const WebVector<WebString>& codecs, WebSourceBuffer** webSourceBuffer) + { + return addSourceBuffer(type, codecs, WebMediaSource::UseNewFrameProcessor, webSourceBuffer); + } - virtual AddStatus addSourceBuffer(const WebString& type, const WebVector<WebString>& codecs, WebSourceBuffer**) = 0; virtual double duration() = 0; virtual void setDuration(double) = 0; virtual void markEndOfStream(EndOfStreamStatus) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebMediaStream.h b/chromium/third_party/WebKit/public/platform/WebMediaStream.h index 94082a8243f..184fddc0568 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaStream.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaStream.h @@ -57,35 +57,35 @@ public: return *this; } - BLINK_EXPORT void assign(const WebMediaStream&); + BLINK_PLATFORM_EXPORT void assign(const WebMediaStream&); - BLINK_EXPORT void initialize(const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks); - BLINK_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks); + BLINK_PLATFORM_EXPORT void initialize(const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks); + BLINK_PLATFORM_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks); - BLINK_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void reset(); bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT WebString id() const; + BLINK_PLATFORM_EXPORT WebString id() const; - BLINK_EXPORT void audioTracks(WebVector<WebMediaStreamTrack>&) const; - BLINK_EXPORT void videoTracks(WebVector<WebMediaStreamTrack>&) const; + BLINK_PLATFORM_EXPORT void audioTracks(WebVector<WebMediaStreamTrack>&) const; + BLINK_PLATFORM_EXPORT void videoTracks(WebVector<WebMediaStreamTrack>&) const; - BLINK_EXPORT void addTrack(const WebMediaStreamTrack&); - BLINK_EXPORT void removeTrack(const WebMediaStreamTrack&); + BLINK_PLATFORM_EXPORT void addTrack(const WebMediaStreamTrack&); + BLINK_PLATFORM_EXPORT void removeTrack(const WebMediaStreamTrack&); // Extra data associated with this WebMediaStream. // If non-null, the extra data pointer will be deleted when the object is destroyed. // Setting the extra data pointer will cause any existing non-null // extra data pointer to be deleted. - BLINK_EXPORT ExtraData* extraData() const; - BLINK_EXPORT void setExtraData(ExtraData*); - -#if BLINK_IMPLEMENTATION - WebMediaStream(WebCore::MediaStreamDescriptor*); - WebMediaStream(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&); - operator WTF::PassRefPtr<WebCore::MediaStreamDescriptor>() const; - operator WebCore::MediaStreamDescriptor*() const; - WebMediaStream& operator=(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&); + BLINK_PLATFORM_EXPORT ExtraData* extraData() const; + BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebMediaStream(WebCore::MediaStreamDescriptor*); + BLINK_PLATFORM_EXPORT WebMediaStream(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&); + BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::MediaStreamDescriptor>() const; + BLINK_PLATFORM_EXPORT operator WebCore::MediaStreamDescriptor*() const; + BLINK_PLATFORM_EXPORT WebMediaStream& operator=(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&); #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebMediaStreamCenter.h b/chromium/third_party/WebKit/public/platform/WebMediaStreamCenter.h index ae8d39dbea3..3205cbcf1f7 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaStreamCenter.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaStreamCenter.h @@ -34,6 +34,7 @@ #include "WebVector.h" namespace blink { +class WebAudioSourceProvider; class WebMediaStream; class WebMediaStreamTrack; class WebMediaStreamTrackSourcesRequest; @@ -58,9 +59,8 @@ public: virtual void didDisableMediaStreamTrack(const WebMediaStreamTrack&) { } virtual bool didStopMediaStreamTrack(const WebMediaStreamTrack&) { return false; } - // DEPRECATED track functionality. - virtual void didEnableMediaStreamTrack(const WebMediaStream&, const WebMediaStreamTrack&) { } - virtual void didDisableMediaStreamTrack(const WebMediaStream&, const WebMediaStreamTrack&) { } + // Caller must take the ownership of the returned |WebAudioSourceProvider| object. + virtual WebAudioSourceProvider* createWebAudioSourceFromMediaStreamTrack(const WebMediaStreamTrack&) { return 0; } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebMediaStreamCenterClient.h b/chromium/third_party/WebKit/public/platform/WebMediaStreamCenterClient.h index 014702e94c1..cfe031e1871 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaStreamCenterClient.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaStreamCenterClient.h @@ -31,11 +31,13 @@ #ifndef WebMediaStreamCenterClient_h #define WebMediaStreamCenterClient_h +#include "WebCommon.h" + namespace blink { class WebMediaStream; class WebMediaStreamTrack; -class WebMediaStreamCenterClient { +class BLINK_PLATFORM_EXPORT WebMediaStreamCenterClient { public: virtual ~WebMediaStreamCenterClient() { } diff --git a/chromium/third_party/WebKit/public/platform/WebMediaStreamTrack.h b/chromium/third_party/WebKit/public/platform/WebMediaStreamTrack.h index 598bf88e341..e08c1f90fb0 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaStreamTrack.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaStreamTrack.h @@ -43,7 +43,17 @@ class WebMediaStreamTrack { public: class ExtraData { public: + ExtraData() : m_owner(0) { } virtual ~ExtraData() { } + + BLINK_PLATFORM_EXPORT WebMediaStreamTrack owner(); + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT void setOwner(WebCore::MediaStreamComponent*); +#endif + + private: + WebCore::MediaStreamComponent* m_owner; }; WebMediaStreamTrack() { } @@ -55,38 +65,37 @@ public: assign(other); return *this; } - BLINK_EXPORT void assign(const WebMediaStreamTrack&); + BLINK_PLATFORM_EXPORT void assign(const WebMediaStreamTrack&); - BLINK_EXPORT void initialize(const WebMediaStreamSource&); - BLINK_EXPORT void initialize(const WebString& id, const WebMediaStreamSource&); + BLINK_PLATFORM_EXPORT void initialize(const WebMediaStreamSource&); + BLINK_PLATFORM_EXPORT void initialize(const WebString& id, const WebMediaStreamSource&); - BLINK_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void reset(); bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT WebString id() const; + BLINK_PLATFORM_EXPORT WebString id() const; - BLINK_EXPORT WebMediaStream stream() const; - BLINK_EXPORT WebMediaStreamSource source() const; - BLINK_EXPORT bool isEnabled() const; + BLINK_PLATFORM_EXPORT WebMediaStreamSource source() const; + BLINK_PLATFORM_EXPORT bool isEnabled() const; // Extra data associated with this WebMediaStream. // If non-null, the extra data pointer will be deleted when the object is destroyed. // Setting the extra data pointer will cause any existing non-null // extra data pointer to be deleted. - BLINK_EXPORT ExtraData* extraData() const; - BLINK_EXPORT void setExtraData(ExtraData*); + BLINK_PLATFORM_EXPORT ExtraData* extraData() const; + BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); // The lifetime of the WebAudioSourceProvider should outlive the // WebMediaStreamTrack, and clients are responsible for calling // setSourceProvider(0) before the WebMediaStreamTrack is going away. - BLINK_EXPORT void setSourceProvider(WebAudioSourceProvider*); - -#if BLINK_IMPLEMENTATION - WebMediaStreamTrack(PassRefPtr<WebCore::MediaStreamComponent>); - WebMediaStreamTrack(WebCore::MediaStreamComponent*); - WebMediaStreamTrack& operator=(WebCore::MediaStreamComponent*); - operator WTF::PassRefPtr<WebCore::MediaStreamComponent>() const; - operator WebCore::MediaStreamComponent*() const; + BLINK_PLATFORM_EXPORT void setSourceProvider(WebAudioSourceProvider*); + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebMediaStreamTrack(PassRefPtr<WebCore::MediaStreamComponent>); + BLINK_PLATFORM_EXPORT WebMediaStreamTrack(WebCore::MediaStreamComponent*); + BLINK_PLATFORM_EXPORT WebMediaStreamTrack& operator=(WebCore::MediaStreamComponent*); + BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::MediaStreamComponent>() const; + BLINK_PLATFORM_EXPORT operator WebCore::MediaStreamComponent*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h b/chromium/third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h index 074c9bf7644..a0826daf5d8 100644 --- a/chromium/third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h +++ b/chromium/third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h @@ -56,23 +56,23 @@ public: return *this; } - BLINK_EXPORT void assign(const WebMediaStreamTrackSourcesRequest&); + BLINK_PLATFORM_EXPORT void assign(const WebMediaStreamTrackSourcesRequest&); - BLINK_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void reset(); bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT WebString origin() const; - BLINK_EXPORT void requestSucceeded(const WebVector<WebSourceInfo>&) const; + BLINK_PLATFORM_EXPORT WebString origin() const; + BLINK_PLATFORM_EXPORT void requestSucceeded(const WebVector<WebSourceInfo>&) const; // Extra data associated with this object. // If non-null, the extra data pointer will be deleted when the object is destroyed. // Setting the extra data pointer will cause any existing non-null // extra data pointer to be deleted. - BLINK_EXPORT ExtraData* extraData() const; - BLINK_EXPORT void setExtraData(ExtraData*); + BLINK_PLATFORM_EXPORT ExtraData* extraData() const; + BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); -#if BLINK_IMPLEMENTATION - WebMediaStreamTrackSourcesRequest(const WTF::PassRefPtr<WebCore::MediaStreamTrackSourcesRequest>&); +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebMediaStreamTrackSourcesRequest(const PassRefPtrWillBeRawPtr<WebCore::MediaStreamTrackSourcesRequest>&); #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebMessagePortChannel.h b/chromium/third_party/WebKit/public/platform/WebMessagePortChannel.h index 852718796df..6fce4e7a883 100644 --- a/chromium/third_party/WebKit/public/platform/WebMessagePortChannel.h +++ b/chromium/third_party/WebKit/public/platform/WebMessagePortChannel.h @@ -47,9 +47,8 @@ class WebMessagePortChannel { public: virtual void setClient(WebMessagePortChannelClient*) = 0; virtual void destroy() = 0; - // WebKit versions of WebCore::MessagePortChannel. - virtual void entangle(WebMessagePortChannel*) = 0; // Callee receives ownership of the passed vector. + // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0; virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebMimeRegistry.h b/chromium/third_party/WebKit/public/platform/WebMimeRegistry.h index 21a60ea82af..55a146e2081 100644 --- a/chromium/third_party/WebKit/public/platform/WebMimeRegistry.h +++ b/chromium/third_party/WebKit/public/platform/WebMimeRegistry.h @@ -46,6 +46,7 @@ public: virtual SupportsType supportsMediaMIMEType(const blink::WebString& mimeType, const blink::WebString& codecs, const blink::WebString& keySystem) = 0; virtual bool supportsMediaSourceMIMEType(const blink::WebString& mimeType, const blink::WebString& codecs) = 0; + virtual bool supportsEncryptedMediaMIMEType(const blink::WebString& keySystem, const blink::WebString& mimeType, const blink::WebString& codecs) = 0; virtual SupportsType supportsNonImageMIMEType(const blink::WebString& mimeType) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebPermissionCallbacks.h b/chromium/third_party/WebKit/public/platform/WebPermissionCallbacks.h new file mode 100644 index 00000000000..a5f5f96465b --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebPermissionCallbacks.h @@ -0,0 +1,47 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebPermissionCallbacks_h +#define WebPermissionCallbacks_h + +#include "WebPrivatePtr.h" + +namespace WebCore { +class PermissionCallbacks; +} + +namespace WTF { template <typename T> class PassOwnPtr; } + +namespace blink { + +class WebPermissionCallbacksPrivate; + +class WebPermissionCallbacks { +public: + ~WebPermissionCallbacks() { reset(); } + WebPermissionCallbacks() { } + WebPermissionCallbacks(const WebPermissionCallbacks& c) { assign(c); } + WebPermissionCallbacks& operator=(const WebPermissionCallbacks& c) + { + assign(c); + return *this; + } + + BLINK_PLATFORM_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void assign(const WebPermissionCallbacks&); + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebPermissionCallbacks(const WTF::PassOwnPtr<WebCore::PermissionCallbacks>&); +#endif + + BLINK_PLATFORM_EXPORT void doAllow(); + BLINK_PLATFORM_EXPORT void doDeny(); + +private: + WebPrivatePtr<WebPermissionCallbacksPrivate> m_private; +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebPrerender.h b/chromium/third_party/WebKit/public/platform/WebPrerender.h index cb30c7601c5..eb77bf9e166 100644 --- a/chromium/third_party/WebKit/public/platform/WebPrerender.h +++ b/chromium/third_party/WebKit/public/platform/WebPrerender.h @@ -47,6 +47,12 @@ class Prerender; namespace blink { +// WebPrerenderRelType is a bitfield since multiple rel attributes can be set on the same prerender. +enum WebPrerenderRelType { + PrerenderRelTypePrerender = 0x1, + PrerenderRelTypeNext = 0x2, +}; + class WebPrerender { public: class ExtraData { @@ -75,6 +81,7 @@ public: BLINK_PLATFORM_EXPORT WebURL url() const; BLINK_PLATFORM_EXPORT WebString referrer() const; + BLINK_PLATFORM_EXPORT unsigned relTypes() const; BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); diff --git a/chromium/third_party/WebKit/public/platform/WebPrivatePtr.h b/chromium/third_party/WebKit/public/platform/WebPrivatePtr.h index 83ed0d70899..b7ff90513a2 100644 --- a/chromium/third_party/WebKit/public/platform/WebPrivatePtr.h +++ b/chromium/third_party/WebKit/public/platform/WebPrivatePtr.h @@ -34,21 +34,142 @@ #include "WebCommon.h" #if INSIDE_BLINK + +namespace WebCore { template<typename T> class TreeShared; } + +#include "platform/heap/Handle.h" #include "wtf/PassRefPtr.h" +#include "wtf/TypeTraits.h" #endif namespace blink { -// This class is an implementation detail of the WebKit API. It exists -// to help simplify the implementation of WebKit interfaces that merely -// wrap a reference counted WebCore class. +#if INSIDE_BLINK +enum LifetimeManagementType { + RefCountedLifetime, + GarbageCollectedLifetime, + RefCountedGarbageCollectedLifetime +}; + +template<typename T> +class LifetimeOf { + static const bool isGarbageCollected = WTF::IsSubclassOfTemplate<T, WebCore::GarbageCollected>::value; + static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T, WebCore::RefCountedGarbageCollected>::value; +public: + static const LifetimeManagementType value = + !isGarbageCollected ? RefCountedLifetime : + isRefCountedGarbageCollected ? RefCountedGarbageCollectedLifetime : GarbageCollectedLifetime; +}; + +template<typename T, LifetimeManagementType lifetime> +class PtrStorageImpl; + +template<typename T> +class PtrStorageImpl<T, RefCountedLifetime> { +public: + typedef PassRefPtr<T> BlinkPtrType; + + void assign(const BlinkPtrType& val) + { + release(); + m_ptr = val.leakRef(); + } + + void assign(const PtrStorageImpl& other) + { + release(); + T* val = other.get(); + if (val) + val->ref(); + m_ptr = val; + } + + T* get() const { return m_ptr; } + + void release() + { + if (m_ptr) + m_ptr->deref(); + m_ptr = 0; + } + +private: + T* m_ptr; +}; + +template<typename T> +class PtrStorageImpl<T, GarbageCollectedLifetime> { +public: + void assign(const RawPtr<T>& val) + { + if (!val) { + release(); + return; + } + + if (!m_handle) + m_handle = new WebCore::Persistent<T>(); + + (*m_handle) = val; + } + + void assign(T* ptr) { assign(RawPtr<T>(ptr)); } + template<typename U> void assign(const RawPtr<U>& val) { assign(RawPtr<T>(val)); } + + void assign(const PtrStorageImpl& other) { assign(other.get()); } + + T* get() const { return m_handle ? m_handle->get() : 0; } + + void release() + { + delete m_handle; + m_handle = 0; + } + +private: + WebCore::Persistent<T>* m_handle; +}; + +template<typename T> +class PtrStorageImpl<T, RefCountedGarbageCollectedLifetime> : public PtrStorageImpl<T, GarbageCollectedLifetime> { +public: + void assign(const PassRefPtrWillBeRawPtr<T>& val) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(val.get()); } + + void assign(const PtrStorageImpl& other) { PtrStorageImpl<T, GarbageCollectedLifetime>::assign(other.get()); } +}; + +template<typename T> +class PtrStorage : public PtrStorageImpl<T, LifetimeOf<T>::value> { +public: + static PtrStorage& fromSlot(void** slot) + { + COMPILE_ASSERT(sizeof(PtrStorage) == sizeof(void*), PtrStorage_must_be_pointer_size); + return *reinterpret_cast<PtrStorage*>(slot); + } + + static const PtrStorage& fromSlot(void* const* slot) + { + COMPILE_ASSERT(sizeof(PtrStorage) == sizeof(void*), PtrStorage_must_be_pointer_size); + return *reinterpret_cast<const PtrStorage*>(slot); + } + +private: + // Prevent construction via normal means. + PtrStorage(); + PtrStorage(const PtrStorage&); +}; +#endif + + +// This class is an implementation detail of the Blink API. It exists to help +// simplify the implementation of Blink interfaces that merely wrap a reference +// counted WebCore class. // // A typical implementation of a class which uses WebPrivatePtr might look like // this: // class WebFoo { // public: -// virtual ~WebFoo() { } // Only necessary if WebFoo will be used as a -// // base class. +// BLINK_EXPORT ~WebFoo(); // WebFoo() { } // WebFoo(const WebFoo& other) { assign(other); } // WebFoo& operator=(const WebFoo& other) @@ -62,8 +183,8 @@ namespace blink { // // WebFoo go here. // BLINK_EXPORT doWebFooThing(); // -// // Methods that are used only by other WebKit/chromium API classes -// // should only be declared when INSIDE_BLINK is set. +// // Methods that are used only by other Blink classes should only be +// // declared when INSIDE_BLINK is set. // #if INSIDE_BLINK // WebFoo(const WTF::PassRefPtr<WebCore::Foo>&); // #endif @@ -72,62 +193,70 @@ namespace blink { // WebPrivatePtr<WebCore::Foo> m_private; // }; // +// // WebFoo.cpp +// WebFoo::~WebFoo() { m_private.reset(); } +// void WebFoo::assign(const WebFoo& other) { ... } +// template <typename T> class WebPrivatePtr { public: - WebPrivatePtr() : m_ptr(0) { } - ~WebPrivatePtr() { BLINK_ASSERT(!m_ptr); } + WebPrivatePtr() : m_storage(0) { } + ~WebPrivatePtr() + { + // We don't destruct the object pointed by m_ptr here because we don't + // want to expose destructors of core classes to embedders. We should + // call reset() manually in destructors of classes with WebPrivatePtr + // members. + BLINK_ASSERT(!m_storage); + } - bool isNull() const { return !m_ptr; } + bool isNull() const { return !m_storage; } #if INSIDE_BLINK - WebPrivatePtr(const PassRefPtr<T>& prp) - : m_ptr(prp.leakRef()) + template<typename U> + WebPrivatePtr(const U& ptr) + : m_storage(0) { + storage().assign(ptr); } - void reset() - { - assign(0); - } + void reset() { storage().release(); } WebPrivatePtr<T>& operator=(const WebPrivatePtr<T>& other) { - T* p = other.m_ptr; - if (p) - p->ref(); - assign(p); + storage().assign(other.storage()); return *this; } - WebPrivatePtr<T>& operator=(const PassRefPtr<T>& prp) + template<typename U> + WebPrivatePtr<T>& operator=(const U& ptr) { - assign(prp.leakRef()); + storage().assign(ptr); return *this; } - T* get() const + T* get() const { return storage().get(); } + + T& operator*() const { - return m_ptr; + ASSERT(m_storage); + return *get(); } T* operator->() const { - ASSERT(m_ptr); - return m_ptr; + ASSERT(m_storage); + return get(); } #endif private: #if INSIDE_BLINK - void assign(T* p) - { - // p is already ref'd for us by the caller - if (m_ptr) - m_ptr->deref(); - m_ptr = p; - } -#else + PtrStorage<T>& storage() { return PtrStorage<T>::fromSlot(&m_storage); } + const PtrStorage<T>& storage() const { return PtrStorage<T>::fromSlot(&m_storage); } +#endif + +#if !INSIDE_BLINK // Disable the assignment operator; we define it above for when // INSIDE_BLINK is set, but we need to make sure that it is not // used outside there; the compiler-provided version won't handle reference @@ -138,7 +267,7 @@ private: // should implement their copy constructor using assign(). WebPrivatePtr(const WebPrivatePtr<T>&); - T* m_ptr; + void* m_storage; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebPushClient.h b/chromium/third_party/WebKit/public/platform/WebPushClient.h new file mode 100644 index 00000000000..134f44591cf --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebPushClient.h @@ -0,0 +1,26 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebPushClient_h +#define WebPushClient_h + +#include "public/platform/WebCallbacks.h" +#include "public/platform/WebPushError.h" +#include "public/platform/WebString.h" + +namespace blink { + +struct WebPushRegistration; + +typedef WebCallbacks<WebPushRegistration, WebPushError> WebPushRegistrationCallbacks; + +class WebPushClient { +public: + virtual ~WebPushClient() { } + virtual void registerPushMessaging(const WebString& senderId, WebPushRegistrationCallbacks*) = 0; +}; + +} // namespace blink + +#endif // WebPushClient_h diff --git a/chromium/third_party/WebKit/public/platform/WebPushError.h b/chromium/third_party/WebKit/public/platform/WebPushError.h new file mode 100644 index 00000000000..408254b5cc7 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebPushError.h @@ -0,0 +1,31 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebPushError_h +#define WebPushError_h + +#include "WebString.h" + +namespace blink { + +struct WebPushError { + enum ErrorType { + ErrorTypeAbort = 0, + ErrorTypeUnknown, + ErrorTypeLast = ErrorTypeUnknown + }; + + WebPushError(ErrorType errorType, const WebString& message) + : errorType(errorType) + , message(message) + { + } + + ErrorType errorType; + WebString message; +}; + +} // namespace blink + +#endif // WebPushError_h diff --git a/chromium/third_party/WebKit/public/platform/WebPushRegistration.h b/chromium/third_party/WebKit/public/platform/WebPushRegistration.h new file mode 100644 index 00000000000..18b6ce1e08f --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebPushRegistration.h @@ -0,0 +1,25 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebPushRegistration_h +#define WebPushRegistration_h + +#include "WebString.h" + +namespace blink { + +struct WebPushRegistration { + WebPushRegistration(const WebString& endpoint, const WebString& registrationId) + : endpoint(endpoint) + , registrationId(registrationId) + { + } + + WebString endpoint; + WebString registrationId; +}; + +} // namespace blink + +#endif // WebPushRegistration_h diff --git a/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h b/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h index 22701f0749a..88e200bde3e 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h @@ -32,7 +32,7 @@ namespace blink { class WebRTCDTMFSenderHandlerClient; -class BLINK_PLATFORM_EXPORT WebRTCDTMFSenderHandler { +class WebRTCDTMFSenderHandler { public: virtual ~WebRTCDTMFSenderHandler() { } diff --git a/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandlerClient.h b/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandlerClient.h index 89062c41451..adffca3b436 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandlerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCDTMFSenderHandlerClient.h @@ -29,12 +29,13 @@ #include "WebCommon.h" namespace blink { +class WebString; -class BLINK_PLATFORM_EXPORT WebRTCDTMFSenderHandlerClient { +class WebRTCDTMFSenderHandlerClient { public: virtual ~WebRTCDTMFSenderHandlerClient() { } - virtual void didPlayTone(const WebString& tone) const = 0; + virtual void didPlayTone(const WebString& tone) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h b/chromium/third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h index 6c737ae962d..3d5fbcf3e6f 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h @@ -42,10 +42,10 @@ public: virtual ~WebRTCDataChannelHandlerClient() { } - virtual void didChangeReadyState(ReadyState) const = 0; - virtual void didReceiveStringData(const WebString&) const = 0; - virtual void didReceiveRawData(const char*, size_t) const = 0; - virtual void didDetectError() const = 0; + virtual void didChangeReadyState(ReadyState) = 0; + virtual void didReceiveStringData(const WebString&) = 0; + virtual void didReceiveRawData(const char*, size_t) = 0; + virtual void didDetectError() = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebRTCICECandidate.h b/chromium/third_party/WebKit/public/platform/WebRTCICECandidate.h index 47eb0a921f0..773c977ab85 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCICECandidate.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCICECandidate.h @@ -65,6 +65,9 @@ public: BLINK_PLATFORM_EXPORT WebString candidate() const; BLINK_PLATFORM_EXPORT WebString sdpMid() const; BLINK_PLATFORM_EXPORT unsigned short sdpMLineIndex() const; + BLINK_PLATFORM_EXPORT void setCandidate(WebString); + BLINK_PLATFORM_EXPORT void setSdpMid(WebString); + BLINK_PLATFORM_EXPORT void setSdpMLineIndex(unsigned short); #if INSIDE_BLINK WebRTCICECandidate(WebString candidate, WebString sdpMid, unsigned short sdpMLineIndex) diff --git a/chromium/third_party/WebKit/public/platform/WebRTCPeerConnectionHandlerClient.h b/chromium/third_party/WebKit/public/platform/WebRTCPeerConnectionHandlerClient.h index 27a24fb401d..7dd4fa23496 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCPeerConnectionHandlerClient.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCPeerConnectionHandlerClient.h @@ -76,6 +76,7 @@ public: virtual void didAddRemoteStream(const WebMediaStream&) = 0; virtual void didRemoveRemoteStream(const WebMediaStream&) = 0; virtual void didAddRemoteDataChannel(WebRTCDataChannelHandler*) = 0; + virtual void releasePeerConnectionHandler() = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebRTCSessionDescription.h b/chromium/third_party/WebKit/public/platform/WebRTCSessionDescription.h index 49297554462..a4b17461451 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCSessionDescription.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCSessionDescription.h @@ -64,16 +64,16 @@ public: return *this; } - BLINK_EXPORT void assign(const WebRTCSessionDescription&); + BLINK_PLATFORM_EXPORT void assign(const WebRTCSessionDescription&); - BLINK_EXPORT void initialize(const WebString& type, const WebString& sdp); - BLINK_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void initialize(const WebString& type, const WebString& sdp); + BLINK_PLATFORM_EXPORT void reset(); bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT WebString type() const; - BLINK_EXPORT void setType(const WebString&); - BLINK_EXPORT WebString sdp() const; - BLINK_EXPORT void setSDP(const WebString&); + BLINK_PLATFORM_EXPORT WebString type() const; + BLINK_PLATFORM_EXPORT void setType(const WebString&); + BLINK_PLATFORM_EXPORT WebString sdp() const; + BLINK_PLATFORM_EXPORT void setSDP(const WebString&); #if BLINK_IMPLEMENTATION WebRTCSessionDescription(WebString type, WebString sdp) diff --git a/chromium/third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h b/chromium/third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h index ca2c1829565..71663894333 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h @@ -60,23 +60,23 @@ public: return *this; } - BLINK_EXPORT void assign(const WebRTCSessionDescriptionRequest&); + BLINK_PLATFORM_EXPORT void assign(const WebRTCSessionDescriptionRequest&); - BLINK_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void reset(); bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT void requestSucceeded(const WebRTCSessionDescription&) const; - BLINK_EXPORT void requestFailed(const WebString& error) const; + BLINK_PLATFORM_EXPORT void requestSucceeded(const WebRTCSessionDescription&) const; + BLINK_PLATFORM_EXPORT void requestFailed(const WebString& error) const; // Extra data associated with this object. // If non-null, the extra data pointer will be deleted when the object is destroyed. // Setting the extra data pointer will cause any existing non-null // extra data pointer to be deleted. - BLINK_EXPORT ExtraData* extraData() const; - BLINK_EXPORT void setExtraData(ExtraData*); + BLINK_PLATFORM_EXPORT ExtraData* extraData() const; + BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); -#if BLINK_IMPLEMENTATION - WebRTCSessionDescriptionRequest(const WTF::PassRefPtr<WebCore::RTCSessionDescriptionRequest>&); +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebRTCSessionDescriptionRequest(const WTF::PassRefPtr<WebCore::RTCSessionDescriptionRequest>&); #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebRTCStatsRequest.h b/chromium/third_party/WebKit/public/platform/WebRTCStatsRequest.h index 914c0c4b191..c7cd98ae60b 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCStatsRequest.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCStatsRequest.h @@ -78,26 +78,24 @@ public: return *this; } - BLINK_EXPORT void assign(const WebRTCStatsRequest&); + BLINK_PLATFORM_EXPORT void assign(const WebRTCStatsRequest&); - BLINK_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void reset(); // This function returns true if a selector argument was given to getStats. - BLINK_EXPORT bool hasSelector() const; + BLINK_PLATFORM_EXPORT bool hasSelector() const; - // The stream() and component() accessors give the two pieces of information + // The component() accessor give the information // required to look up a MediaStreamTrack implementation. - // It is only useful to call them when hasSelector() returns true. - BLINK_EXPORT const WebMediaStream stream() const; + // It is only useful to call it when hasSelector() returns true. + BLINK_PLATFORM_EXPORT const WebMediaStreamTrack component() const; - BLINK_EXPORT const WebMediaStreamTrack component() const; + BLINK_PLATFORM_EXPORT void requestSucceeded(const WebRTCStatsResponse&) const; - BLINK_EXPORT void requestSucceeded(const WebRTCStatsResponse&) const; + BLINK_PLATFORM_EXPORT WebRTCStatsResponse createResponse() const; - BLINK_EXPORT WebRTCStatsResponse createResponse() const; - -#if BLINK_IMPLEMENTATION - WebRTCStatsRequest(const WTF::PassRefPtr<WebCore::RTCStatsRequest>&); +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebRTCStatsRequest(const WTF::PassRefPtr<WebCore::RTCStatsRequest>&); #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebRTCStatsResponse.h b/chromium/third_party/WebKit/public/platform/WebRTCStatsResponse.h index 9ee81bf6c0d..10e8ba89fd6 100644 --- a/chromium/third_party/WebKit/public/platform/WebRTCStatsResponse.h +++ b/chromium/third_party/WebKit/public/platform/WebRTCStatsResponse.h @@ -55,9 +55,9 @@ public: BLINK_PLATFORM_EXPORT void addStatistic(size_t report, WebString name, WebString value); #if INSIDE_BLINK - BLINK_PLATFORM_EXPORT WebRTCStatsResponse(const WTF::PassRefPtr<WebCore::RTCStatsResponseBase>&); + BLINK_PLATFORM_EXPORT WebRTCStatsResponse(const PassRefPtrWillBeRawPtr<WebCore::RTCStatsResponseBase>&); - BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::RTCStatsResponseBase>() const; + BLINK_PLATFORM_EXPORT operator PassRefPtrWillBeRawPtr<WebCore::RTCStatsResponseBase>() const; #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebReferrerPolicy.h b/chromium/third_party/WebKit/public/platform/WebReferrerPolicy.h index 457c3dec730..602966a5a20 100644 --- a/chromium/third_party/WebKit/public/platform/WebReferrerPolicy.h +++ b/chromium/third_party/WebKit/public/platform/WebReferrerPolicy.h @@ -38,6 +38,7 @@ enum WebReferrerPolicy { WebReferrerPolicyDefault, WebReferrerPolicyNever, WebReferrerPolicyOrigin, + WebReferrerPolicyLast = WebReferrerPolicyOrigin }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebScreenInfo.h b/chromium/third_party/WebKit/public/platform/WebScreenInfo.h index 929f724f3fd..90413b9d4c6 100644 --- a/chromium/third_party/WebKit/public/platform/WebScreenInfo.h +++ b/chromium/third_party/WebKit/public/platform/WebScreenInfo.h @@ -32,6 +32,7 @@ #define WebScreenInfo_h #include "WebRect.h" +#include "WebScreenOrientationType.h" namespace blink { @@ -67,11 +68,22 @@ struct WebScreenInfo { // some of the rectangle's coordinates may be negative values". WebRect availableRect; + // This is the orientation 'type' or 'name', as in landscape-primary or + // portrait-secondary for examples. + // See WebScreenOrientationType.h for the full list. + WebScreenOrientationType orientationType; + + // This is the orientation angle of the displayed content in degrees. + // It is the opposite of the physical rotation. + uint16_t orientationAngle; + WebScreenInfo() : deviceScaleFactor(1) , depth(0) , depthPerComponent(0) - , isMonochrome(false) { } + , isMonochrome(false) + , orientationType(WebScreenOrientationUndefined) + , orientationAngle(0) { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebScreenOrientationClient.h b/chromium/third_party/WebKit/public/platform/WebScreenOrientationClient.h new file mode 100644 index 00000000000..ca0c2c326d2 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebScreenOrientationClient.h @@ -0,0 +1,28 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebScreenOrientationClient_h +#define WebScreenOrientationClient_h + +#include "public/platform/WebScreenOrientationLockType.h" + +namespace blink { + +class WebLockOrientationCallback; + +// Client handling screen orientation locking for a given WebFrame. +class WebScreenOrientationClient { +public: + virtual ~WebScreenOrientationClient() { } + + // Request a screen orientation lock. The implementation will own the callback. + virtual void lockOrientation(WebScreenOrientationLockType, WebLockOrientationCallback*) = 0; + + // Unlock the screen orientation. No-op if the screen orientation was not locked. + virtual void unlockOrientation() = 0; +}; + +} // namespace blink + +#endif // WebScreenOrientationClient_h diff --git a/chromium/third_party/WebKit/public/platform/WebScreenOrientationLockType.h b/chromium/third_party/WebKit/public/platform/WebScreenOrientationLockType.h new file mode 100644 index 00000000000..43e47b51128 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebScreenOrientationLockType.h @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebScreenOrientationLockType_h +#define WebScreenOrientationLockType_h + +namespace blink { + +enum WebScreenOrientationLockType { + WebScreenOrientationLockDefault = 0, // Equivalent to unlock. + WebScreenOrientationLockPortraitPrimary, + WebScreenOrientationLockPortraitSecondary, + WebScreenOrientationLockLandscapePrimary, + WebScreenOrientationLockLandscapeSecondary, + WebScreenOrientationLockAny, + WebScreenOrientationLockLandscape, + WebScreenOrientationLockPortrait +}; + +} // namespace blink + +#endif // WebScreenOrientationLockType_h diff --git a/chromium/third_party/WebKit/public/platform/WebScreenOrientationType.h b/chromium/third_party/WebKit/public/platform/WebScreenOrientationType.h new file mode 100644 index 00000000000..ea1b55d5d6e --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebScreenOrientationType.h @@ -0,0 +1,20 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebScreenOrientationType_h +#define WebScreenOrientationType_h + +namespace blink { + +enum WebScreenOrientationType { + WebScreenOrientationUndefined = 0, + WebScreenOrientationPortraitPrimary, + WebScreenOrientationPortraitSecondary, + WebScreenOrientationLandscapePrimary, + WebScreenOrientationLandscapeSecondary +}; + +} // namespace blink + +#endif // WebScreenOrientationType_h diff --git a/chromium/third_party/WebKit/public/platform/WebScrollbarBehavior.h b/chromium/third_party/WebKit/public/platform/WebScrollbarBehavior.h new file mode 100644 index 00000000000..6d9b8a15746 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebScrollbarBehavior.h @@ -0,0 +1,28 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebScrollbarBehavior_h +#define WebScrollbarBehavior_h + +namespace blink { + +struct WebPoint; +struct WebRect; + +class WebScrollbarBehavior { +public: + enum Button { + ButtonNone = -1, + ButtonLeft, + ButtonMiddle, + ButtonRight + }; + virtual ~WebScrollbarBehavior() { } + virtual bool shouldCenterOnThumb(Button, bool shiftKeyPressed, bool altKeyPressed) { return false; } + virtual bool shouldSnapBackToDragOrigin(const WebPoint& eventPoint, const WebRect& scrollbarRect, bool isHorizontal) { return false; } +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebScrollbarLayer.h b/chromium/third_party/WebKit/public/platform/WebScrollbarLayer.h index 5658da84c92..ea0706e9e77 100644 --- a/chromium/third_party/WebKit/public/platform/WebScrollbarLayer.h +++ b/chromium/third_party/WebKit/public/platform/WebScrollbarLayer.h @@ -43,6 +43,7 @@ public: virtual WebLayer* layer() = 0; virtual void setScrollLayer(WebLayer*) = 0; + virtual void setClipLayer(WebLayer*) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebSerializedOrigin.h b/chromium/third_party/WebKit/public/platform/WebSerializedOrigin.h new file mode 100644 index 00000000000..0e01ae4cca0 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebSerializedOrigin.h @@ -0,0 +1,40 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebSerializedOrigin_h +#define WebSerializedOrigin_h + +#include "WebString.h" + +#if INSIDE_BLINK +namespace WebCore { class SecurityOrigin; } +#else +#include <url/origin.h> +#endif + +namespace blink { + +// WebSerializedOrigin represents a serialized Web Origin specified in RFC6454. +class WebSerializedOrigin { +public: + WebSerializedOrigin() : m_string("null") { } +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebSerializedOrigin(const WebCore::SecurityOrigin&); +#else + WebSerializedOrigin(const url::Origin& origin) : m_string(WebString::fromUTF8(origin.string())) { } + operator url::Origin() const { return url::Origin(m_string.utf8()); } +#endif + + const WebString& string() const + { + return m_string; + } + +private: + const WebString m_string; +}; + +} // namespace blink + +#endif // #ifndef SerializedOrigin_h diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorker.h b/chromium/third_party/WebKit/public/platform/WebServiceWorker.h index 3f428890e06..52ad4404637 100644 --- a/chromium/third_party/WebKit/public/platform/WebServiceWorker.h +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorker.h @@ -31,10 +31,40 @@ #ifndef WebServiceWorker_h #define WebServiceWorker_h +#include "WebCommon.h" +#include "WebMessagePortChannel.h" +#include "WebServiceWorkerState.h" +#include "WebString.h" +#include "WebURL.h" +#include "WebVector.h" + namespace blink { +class WebServiceWorkerProxy; +typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray; + class WebServiceWorker { +public: + virtual ~WebServiceWorker() { } + + // Sets ServiceWorkerProxy, with which callee can start making upcalls + // to the ServiceWorker object via the client. This doesn't pass the + // ownership to the callee, and the proxy's lifetime is same as that of + // WebServiceWorker. + virtual void setProxy(WebServiceWorkerProxy*) { } + virtual WebServiceWorkerProxy* proxy() { return 0; } + + // Called by this worker's ServiceWorkerProxy when it has become ready or + // not ready for state change notifications. + virtual void proxyReadyChanged() { } + + virtual WebURL scope() const { return WebURL(); } + virtual WebURL url() const { return WebURL(); } + virtual WebServiceWorkerState state() const { return WebServiceWorkerStateUnknown; } + // Callee receives ownership of the passed vector. + // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 + virtual void postMessage(const WebString&, WebMessagePortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } }; } diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h new file mode 100644 index 00000000000..5fde9f43627 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerClientsInfo_h +#define WebServiceWorkerClientsInfo_h + +#include "WebCallbacks.h" +#include "WebVector.h" + +namespace blink { + +struct WebServiceWorkerError; + +struct WebServiceWorkerClientsInfo { + WebVector<int> clientIDs; +}; + +typedef WebCallbacks<WebServiceWorkerClientsInfo, WebServiceWorkerError> WebServiceWorkerClientsCallbacks; + +} // namespace blink + +#endif // WebServiceWorkerClientsInfo_h diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerError.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerError.h index c4d18922a85..4a944b646e1 100644 --- a/chromium/third_party/WebKit/public/platform/WebServiceWorkerError.h +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerError.h @@ -37,11 +37,14 @@ namespace blink { struct WebServiceWorkerError { enum ErrorType { - DisabledError = 0, - SecurityError, - InstallError, - ActivateError, - UnknownError + ErrorTypeDisabled = 0, + ErrorTypeAbort, + ErrorTypeSecurity, + ErrorTypeInstall, + ErrorTypeActivate, + ErrorTypeNotFound, + ErrorTypeUnknown, + ErrorTypeLast = ErrorTypeUnknown }; WebServiceWorkerError(ErrorType errorType, const WebString& message) diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerEventResult.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerEventResult.h new file mode 100644 index 00000000000..fddfcd06beb --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerEventResult.h @@ -0,0 +1,22 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerEventResult_h +#define WebServiceWorkerEventResult_h + +namespace blink { + +// Indicates how the service worker handled an event. +enum WebServiceWorkerEventResult { + // The event dispatch completed with no rejections. + WebServiceWorkerEventResultCompleted = 0, + // The service worker associated the event with a promise that was rejected + // (e.g., the promise passed to waitUntil for an install event was rejected). + WebServiceWorkerEventResultRejected, + WebServiceWorkerEventResultLast = WebServiceWorkerEventResultRejected +}; + +} // namespace blink + +#endif // WebServiceWorkerEventResult_h diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerProvider.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerProvider.h index 73e23635408..7fb36b2844f 100644 --- a/chromium/third_party/WebKit/public/platform/WebServiceWorkerProvider.h +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerProvider.h @@ -38,15 +38,27 @@ namespace blink { class WebString; class WebURL; class WebServiceWorker; +class WebServiceWorkerProviderClient; struct WebServiceWorkerError; +// Created on the main thread, and may be passed to another script context +// thread (e.g. worker thread) later. All methods of this class must be called +// on the single script context thread. class WebServiceWorkerProvider { public: + // Called when a client wants to start listening to the service worker events. Must be cleared before the client becomes invalid. + virtual void setClient(WebServiceWorkerProviderClient*) { } + // The WebServiceWorker and WebServiceWorkerError ownership are passed to the WebServiceWorkerCallbacks implementation. typedef WebCallbacks<WebServiceWorker, WebServiceWorkerError> WebServiceWorkerCallbacks; virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scriptUrl, WebServiceWorkerCallbacks*) { } + // Unregisters the ServiceWorker for a given scope. The provider + // must always pass null to onSuccess. + // FIXME: "unregister" does not provide a WebServiceWorker, revisit this + // to clean up the the callback type to not take a WebServiceWorker*. virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorkerCallbacks*) { } + virtual ~WebServiceWorkerProvider() { } }; diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h index 3a9cac61505..f84ae607ea5 100644 --- a/chromium/third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h @@ -31,18 +31,24 @@ #ifndef WebServiceWorkerProviderClient_h #define WebServiceWorkerProviderClient_h +#include "public/platform/WebMessagePortChannel.h" + namespace blink { +class WebServiceWorker; class WebString; -// This class catches any errors that may originate on the browser -// side and not via a DOM API call, such as errors that occur when -// loading resources through the service worker. +// This class is the interface for embedders to talk to +// ServiceWorkerContainer. class WebServiceWorkerProviderClient { public: - // FIXME: replace this general error handler with more specific error handlers. - virtual void didFailToStart(const WebString& message) { } - virtual ~WebServiceWorkerProviderClient() { } + + virtual void setActive(WebServiceWorker*) = 0; + virtual void setController(WebServiceWorker*) = 0; + virtual void setInstalling(WebServiceWorker*) = 0; + virtual void setWaiting(WebServiceWorker*) = 0; + + virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray&) = 0; }; }; diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerProxy.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerProxy.h new file mode 100644 index 00000000000..9d5230b87cd --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerProxy.h @@ -0,0 +1,42 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerProxy_h +#define WebServiceWorkerProxy_h + +#include "WebCommon.h" + +namespace WebCore { class ServiceWorker; } + +namespace blink { + +// A proxy interface, passed via WebServiceWorker.setProxy() from blink to +// the embedder, to talk to the ServiceWorker object from embedder. +class WebServiceWorkerProxy { +public: + WebServiceWorkerProxy() : m_private(0) { } + virtual ~WebServiceWorkerProxy() { } + + // Returns true if the proxy is ready to be notified of service worker state + // changes. It may not be if it's waiting for the registration promise to + // resolve, while the browser side has registered and is proceeding to + // install and activate the worker. + virtual bool isReady() = 0; + + // Notifies the proxy that the service worker state changed. The new state + // should be accessible via WebServiceWorker.state(). + virtual void dispatchStateChangeEvent() = 0; + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebServiceWorkerProxy(WebCore::ServiceWorker*); + BLINK_PLATFORM_EXPORT WebCore::ServiceWorker* unwrap() const; +#endif + +protected: + WebCore::ServiceWorker* m_private; +}; + +} // namespace blink + +#endif // WebServiceWorkerProxy_h diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerRequest.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerRequest.h new file mode 100644 index 00000000000..547572619f8 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerRequest.h @@ -0,0 +1,57 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerRequest_h +#define WebServiceWorkerRequest_h + +#include "WebCommon.h" +#include "public/platform/WebPrivatePtr.h" +#include "public/platform/WebString.h" +#include "public/platform/WebURL.h" + +#if INSIDE_BLINK +#include "wtf/Forward.h" +#include "wtf/HashMap.h" +#include "wtf/text/StringHash.h" +#endif + +namespace blink { + +class WebServiceWorkerRequestPrivate; + +// Represents a request of a fetch operation. FetchEvent dispatched by the +// browser contains this. The plan is for the Cache and fetch() API to also use +// it. +class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { +public: + ~WebServiceWorkerRequest() { reset(); } + WebServiceWorkerRequest(); + WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) + { + assign(other); + return *this; + } + + void reset(); + void assign(const WebServiceWorkerRequest&); + + void setURL(const WebURL&); + WebURL url() const; + + void setMethod(const WebString&); + WebString method() const; + + void setHeader(const WebString& key, const WebString& value); + +#if INSIDE_BLINK + const HashMap<String, String>& headers() const; +#endif + +private: + WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; +}; + +} // namespace blink + +#endif // WebServiceWorkerRequest_h diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerResponse.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerResponse.h new file mode 100644 index 00000000000..30b82ad2e9a --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerResponse.h @@ -0,0 +1,69 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerResponse_h +#define WebServiceWorkerResponse_h + +#include "WebCommon.h" +#include "public/platform/WebPrivatePtr.h" +#include "public/platform/WebString.h" +#include "public/platform/WebVector.h" + +#if INSIDE_BLINK +#include "wtf/Forward.h" +#include "wtf/HashMap.h" +#include "wtf/text/StringHash.h" + +namespace WebCore { +class BlobDataHandle; +} +#endif + +namespace blink { + +class WebServiceWorkerResponsePrivate; + +// Represents a response to a fetch operation. ServiceWorker uses this to +// respond to a FetchEvent dispatched by the browser. The plan is for the Cache +// and fetch() API to also use it. +class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse { +public: + ~WebServiceWorkerResponse() { reset(); } + WebServiceWorkerResponse(); + WebServiceWorkerResponse& operator=(const WebServiceWorkerResponse& other) + { + assign(other); + return *this; + } + + void reset(); + void assign(const WebServiceWorkerResponse&); + + void setStatus(unsigned short); + unsigned short status() const; + + void setStatusText(const WebString&); + WebString statusText() const; + + void setHeader(const WebString& key, const WebString& value); + WebVector<WebString> getHeaderKeys() const; + WebString getHeader(const WebString& key) const; + + WebString blobUUID() const; + +#if INSIDE_BLINK + void setHeaders(const HashMap<String, String>&); + const HashMap<String, String>& headers() const; + + void setBlobDataHandle(PassRefPtr<WebCore::BlobDataHandle>); + PassRefPtr<WebCore::BlobDataHandle> blobDataHandle() const; +#endif + +private: + WebPrivatePtr<WebServiceWorkerResponsePrivate> m_private; +}; + +} // namespace blink + +#endif // WebServiceWorkerResponse_h diff --git a/chromium/third_party/WebKit/public/platform/WebServiceWorkerState.h b/chromium/third_party/WebKit/public/platform/WebServiceWorkerState.h new file mode 100644 index 00000000000..f94ba732e82 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebServiceWorkerState.h @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebServiceWorkerState_h +#define WebServiceWorkerState_h + +namespace blink { + +enum WebServiceWorkerState { + WebServiceWorkerStateUnknown, + WebServiceWorkerStateParsed, + WebServiceWorkerStateInstalling, + WebServiceWorkerStateInstalled, + WebServiceWorkerStateActivating, + WebServiceWorkerStateActive, + WebServiceWorkerStateDeactivated, + WebServiceWorkerStateLast = WebServiceWorkerStateDeactivated +}; + +} // namespace blink + +#endif // WebServiceWorkerState_h diff --git a/chromium/third_party/WebKit/public/platform/WebSocketHandle.h b/chromium/third_party/WebKit/public/platform/WebSocketHandle.h index f721891ace4..c5c3a4c4485 100644 --- a/chromium/third_party/WebKit/public/platform/WebSocketHandle.h +++ b/chromium/third_party/WebKit/public/platform/WebSocketHandle.h @@ -31,11 +31,12 @@ #ifndef WebSocketHandle_h #define WebSocketHandle_h -#include "WebCommon.h" -#include "WebVector.h" +#include "public/platform/WebCommon.h" +#include "public/platform/WebVector.h" namespace blink { +class WebSerializedOrigin; class WebSocketHandleClient; class WebString; class WebURL; @@ -58,7 +59,7 @@ public: virtual ~WebSocketHandle() { } - virtual void connect(const WebURL& /* url */, const WebVector<WebString>& protocols, const WebString& origin, WebSocketHandleClient*) = 0; + virtual void connect(const WebURL& /* url */, const WebVector<WebString>& protocols, const WebSerializedOrigin& /* origin */, WebSocketHandleClient*) = 0; virtual void send(bool fin, MessageType, const char* data, size_t /* size */) = 0; virtual void flowControl(int64_t quota) = 0; virtual void close(unsigned short code, const WebString& reason) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebSocketHandleClient.h b/chromium/third_party/WebKit/public/platform/WebSocketHandleClient.h index 3a776903843..3fec1376a76 100644 --- a/chromium/third_party/WebKit/public/platform/WebSocketHandleClient.h +++ b/chromium/third_party/WebKit/public/platform/WebSocketHandleClient.h @@ -72,6 +72,10 @@ public: virtual void didClose(WebSocketHandle* /* handle */, bool wasClean, unsigned short code, const WebString& reason) = 0; virtual void didReceiveFlowControl(WebSocketHandle*, int64_t quota) = 0; + + // Called when the browser receives a Close frame from the remote + // server. Not called when the renderer initiates the closing handshake. + virtual void didStartClosingHandshake(WebSocketHandle*) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebSocketHandshakeRequestInfo.h b/chromium/third_party/WebKit/public/platform/WebSocketHandshakeRequestInfo.h index 89bc4fee887..3a9e88f9ee8 100644 --- a/chromium/third_party/WebKit/public/platform/WebSocketHandshakeRequestInfo.h +++ b/chromium/third_party/WebKit/public/platform/WebSocketHandshakeRequestInfo.h @@ -51,6 +51,7 @@ public: BLINK_PLATFORM_EXPORT void setURL(const WebURL&); BLINK_PLATFORM_EXPORT void addHeaderField(const WebString& name, const WebString& value); + BLINK_PLATFORM_EXPORT void setHeadersText(const WebString&); #if INSIDE_BLINK BLINK_PLATFORM_EXPORT const WebCore::WebSocketHandshakeRequest& toCoreRequest() const { return *m_private.get(); } diff --git a/chromium/third_party/WebKit/public/platform/WebSocketHandshakeResponseInfo.h b/chromium/third_party/WebKit/public/platform/WebSocketHandshakeResponseInfo.h index aacb7b23219..ed783fccdf7 100644 --- a/chromium/third_party/WebKit/public/platform/WebSocketHandshakeResponseInfo.h +++ b/chromium/third_party/WebKit/public/platform/WebSocketHandshakeResponseInfo.h @@ -51,6 +51,7 @@ public: BLINK_PLATFORM_EXPORT void setStatusCode(int); BLINK_PLATFORM_EXPORT void setStatusText(const WebString&); BLINK_PLATFORM_EXPORT void addHeaderField(const WebString& name, const WebString& value); + BLINK_PLATFORM_EXPORT void setHeadersText(const WebString&); #if INSIDE_BLINK BLINK_PLATFORM_EXPORT const WebCore::WebSocketHandshakeResponse& toCoreResponse() const { return *m_private.get(); } diff --git a/chromium/third_party/WebKit/public/platform/WebSourceBuffer.h b/chromium/third_party/WebKit/public/platform/WebSourceBuffer.h index 6eceac62d12..1f34a0c52ab 100644 --- a/chromium/third_party/WebKit/public/platform/WebSourceBuffer.h +++ b/chromium/third_party/WebKit/public/platform/WebSourceBuffer.h @@ -37,10 +37,19 @@ namespace blink { class WebSourceBuffer { public: - virtual ~WebSourceBuffer() { } + enum AppendMode { + AppendModeSegments, + AppendModeSequence + }; + virtual ~WebSourceBuffer() { } + virtual bool setMode(AppendMode) = 0; virtual WebTimeRanges buffered() = 0; - virtual void append(const unsigned char* data, unsigned length) = 0; + + // Appends data and runs the segment parser loop algorithm. + // The algorithm may update |*timestampOffset| if |timestampOffset| is not null. + virtual void append(const unsigned char* data, unsigned length, double* timestampOffset) = 0; + virtual void abort() = 0; virtual void remove(double start, double end) = 0; virtual bool setTimestampOffset(double) = 0; diff --git a/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h b/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h index 5126e46a3a8..b72022a6b61 100644 --- a/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h +++ b/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h @@ -62,9 +62,8 @@ public: BLINK_PLATFORM_EXPORT double startTime() const; // In seconds. #if INSIDE_BLINK - BLINK_PLATFORM_EXPORT WebSpeechSynthesisUtterance(const PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>&); + BLINK_PLATFORM_EXPORT WebSpeechSynthesisUtterance(WebCore::PlatformSpeechSynthesisUtterance*); BLINK_PLATFORM_EXPORT WebSpeechSynthesisUtterance& operator=(WebCore::PlatformSpeechSynthesisUtterance*); - BLINK_PLATFORM_EXPORT operator PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>() const; BLINK_PLATFORM_EXPORT operator WebCore::PlatformSpeechSynthesisUtterance*() const; #endif diff --git a/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h b/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h index 62e9556bbea..3654ee1c388 100644 --- a/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h +++ b/chromium/third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h @@ -58,7 +58,7 @@ public: BLINK_PLATFORM_EXPORT void setIsDefault(bool); #if INSIDE_BLINK - BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>() const; + BLINK_PLATFORM_EXPORT operator WebCore::PlatformSpeechSynthesisVoice*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/platform/WebStorageArea.h b/chromium/third_party/WebKit/public/platform/WebStorageArea.h index f83c3c35c49..486909e5a49 100644 --- a/chromium/third_party/WebKit/public/platform/WebStorageArea.h +++ b/chromium/third_party/WebKit/public/platform/WebStorageArea.h @@ -44,7 +44,8 @@ public: enum Result { ResultOK = 0, - ResultBlockedByQuota + ResultBlockedByQuota, + ResultLast = ResultBlockedByQuota }; // The number of key/value pairs in the storage area. diff --git a/chromium/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h b/chromium/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h index 41a9a33af9c..21175d87da7 100644 --- a/chromium/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h +++ b/chromium/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h @@ -31,23 +31,49 @@ #ifndef WebStorageQuotaCallbacks_h #define WebStorageQuotaCallbacks_h +#include "WebCommon.h" +#include "WebPrivatePtr.h" #include "WebStorageQuotaError.h" +namespace WebCore { +class StorageQuotaCallbacks; +} + +namespace WTF { template <typename T> class PassOwnPtr; } + namespace blink { +class WebStorageQuotaCallbacksPrivate; + class WebStorageQuotaCallbacks { public: + ~WebStorageQuotaCallbacks() { reset(); } + WebStorageQuotaCallbacks() { } + WebStorageQuotaCallbacks(const WebStorageQuotaCallbacks& c) { assign(c); } + WebStorageQuotaCallbacks& operator=(const WebStorageQuotaCallbacks& c) + { + assign(c); + return *this; + } + + BLINK_PLATFORM_EXPORT void reset(); + BLINK_PLATFORM_EXPORT void assign(const WebStorageQuotaCallbacks&); + +#if INSIDE_BLINK + BLINK_PLATFORM_EXPORT WebStorageQuotaCallbacks(const WTF::PassOwnPtr<WebCore::StorageQuotaCallbacks>&); +#endif + // Callback for WebFrameClient::queryStorageUsageAndQuota. - virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) = 0; + BLINK_PLATFORM_EXPORT void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes); // Callback for WebFrameClient::requestStorageQuota. // This may return a smaller amount of quota than the requested. - virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes) = 0; + BLINK_PLATFORM_EXPORT void didGrantStorageQuota(unsigned long long usageInBytes, unsigned long long grantedQuotaInBytes); - virtual void didFail(WebStorageQuotaError) = 0; + BLINK_PLATFORM_EXPORT void didFail(WebStorageQuotaError); -protected: - virtual ~WebStorageQuotaCallbacks() { } +private: + WebPrivatePtr<WebStorageQuotaCallbacksPrivate> m_private; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/default/WebThemeEngine.h b/chromium/third_party/WebKit/public/platform/WebThemeEngine.h index 4333baecc20..aa3fe1c6683 100644 --- a/chromium/third_party/WebKit/public/platform/default/WebThemeEngine.h +++ b/chromium/third_party/WebKit/public/platform/WebThemeEngine.h @@ -31,16 +31,59 @@ #ifndef WebThemeEngine_h #define WebThemeEngine_h -#include "../WebCanvas.h" -#include "../WebColor.h" -#include "../WebSize.h" +#include "WebCanvas.h" +#include "WebColor.h" +#include "WebSize.h" namespace blink { struct WebRect; +// FIXME: crbug.com/327471. We need to merge the Apple and non-Apple implementations. + class WebThemeEngine { public: + // The current state of the associated Part. + enum State { + StateDisabled, + StateHover, // non-Apple + StateNormal, // non-Apple + StatePressed, + StateFocused, // non-Apple + StateReadonly, // non-Apple + StateInactive, // Apple-specific + StateActive, // Apple-specific + }; + + // FIXME: The next section describes stuff only used on the Apple port. + enum Size { + SizeRegular, + SizeSmall, + }; + + enum ScrollbarOrientation { + ScrollbarOrientationHorizontal, + ScrollbarOrientationVertical, + }; + + enum ScrollbarParent { + ScrollbarParentScrollView, + ScrollbarParentRenderLayer, + }; + + struct ScrollbarInfo { + ScrollbarOrientation orientation; + ScrollbarParent parent; + int maxValue; + int currentValue; + int visibleSize; + int totalSize; + }; + + virtual void paintScrollbarThumb(WebCanvas*, State, Size, const WebRect&, const ScrollbarInfo&) { } + + // FIXME: The remaining definitions are only used on the non-Apple ports. + // The UI part which is being accessed. enum Part { // ScrollbarTheme parts @@ -52,6 +95,7 @@ public: PartScrollbarVerticalThumb, PartScrollbarHorizontalTrack, PartScrollbarVerticalTrack, + PartScrollbarCorner, // RenderTheme parts PartCheckbox, @@ -65,15 +109,6 @@ public: PartProgressBar }; - // The current state of the associated Part. - enum State { - StateDisabled, - StateHover, - StateNormal, - StatePressed, - StateFocused, - StateReadonly, - }; // Extra parameters for drawing the PartScrollbarHorizontalTrack and // PartScrollbarVerticalTrack. diff --git a/chromium/third_party/WebKit/public/platform/WebThreadedDataReceiver.h b/chromium/third_party/WebKit/public/platform/WebThreadedDataReceiver.h new file mode 100644 index 00000000000..df78e9cdc28 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebThreadedDataReceiver.h @@ -0,0 +1,22 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebThreadedDataReceiver_h +#define WebThreadedDataReceiver_h + +namespace blink { + +class WebThread; + +class WebThreadedDataReceiver { +public: + virtual void acceptData(const char* data, int dataLength) = 0; + virtual WebThread* backgroundThread() = 0; + + virtual ~WebThreadedDataReceiver() { } +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/platform/WebTimeRange.h b/chromium/third_party/WebKit/public/platform/WebTimeRange.h index 0d5cb1ff71c..a37d5b7e97b 100644 --- a/chromium/third_party/WebKit/public/platform/WebTimeRange.h +++ b/chromium/third_party/WebKit/public/platform/WebTimeRange.h @@ -37,10 +37,10 @@ namespace blink { struct WebTimeRange { WebTimeRange() : start(0), end(0) { } - WebTimeRange(float s, float e) : start(s), end(e) { } + WebTimeRange(double s, double e) : start(s), end(e) { } - float start; - float end; + double start; + double end; }; typedef WebVector<WebTimeRange> WebTimeRanges; diff --git a/chromium/third_party/WebKit/public/platform/WebURL.h b/chromium/third_party/WebKit/public/platform/WebURL.h index 29c49125e9a..63c5a357c5a 100644 --- a/chromium/third_party/WebKit/public/platform/WebURL.h +++ b/chromium/third_party/WebKit/public/platform/WebURL.h @@ -81,7 +81,7 @@ public: return m_string; } - const url_parse::Parsed& parsed() const + const url::Parsed& parsed() const { return m_parsed; } @@ -129,7 +129,7 @@ public: private: WebString m_string; - url_parse::Parsed m_parsed; + url::Parsed m_parsed; bool m_isValid; }; diff --git a/chromium/third_party/WebKit/public/platform/WebURLError.h b/chromium/third_party/WebKit/public/platform/WebURLError.h index 14553d0288b..cdd0b6abb0e 100644 --- a/chromium/third_party/WebKit/public/platform/WebURLError.h +++ b/chromium/third_party/WebKit/public/platform/WebURLError.h @@ -52,6 +52,10 @@ struct WebURLError { // embedder (see for example WebFrameClient). int reason; + // A flag showing whether or not "unreachableURL" has a copy in the + // cache that was too stale to return for this request. + bool staleCopyInCache; + // A flag showing whether this error should be treated as a cancellation, // e.g. we do not show console errors for cancellations. bool isCancellation; @@ -62,7 +66,7 @@ struct WebURLError { // A description for the error. WebString localizedDescription; - WebURLError() : reason(0), isCancellation(false) { } + WebURLError() : reason(0), staleCopyInCache(false), isCancellation(false) { } #if INSIDE_BLINK BLINK_PLATFORM_EXPORT WebURLError(const WebCore::ResourceError&); diff --git a/chromium/third_party/WebKit/public/platform/WebURLLoader.h b/chromium/third_party/WebKit/public/platform/WebURLLoader.h index e183a321040..eada222a357 100644 --- a/chromium/third_party/WebKit/public/platform/WebURLLoader.h +++ b/chromium/third_party/WebKit/public/platform/WebURLLoader.h @@ -37,6 +37,7 @@ namespace blink { class WebData; +class WebThreadedDataReceiver; class WebURLLoaderClient; class WebURLResponse; struct WebURLError; @@ -69,6 +70,14 @@ public: // its previous value. For example, a preload request starts with low // priority, but may increase when the resource is needed for rendering. virtual void didChangePriority(WebURLRequest::Priority newPriority) { } + virtual void didChangePriority(WebURLRequest::Priority newPriority, int intraPriorityValue) { didChangePriority(newPriority); } + + // Try to attach the given data receiver which from this point will receive data + // on its thread (provided by WebThreadedDataReceiver::backgroundThread(), + // rather than the WebURLLoaderClient. If successful, ownership + // of the data receiver is assumed by the WebURLLoader and the receiver should + // be deleted on the main thread when no longer needed. + virtual bool attachThreadedDataReceiver(WebThreadedDataReceiver*) { return false; } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/platform/WebURLLoaderClient.h b/chromium/third_party/WebKit/public/platform/WebURLLoaderClient.h index 6e28fb762b8..e3171b372c0 100644 --- a/chromium/third_party/WebKit/public/platform/WebURLLoaderClient.h +++ b/chromium/third_party/WebKit/public/platform/WebURLLoaderClient.h @@ -64,11 +64,15 @@ public: virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { } // Called when the load completes successfully. - virtual void didFinishLoading(WebURLLoader*, double finishTime) { } + // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. + virtual void didFinishLoading(WebURLLoader* loader, double finishTime, int64_t totalEncodedDataLength) { } // Called when the load completes with an error. virtual void didFail(WebURLLoader*, const WebURLError&) { } + // Value passed to didFinishLoading when total encoded data length isn't known. + static const int64_t kUnknownEncodedDataLength = -1; + protected: virtual ~WebURLLoaderClient() { } }; diff --git a/chromium/third_party/WebKit/public/platform/WebURLRequest.h b/chromium/third_party/WebKit/public/platform/WebURLRequest.h index a83c5418152..7d9e4dcda03 100644 --- a/chromium/third_party/WebKit/public/platform/WebURLRequest.h +++ b/chromium/third_party/WebKit/public/platform/WebURLRequest.h @@ -33,6 +33,7 @@ #include "WebCommon.h" #include "WebHTTPBody.h" +#include "WebReferrerPolicy.h" #if INSIDE_BLINK namespace WebCore { class ResourceRequest; } @@ -54,6 +55,7 @@ public: ReloadIgnoringCacheData, // reload ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale data ReturnCacheDataDontLoad, // results of a post - allow stale data and only use cache + ReloadBypassingCache, // end-to-end reload }; enum Priority { @@ -120,9 +122,6 @@ public: BLINK_PLATFORM_EXPORT WebURL firstPartyForCookies() const; BLINK_PLATFORM_EXPORT void setFirstPartyForCookies(const WebURL&); - BLINK_PLATFORM_EXPORT bool allowCookies() const; - BLINK_PLATFORM_EXPORT void setAllowCookies(bool); - // Controls whether user name, password, and cookies may be sent with the // request. (If false, this overrides allowCookies.) BLINK_PLATFORM_EXPORT bool allowStoredCredentials() const; @@ -135,7 +134,9 @@ public: BLINK_PLATFORM_EXPORT void setHTTPMethod(const WebString&); BLINK_PLATFORM_EXPORT WebString httpHeaderField(const WebString& name) const; + // It's not possible to set the referrer header using this method. Use setHTTPReferrer instead. BLINK_PLATFORM_EXPORT void setHTTPHeaderField(const WebString& name, const WebString& value); + BLINK_PLATFORM_EXPORT void setHTTPReferrer(const WebString& referrer, WebReferrerPolicy); BLINK_PLATFORM_EXPORT void addHTTPHeaderField(const WebString& name, const WebString& value); BLINK_PLATFORM_EXPORT void clearHTTPHeaderField(const WebString& name); BLINK_PLATFORM_EXPORT void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const; @@ -148,10 +149,6 @@ public: BLINK_PLATFORM_EXPORT bool reportUploadProgress() const; BLINK_PLATFORM_EXPORT void setReportUploadProgress(bool); - // Controls whether load timing info is collected for the request. - BLINK_PLATFORM_EXPORT bool reportLoadTiming() const; - BLINK_PLATFORM_EXPORT void setReportLoadTiming(bool); - // Controls whether actual headers sent and received for request are // collected and reported. BLINK_PLATFORM_EXPORT bool reportRawHeaders() const; @@ -160,6 +157,8 @@ public: BLINK_PLATFORM_EXPORT TargetType targetType() const; BLINK_PLATFORM_EXPORT void setTargetType(TargetType); + BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; + // True if the request was user initiated. BLINK_PLATFORM_EXPORT bool hasUserGesture() const; BLINK_PLATFORM_EXPORT void setHasUserGesture(bool); @@ -193,6 +192,7 @@ public: BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); BLINK_PLATFORM_EXPORT Priority priority() const; + BLINK_PLATFORM_EXPORT void setPriority(Priority); #if INSIDE_BLINK BLINK_PLATFORM_EXPORT WebCore::ResourceRequest& toMutableResourceRequest(); diff --git a/chromium/third_party/WebKit/public/platform/WebUnitTestSupport.h b/chromium/third_party/WebKit/public/platform/WebUnitTestSupport.h index 185b4e35104..a7380d14078 100644 --- a/chromium/third_party/WebKit/public/platform/WebUnitTestSupport.h +++ b/chromium/third_party/WebKit/public/platform/WebUnitTestSupport.h @@ -61,13 +61,10 @@ public: virtual WebData readFromFile(const WebString& path) { return WebData(); } - // DEPRECATED, use the version above. -#define HAVE_CREATELAYERTREEVIEWFORTESTING 1 + // FIXME(danakj): Remove this. enum TestViewType { TestViewTypeUnitTest, - TestViewTypeLayoutTest }; - virtual WebLayerTreeView* createLayerTreeViewForTesting(TestViewType) { return 0; } }; } diff --git a/chromium/third_party/WebKit/public/platform/WebVector.h b/chromium/third_party/WebKit/public/platform/WebVector.h index a12ca6dca19..e83a2d0d2cd 100644 --- a/chromium/third_party/WebKit/public/platform/WebVector.h +++ b/chromium/third_party/WebKit/public/platform/WebVector.h @@ -34,6 +34,8 @@ #include "WebCommon.h" #include <algorithm> +#include <limits> +#include <stdlib.h> namespace blink { @@ -153,6 +155,7 @@ public: private: void initialize(size_t size) { + validateSize(size); m_size = size; if (!m_size) m_ptr = 0; @@ -166,6 +169,7 @@ private: template <typename U> void initializeFrom(const U* values, size_t size) { + validateSize(size); m_size = size; if (!m_size) m_ptr = 0; @@ -176,6 +180,12 @@ private: } } + void validateSize(size_t size) + { + if (std::numeric_limits<size_t>::max() / sizeof(T) < size) + abort(); + } + void destroy() { for (size_t i = 0; i < m_size; ++i) diff --git a/chromium/third_party/WebKit/public/platform/WebWaitableEvent.h b/chromium/third_party/WebKit/public/platform/WebWaitableEvent.h new file mode 100644 index 00000000000..f1b59f0a263 --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/WebWaitableEvent.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef WebWaitableEvent_h +#define WebWaitableEvent_h + +#include "WebCommon.h" + +namespace blink { + +// Provides a thread synchronization that can be used to allow one thread to +// wait until another thread to finish some work. +class WebWaitableEvent { +public: + virtual ~WebWaitableEvent() { } + + // Waits indefinitely for the event to be signaled. + virtual void wait() = 0; + + // Puts the event in the signaled state. Causing any thread blocked on Wait + // to be woken up. The event state is reset to non-signaled after + // a waiting thread has been released. + virtual void signal() = 0; +}; + +} // namespace blink + +#endif // WebWaitableEvent_h diff --git a/chromium/third_party/WebKit/public/platform/android/DEPS b/chromium/third_party/WebKit/public/platform/android/DEPS deleted file mode 100644 index 8bb4062d536..00000000000 --- a/chromium/third_party/WebKit/public/platform/android/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -# FIXME: crbug.com/327471. Remove this file when android/WebThemeEngine.h is removed. -include_rules = [ - "+../default", -] diff --git a/chromium/third_party/WebKit/public/platform/linux/DEPS b/chromium/third_party/WebKit/public/platform/linux/DEPS new file mode 100644 index 00000000000..6a8ad02cebf --- /dev/null +++ b/chromium/third_party/WebKit/public/platform/linux/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+..", +] diff --git a/chromium/third_party/WebKit/public/platform/android/WebThemeEngine.h b/chromium/third_party/WebKit/public/platform/linux/WebFallbackFont.h index ce0d4f6ce1b..a8e4764fb58 100644 --- a/chromium/third_party/WebKit/public/platform/android/WebThemeEngine.h +++ b/chromium/third_party/WebKit/public/platform/linux/WebFallbackFont.h @@ -28,7 +28,23 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// FIXME: crbug.com/327471. Remove this header after we've updated all the -// callers to use platform/default/WebThemeEngine.h directly. +#ifndef WebFallbackFont_h +#define WebFallbackFont_h -#include "../default/WebThemeEngine.h" +#include "../WebCString.h" +#include "../WebCommon.h" + +namespace blink { + +struct WebFallbackFont { + WebCString name; + WebCString filename; + int fontconfigInterfaceId; + int ttcIndex; + bool isBold; + bool isItalic; +}; + +} // namespace blink + +#endif // WebFallbackFont_h diff --git a/chromium/third_party/WebKit/public/platform/linux/WebFontInfo.h b/chromium/third_party/WebKit/public/platform/linux/WebFontInfo.h index e2db6e35ff2..1e26aa1ba9d 100644 --- a/chromium/third_party/WebKit/public/platform/linux/WebFontInfo.h +++ b/chromium/third_party/WebKit/public/platform/linux/WebFontInfo.h @@ -32,6 +32,7 @@ #define WebFontInfo_h #include "../WebCString.h" +#include "WebFallbackFont.h" #include "WebFontFamily.h" #include "WebFontRenderStyle.h" @@ -55,7 +56,7 @@ public: // // Returns: the font family or an empty string if the request could not be satisfied. // Returns: the font family instance. The instance has an empty font name if the request could not be satisfied. - BLINK_EXPORT static void familyForChar(const WebUChar32 character, const char* preferredLocale, WebFontFamily*); + BLINK_EXPORT static void fallbackFontForChar(const WebUChar32 character, const char* preferredLocale, WebFallbackFont*); // Fill out the given WebFontRenderStyle with the user's preferences for // rendering the given font at the given size (in pixels). diff --git a/chromium/third_party/WebKit/public/platform/linux/WebSandboxSupport.h b/chromium/third_party/WebKit/public/platform/linux/WebSandboxSupport.h index d0ae30c21dd..089f7514a90 100644 --- a/chromium/third_party/WebKit/public/platform/linux/WebSandboxSupport.h +++ b/chromium/third_party/WebKit/public/platform/linux/WebSandboxSupport.h @@ -33,6 +33,7 @@ #include "../WebCommon.h" #include "../WebString.h" +#include "WebFallbackFont.h" #include "WebFontFamily.h" namespace blink { @@ -44,15 +45,14 @@ struct WebFontRenderStyle; // https://code.google.com/p/chromium/wiki/LinuxSandboxIPC class WebSandboxSupport { public: - // Get a font family which contains glyphs for the given Unicode code-point. + // Get information to instantiate a font which contains glyphs for the given Unicode code-point. // character: a UTF-32 codepoint // preferredLocale: preferred locale identifier for the |characters| // (e.g. "en", "ja", "zh-CN") // - // Returns a string with the font family on an empty string if the - // request cannot be satisfied. - // Returns a WebFontFamily instance with the font name. The instance has empty font name if the request cannot be satisfied. - virtual void getFontFamilyForCharacter(WebUChar32, const char* preferredLocale, WebFontFamily*) = 0; + // Returns a WebFallbackFont instance with the font name and filename. + // The instance has empty font name if the request cannot be satisfied. + virtual void getFallbackFontForCharacter(WebUChar32, const char* preferredLocale, WebFallbackFont*) = 0; virtual void getRenderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle*) = 0; }; diff --git a/chromium/third_party/WebKit/public/platform/win/WebThemeEngine.h b/chromium/third_party/WebKit/public/platform/win/WebThemeEngine.h deleted file mode 100644 index 4ac74954c52..00000000000 --- a/chromium/third_party/WebKit/public/platform/win/WebThemeEngine.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -#ifndef WebThemeEngine_h -#define WebThemeEngine_h - -#include "../WebCanvas.h" -#include "../WebColor.h" -#include "../WebSize.h" - -namespace blink { - -struct WebRect; -struct WebSize; - -class WebThemeEngine { -public: -// The part and state parameters correspond to values defined by the -// Windows Theme API (see -// http://msdn.microsoft.com/en-us/library/bb773187(VS.85).aspx ). -// The classicState parameter corresponds to the uState -// parameter of the Windows DrawFrameControl() function. -// See the definitions in <vsstyle.h> and <winuser.h>. - virtual void paintButton( - WebCanvas*, int part, int state, int classicState, - const WebRect&) = 0; - - virtual void paintMenuList( - WebCanvas*, int part, int state, int classicState, - const WebRect&) = 0; - - virtual void paintScrollbarArrow( - WebCanvas*, int state, int classicState, - const WebRect&) = 0; - - virtual void paintScrollbarThumb( - WebCanvas*, int part, int state, int classicState, - const WebRect&) = 0; - - virtual void paintScrollbarTrack( - WebCanvas*, int part, int state, int classicState, - const WebRect&, const WebRect& alignRect) = 0; - - virtual void paintSpinButton( - WebCanvas*, int part, int state, int classicState, - const WebRect&) { } - - virtual void paintTextField( - WebCanvas*, int part, int state, int classicState, - const WebRect&, WebColor, bool fillContentArea, bool drawEdges) = 0; - - virtual void paintTrackbar( - WebCanvas*, int part, int state, int classicState, - const WebRect&) = 0; - - virtual void paintProgressBar( - WebCanvas*, const WebRect& barRect, const WebRect& valueRect, - bool determinate, double animatedSeconds) { } - - virtual WebSize getSize(int part) = 0; -}; - -} // namespace blink - -#endif diff --git a/chromium/third_party/WebKit/public/testing/WebFrameTestProxy.h b/chromium/third_party/WebKit/public/testing/WebFrameTestProxy.h deleted file mode 100644 index 426bbe2c293..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebFrameTestProxy.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef WebFrameTestProxy_h -#define WebFrameTestProxy_h - -#include "WebTestProxy.h" -#include "public/platform/WebNonCopyable.h" - -namespace WebTestRunner { - -// Templetized wrapper around RenderFrameImpl objects, which implement -// the WebFrameClient interface. -template<class Base, typename P, typename R> -class WebFrameTestProxy : public Base, public blink::WebNonCopyable { -public: - WebFrameTestProxy(P p, R r) - : Base(p, r) - , m_baseProxy(0) - , m_version(0) { } - - virtual ~WebFrameTestProxy() { } - - void setBaseProxy(WebTestProxyBase* proxy) - { - m_baseProxy = proxy; - } - - void setVersion(int version) - { - m_version = version; - } - - blink::WebPlugin* createPlugin(blink::WebFrame* frame, const blink::WebPluginParams& params) - { - blink::WebPlugin* plugin = m_baseProxy->createPlugin(frame, params); - if (plugin) - return plugin; - return Base::createPlugin(frame, params); - } - - // WebFrameClient implementation. - virtual void didStartProvisionalLoad(blink::WebFrame* frame) - { - if (m_version > 2) - m_baseProxy->didStartProvisionalLoad(frame); - Base::didStartProvisionalLoad(frame); - } - virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* frame) - { - Base::didReceiveServerRedirectForProvisionalLoad(frame); - } - virtual void didFailProvisionalLoad(blink::WebFrame* frame, const blink::WebURLError& error) - { - Base::didFailProvisionalLoad(frame, error); - } - virtual void didCommitProvisionalLoad(blink::WebFrame* frame, bool isNewNavigation) - { - Base::didCommitProvisionalLoad(frame, isNewNavigation); - } - virtual void didReceiveTitle(blink::WebFrame* frame, const blink::WebString& title, blink::WebTextDirection direction) - { - Base::didReceiveTitle(frame, title, direction); - } - virtual void didChangeIcon(blink::WebFrame* frame, blink::WebIconURL::Type iconType) - { - Base::didChangeIcon(frame, iconType); - } - virtual void didFinishDocumentLoad(blink::WebFrame* frame) - { - Base::didFinishDocumentLoad(frame); - } - virtual void didHandleOnloadEvents(blink::WebFrame* frame) - { - Base::didHandleOnloadEvents(frame); - } - virtual void didFailLoad(blink::WebFrame* frame, const blink::WebURLError& error) - { - Base::didFailLoad(frame, error); - } - virtual void didFinishLoad(blink::WebFrame* frame) - { - Base::didFinishLoad(frame); - } - virtual void didDetectXSS(blink::WebFrame* frame, const blink::WebURL& insecureURL, bool didBlockEntirePage) - { - // This is not implemented in RenderFrameImpl, so need to explicitly call - // into the base proxy. - m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); - Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); - } - virtual void didDispatchPingLoader(blink::WebFrame* frame, const blink::WebURL& url) - { - // This is not implemented in RenderFrameImpl, so need to explicitly call - // into the base proxy. - m_baseProxy->didDispatchPingLoader(frame, url); - Base::didDispatchPingLoader(frame, url); - } - virtual void willRequestResource(blink::WebFrame* frame, const blink::WebCachedURLRequest& request) - { - // This is not implemented in RenderFrameImpl, so need to explicitly call - // into the base proxy. - m_baseProxy->willRequestResource(frame, request); - Base::willRequestResource(frame, request); - } - virtual void didCreateDataSource(blink::WebFrame* frame, blink::WebDataSource* ds) - { - Base::didCreateDataSource(frame, ds); - } - virtual void willSendRequest(blink::WebFrame* frame, unsigned identifier, blink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse) - { - m_baseProxy->willSendRequest(frame, identifier, request, redirectResponse); - Base::willSendRequest(frame, identifier, request, redirectResponse); - } - virtual void didReceiveResponse(blink::WebFrame* frame, unsigned identifier, const blink::WebURLResponse& response) - { - m_baseProxy->didReceiveResponse(frame, identifier, response); - Base::didReceiveResponse(frame, identifier, response); - } - virtual void didChangeResourcePriority(blink::WebFrame* frame, unsigned identifier, const blink::WebURLRequest::Priority& priority) - { - // This is not implemented in RenderFrameImpl, so need to explicitly call - // into the base proxy. - m_baseProxy->didChangeResourcePriority(frame, identifier, priority); - Base::didChangeResourcePriority(frame, identifier, priority); - } - virtual void didFinishResourceLoad(blink::WebFrame* frame, unsigned identifier) - { - Base::didFinishResourceLoad(frame, identifier); - } - virtual blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame* frame, blink::WebDataSource::ExtraData* extraData, const blink::WebURLRequest& request, blink::WebNavigationType type, blink::WebNavigationPolicy defaultPolicy, bool isRedirect) - { - return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); - } - virtual bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMessageEvent event) - { - if (m_baseProxy->willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event)) - return true; - return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event); - } - -private: - WebTestProxyBase* m_baseProxy; - - // This is used to incrementally change code between Blink and Chromium. - // It is used instead of a #define and is set by layouttest_support when - // creating this object. - int m_version; -}; - -} - -#endif // WebTestProxy_h diff --git a/chromium/third_party/WebKit/public/testing/WebPreferences.h b/chromium/third_party/WebKit/public/testing/WebPreferences.h deleted file mode 100644 index 95536a901e3..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebPreferences.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -#ifndef WebPreferences_h -#define WebPreferences_h - -#include "WebTestCommon.h" -#include "public/platform/WebString.h" -#include "public/platform/WebURL.h" -#include "public/web/WebSettings.h" - -namespace blink { -class WebView; -} - -namespace WebTestRunner { - -struct WEBTESTRUNNER_EXPORT WebPreferences { - int defaultFontSize; - int minimumFontSize; - bool DOMPasteAllowed; - bool XSSAuditorEnabled; - bool allowDisplayOfInsecureContent; - bool allowFileAccessFromFileURLs; - bool allowRunningOfInsecureContent; - bool authorAndUserStylesEnabled; - blink::WebString defaultTextEncodingName; - bool experimentalWebGLEnabled; - bool experimentalCSSRegionsEnabled; - bool experimentalCSSGridLayoutEnabled; - bool javaEnabled; - bool javaScriptCanAccessClipboard; - bool javaScriptCanOpenWindowsAutomatically; - bool supportsMultipleWindows; - bool javaScriptEnabled; - bool loadsImagesAutomatically; - bool offlineWebApplicationCacheEnabled; - bool pluginsEnabled; - bool allowUniversalAccessFromFileURLs; - blink::WebSettings::EditingBehavior editingBehavior; - bool tabsToLinks; - bool hyperlinkAuditingEnabled; - bool caretBrowsingEnabled; - bool cssCustomFilterEnabled; - bool shouldRespectImageOrientation; - bool asynchronousSpellCheckingEnabled; - - WebPreferences() { reset(); } - void reset(); -}; - -} - -#endif // WebPreferences_h diff --git a/chromium/third_party/WebKit/public/testing/WebScopedPtr.h b/chromium/third_party/WebKit/public/testing/WebScopedPtr.h deleted file mode 100644 index 884ff77fa5c..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebScopedPtr.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef WebScopedPtr_h -#define WebScopedPtr_h - -#include <stddef.h> - -namespace WebTestRunner { - -template<typename Deallocator, typename T> -class WebScopedPtrBase { -public: - // Default constructor. Constructs an empty scoped pointer. - inline WebScopedPtrBase() : m_ptr(0) { } - - // Constructs a scoped pointer from a plain one. - explicit inline WebScopedPtrBase(T* ptr) : m_ptr(ptr) { } - - // Copy constructor removes the pointer from the original to avoid double - // freeing. - inline WebScopedPtrBase(const WebScopedPtrBase<Deallocator, T>& rhs) - : m_ptr(rhs.m_ptr) - { - const_cast<WebScopedPtrBase<Deallocator, T>&>(rhs).m_ptr = 0; - } - - // When the destructor of the scoped pointer is executed the plain pointer - // is deleted using DeleteArray. This implies that you must allocate with - // NewArray. - inline ~WebScopedPtrBase() - { - if (m_ptr) - Deallocator::Delete(m_ptr); - } - - inline T* operator->() const { return m_ptr; } - - // You can get the underlying pointer out with the * operator. - inline T* operator*() { return m_ptr; } - - // You can use [n] to index as if it was a plain pointer. - inline T& operator[](size_t i) - { - return m_ptr[i]; - } - - // You can use [n] to index as if it was a plain pointer. - const inline T& operator[](size_t i) const - { - return m_ptr[i]; - } - - // We don't have implicit conversion to a T* since that hinders migration: - // You would not be able to change a method from returning a T* to - // returning an WebScopedArrayPtr<T> and then get errors wherever it is used. - inline T* get() const { return m_ptr; } - - inline void reset(T* newValue = 0) - { - if (m_ptr) - Deallocator::Delete(m_ptr); - m_ptr = newValue; - } - - // Assignment requires an empty (0) WebScopedArrayPtr as the receiver. Like - // the copy constructor it removes the pointer in the original to avoid - // double freeing. - inline WebScopedPtrBase<Deallocator, T>& operator=(const WebScopedPtrBase<Deallocator, T>& rhs) - { - reset(rhs.m_ptr); - const_cast<WebScopedPtrBase<Deallocator, T>&>(rhs).m_ptr = 0; - return *this; - } - - inline bool isEmpty() { return !m_ptr; } - -private: - T* m_ptr; -}; - -// A 'scoped array pointer' that calls DeleteArray on its pointer when the -// destructor is called. -template<typename T> -struct ArrayDeallocator { - static void Delete(T* array) - { - DeleteArray(array); - } -}; - -template<typename T> -class WebScopedArrayPtr: public WebScopedPtrBase<ArrayDeallocator<T>, T> { -public: - inline WebScopedArrayPtr() { } - explicit inline WebScopedArrayPtr(T* ptr) - : WebScopedPtrBase<ArrayDeallocator<T>, T>(ptr) { } - inline WebScopedArrayPtr(const WebScopedArrayPtr<T>& rhs) - : WebScopedPtrBase<ArrayDeallocator<T>, T>(rhs) { } -}; - -template<typename T> -struct ObjectDeallocator { - static void Delete(T* object) - { - delete object; - } -}; - -template<typename T> -class WebScopedPtr: public WebScopedPtrBase<ObjectDeallocator<T>, T> { -public: - inline WebScopedPtr() { } - explicit inline WebScopedPtr(T* ptr) - : WebScopedPtrBase<ObjectDeallocator<T>, T>(ptr) { } - inline WebScopedPtr(const WebScopedPtr<T>& rhs) - : WebScopedPtrBase<ObjectDeallocator<T>, T>(rhs) { } -}; - -} // namespace WebTestRunner - -#endif // WebScopedPtr_h diff --git a/chromium/third_party/WebKit/public/testing/WebTask.h b/chromium/third_party/WebKit/public/testing/WebTask.h deleted file mode 100644 index c3bc09cc1ce..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebTask.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -#ifndef WebTask_h -#define WebTask_h - -#include "WebTestCommon.h" -#include <vector> - -namespace WebTestRunner { - -class WebTaskList; - -// WebTask represents a task which can run by WebTestDelegate::postTask() or -// WebTestDelegate::postDelayedTask(). -class WEBTESTRUNNER_EXPORT WebTask { -public: - explicit WebTask(WebTaskList*); - virtual ~WebTask(); - - // The main code of this task. - // An implementation of run() should return immediately if cancel() was called. - virtual void run() = 0; - virtual void cancel() = 0; - -protected: - WebTaskList* m_taskList; -}; - -class WEBTESTRUNNER_EXPORT WebTaskList { -public: - WebTaskList(); - ~WebTaskList(); - void registerTask(WebTask*); - void unregisterTask(WebTask*); - void revokeAll(); - -private: - std::vector<WebTask*> m_tasks; -}; - -// A task containing an object pointer of class T. Derived classes should -// override runIfValid() which in turn can safely invoke methods on the -// m_object. The Class T must have "WebTaskList* taskList()". -template<class T> -class WebMethodTask : public WebTask { -public: - explicit WebMethodTask(T* object) - : WebTask(object->taskList()) - , m_object(object) - { - } - - virtual ~WebMethodTask() { } - - virtual void run() - { - if (m_object) - runIfValid(); - } - - virtual void cancel() - { - m_object = 0; - m_taskList->unregisterTask(this); - m_taskList = 0; - } - - virtual void runIfValid() = 0; - -protected: - T* m_object; -}; - -} - -#endif // WebTask_h diff --git a/chromium/third_party/WebKit/public/testing/WebTestCommon.h b/chromium/third_party/WebKit/public/testing/WebTestCommon.h deleted file mode 100644 index a3442c6a93d..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebTestCommon.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef WebTestCommon_h -#define WebTestCommon_h - -// ----------------------------------------------------------------------------- -// Default configuration - -#if !defined(WEBTESTRUNNER_IMPLEMENTATION) -#define WEBTESTRUNNER_IMPLEMENTATION 0 -#endif - -// ----------------------------------------------------------------------------- -// Exported symbols need to be annotated with WEBTESTRUNNER_EXPORT - -#if defined(WEBTESTRUNNER_DLL) - -#if defined(WIN32) -#if WEBTESTRUNNER_IMPLEMENTATION -#define WEBTESTRUNNER_EXPORT __declspec(dllexport) -#else -#define WEBTESTRUNNER_EXPORT __declspec(dllimport) -#endif - -#else // defined(WIN32) - -#if WEBTESTRUNNER_IMPLEMENTATION -#define WEBTESTRUNNER_EXPORT __attribute__((visibility("default"))) -#else -#define WEBTESTRUNNER_EXPORT -#endif - -#endif - -#else // defined(WEBTESTRUNNER_DLL) - -#define WEBTESTRUNNER_EXPORT - -#endif - -#endif // WebTestCommon_h diff --git a/chromium/third_party/WebKit/public/testing/WebTestDelegate.h b/chromium/third_party/WebKit/public/testing/WebTestDelegate.h deleted file mode 100644 index 4ee6eb592b5..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebTestDelegate.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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. - */ - -#ifndef WebTestDelegate_h -#define WebTestDelegate_h - -#include "public/platform/WebString.h" -#include "public/platform/WebURL.h" -#include "public/platform/WebVector.h" -#include <string> - -#define WEBTESTRUNNER_NEW_HISTORY_CAPTURE - -namespace blink { -class WebDeviceMotionData; -class WebDeviceOrientationData; -class WebFrame; -class WebGamepads; -class WebHistoryItem; -struct WebRect; -struct WebSize; -struct WebURLError; -} - -namespace WebTestRunner { - -struct WebPreferences; -class WebTask; -class WebTestProxyBase; - -class WebTestDelegate { -public: - // Set and clear the edit command to execute on the next call to - // WebViewClient::handleCurrentKeyboardEvent(). - virtual void clearEditCommand() = 0; - virtual void setEditCommand(const std::string& name, const std::string& value) = 0; - - // Set the gamepads to return from Platform::sampleGamepads(). - virtual void setGamepadData(const blink::WebGamepads&) = 0; - - // Set data to return when registering via Platform::setDeviceMotionListener(). - virtual void setDeviceMotionData(const blink::WebDeviceMotionData&) = 0; - // Set data to return when registering via Platform::setDeviceOrientationListener(). - virtual void setDeviceOrientationData(const blink::WebDeviceOrientationData&) = 0; - - // Add a message to the text dump for the layout test. - virtual void printMessage(const std::string& message) = 0; - - // The delegate takes ownership of the WebTask objects and is responsible - // for deleting them. - virtual void postTask(WebTask*) = 0; - virtual void postDelayedTask(WebTask*, long long ms) = 0; - - // Register a new isolated filesystem with the given files, and return the - // new filesystem id. - virtual blink::WebString registerIsolatedFileSystem(const blink::WebVector<blink::WebString>& absoluteFilenames) = 0; - - // Gets the current time in milliseconds since the UNIX epoch. - virtual long long getCurrentTimeInMillisecond() = 0; - - // Convert the provided relative path into an absolute path. - virtual blink::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0; - - // Reads in the given file and returns its contents as data URL. - virtual blink::WebURL localFileToDataURL(const blink::WebURL&) = 0; - - // Replaces file:///tmp/LayoutTests/ with the actual path to the - // LayoutTests directory. - virtual blink::WebURL rewriteLayoutTestsURL(const std::string& utf8URL) = 0; - - // Manages the settings to used for layout tests. - virtual WebPreferences* preferences() = 0; - virtual void applyPreferences() = 0; - - // Enables or disables synchronous resize mode. When enabled, all window-sizing machinery is - // short-circuited inside the renderer. This mode is necessary for some tests that were written - // before browsers had multi-process architecture and rely on window resizes to happen synchronously. - // The function has "unfortunate" it its name because we must strive to remove all tests - // that rely on this... well, unfortunate behavior. See http://crbug.com/309760 for the plan. - virtual void useUnfortunateSynchronousResizeMode(bool) = 0; - - // Controls auto resize mode. - virtual void enableAutoResizeMode(const blink::WebSize& minSize, const blink::WebSize& maxSize) = 0; - virtual void disableAutoResizeMode(const blink::WebSize&) = 0; - - // Opens and closes the inspector. - virtual void showDevTools() = 0; - virtual void closeDevTools() = 0; - - // Evaluate the given script in the DevTools agent. - virtual void evaluateInWebInspector(long callID, const std::string& script) = 0; - - // Controls WebSQL databases. - virtual void clearAllDatabases() = 0; - virtual void setDatabaseQuota(int) = 0; - - // Controls the device scale factor of the main WebView for hidpi tests. - virtual void setDeviceScaleFactor(float) = 0; - - // Controls which WebView should be focused. - virtual void setFocus(WebTestProxyBase*, bool) = 0; - - // Controls whether all cookies should be accepted or writing cookies in a - // third-party context is blocked. - virtual void setAcceptAllCookies(bool) = 0; - - // The same as rewriteLayoutTestsURL unless the resource is a path starting - // with /tmp/, then return a file URL to a temporary file. - virtual std::string pathToLocalResource(const std::string& resource) = 0; - - // Sets the POSIX locale of the current process. - virtual void setLocale(const std::string&) = 0; - - // Invoked when the test finished. - virtual void testFinished() = 0; - - // Invoked when the embedder should close all but the main WebView. - virtual void closeRemainingWindows() = 0; - - virtual void deleteAllCookies() = 0; - - // Returns the length of the back/forward history of the main WebView. - virtual int navigationEntryCount() = 0; - - // The following trigger navigations on the main WebViwe. - virtual void goToOffset(int offset) = 0; - virtual void reload() = 0; - virtual void loadURLForFrame(const blink::WebURL&, const std::string& frameName) = 0; - - // Returns true if resource requests to external URLs should be permitted. - virtual bool allowExternalPages() = 0; - - // Returns the back/forward history for the WebView associated with the - // given WebTestProxyBase as well as the index of the current entry. - virtual void captureHistoryForWindow(WebTestProxyBase*, blink::WebVector<blink::WebHistoryItem>*, size_t* currentEntryIndex) = 0; -}; - -} - -#endif // WebTestDelegate_h diff --git a/chromium/third_party/WebKit/public/testing/WebTestInterfaces.h b/chromium/third_party/WebKit/public/testing/WebTestInterfaces.h deleted file mode 100644 index 8cd06022f9a..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebTestInterfaces.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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. - */ - -#ifndef WebTestInterfaces_h -#define WebTestInterfaces_h - -#include "WebScopedPtr.h" -#include "WebTestCommon.h" - -namespace blink { -class WebAudioDevice; -class WebFrame; -class WebMediaStreamCenter; -class WebMediaStreamCenterClient; -class WebMIDIAccessor; -class WebMIDIAccessorClient; -class WebRTCPeerConnectionHandler; -class WebRTCPeerConnectionHandlerClient; -class WebThemeEngine; -class WebURL; -class WebView; -} - -namespace WebTestRunner { - -class TestInterfaces; -class WebTestDelegate; -class WebTestProxyBase; -class WebTestRunner; - -class WEBTESTRUNNER_EXPORT WebTestInterfaces { -public: - WebTestInterfaces(); - ~WebTestInterfaces(); - - void setWebView(blink::WebView*, WebTestProxyBase*); - void setDelegate(WebTestDelegate*); - void bindTo(blink::WebFrame*); - void resetAll(); - void setTestIsRunning(bool); - void configureForTestWithURL(const blink::WebURL&, bool generatePixels); - - WebTestRunner* testRunner(); - blink::WebThemeEngine* themeEngine(); - - blink::WebMediaStreamCenter* createMediaStreamCenter(blink::WebMediaStreamCenterClient*); - blink::WebRTCPeerConnectionHandler* createWebRTCPeerConnectionHandler(blink::WebRTCPeerConnectionHandlerClient*); - - blink::WebMIDIAccessor* createMIDIAccessor(blink::WebMIDIAccessorClient*); - - blink::WebAudioDevice* createAudioDevice(double sampleRate); - -#if WEBTESTRUNNER_IMPLEMENTATION - TestInterfaces* testInterfaces(); -#endif - -private: - WebScopedPtr<TestInterfaces> m_interfaces; -}; - -} - -#endif // WebTestInterfaces_h diff --git a/chromium/third_party/WebKit/public/testing/WebTestProxy.h b/chromium/third_party/WebKit/public/testing/WebTestProxy.h deleted file mode 100644 index 26cb18dfad4..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebTestProxy.h +++ /dev/null @@ -1,562 +0,0 @@ -/* - * 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. - */ - -#ifndef WebTestProxy_h -#define WebTestProxy_h - -#include "WebScopedPtr.h" -#include "WebTask.h" -#include "WebTestCommon.h" -#include "public/platform/WebNonCopyable.h" -#include "public/platform/WebRect.h" -#include "public/platform/WebURLError.h" -#include "public/platform/WebURLRequest.h" -#include "public/web/WebAXEnums.h" -#include "public/web/WebDOMMessageEvent.h" -#include "public/web/WebDataSource.h" -#include "public/web/WebDragOperation.h" -#include "public/web/WebIconURL.h" -#include "public/web/WebNavigationPolicy.h" -#include "public/web/WebNavigationType.h" -#include "public/web/WebSecurityOrigin.h" -#include "public/web/WebTextAffinity.h" -#include "public/web/WebTextDirection.h" -#include <map> -#include <string> - -namespace blink { -class WebAXObject; -class WebAudioDevice; -class WebCachedURLRequest; -class WebColorChooser; -class WebColorChooserClient; -class WebDataSource; -class WebDragData; -class WebFileChooserCompletion; -class WebFrame; -class WebGeolocationClient; -class WebGeolocationClientMock; -class WebImage; -class WebMIDIAccessor; -class WebMIDIAccessorClient; -class WebMIDIClient; -class WebMIDIClientMock; -class WebNode; -class WebNotificationPresenter; -class WebPlugin; -class WebRange; -class WebSerializedScriptValue; -class WebSpeechInputController; -class WebSpeechInputListener; -class WebSpeechRecognizer; -class WebSpellCheckClient; -class WebString; -class WebURL; -class WebURLResponse; -class WebUserMediaClient; -class WebValidationMessageClient; -class WebView; -class WebWidget; -struct WebColorSuggestion; -struct WebConsoleMessage; -struct WebContextMenuData; -struct WebFileChooserParams; -struct WebPluginParams; -struct WebPoint; -struct WebSize; -struct WebWindowFeatures; -typedef unsigned WebColor; -} - -class SkCanvas; - -namespace WebTestRunner { - -class MockWebSpeechInputController; -class MockWebSpeechRecognizer; -class MockWebValidationMessageClient; -class SpellCheckClient; -class TestInterfaces; -class WebTestDelegate; -class WebTestInterfaces; -class WebTestRunner; -class WebUserMediaClientMock; - -class WEBTESTRUNNER_EXPORT WebTestProxyBase { -public: - void setInterfaces(WebTestInterfaces*); - void setDelegate(WebTestDelegate*); - void setWidget(blink::WebWidget*); - - void reset(); - - blink::WebSpellCheckClient *spellCheckClient() const; - blink::WebValidationMessageClient* validationMessageClient(); - blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient*, const blink::WebColor&); - blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient*, const blink::WebColor&, const blink::WebVector<blink::WebColorSuggestion>& suggestions); - bool runFileChooser(const blink::WebFileChooserParams&, blink::WebFileChooserCompletion*); - - std::string captureTree(bool debugRenderTree); - SkCanvas* capturePixels(); - - void setLogConsoleOutput(bool enabled); - - // FIXME: Make this private again. - void scheduleComposite(); - - void didOpenChooser(); - void didCloseChooser(); - bool isChooserShown(); - -#if WEBTESTRUNNER_IMPLEMENTATION - void display(); - void displayInvalidatedRegion(); - void discardBackingStore(); - - blink::WebGeolocationClientMock* geolocationClientMock(); - blink::WebMIDIClientMock* midiClientMock(); - MockWebSpeechInputController* speechInputControllerMock(); - MockWebSpeechRecognizer* speechRecognizerMock(); -#endif - - WebTaskList* taskList() { return &m_taskList; } - - blink::WebView* webView(); - - void didForceResize(); - - void postSpellCheckEvent(const blink::WebString& eventName); - -protected: - WebTestProxyBase(); - ~WebTestProxyBase(); - - void didInvalidateRect(const blink::WebRect&); - void didScrollRect(int, int, const blink::WebRect&); - void scheduleAnimation(); - // FIXME: Remove once we switch to use didForceResize. - void setWindowRect(const blink::WebRect&); - void show(blink::WebNavigationPolicy); - void didAutoResize(const blink::WebSize&); - void postAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); - void startDragging(blink::WebFrame*, const blink::WebDragData&, blink::WebDragOperationsMask, const blink::WebImage&, const blink::WebPoint&); - void didChangeSelection(bool isEmptySelection); - void didChangeContents(); - void didEndEditing(); - bool createView(blink::WebFrame* creator, const blink::WebURLRequest&, const blink::WebWindowFeatures&, const blink::WebString& frameName, blink::WebNavigationPolicy, bool suppressOpener); - blink::WebPlugin* createPlugin(blink::WebFrame*, const blink::WebPluginParams&); - void setStatusText(const blink::WebString&); - void didStopLoading(); - void showContextMenu(blink::WebFrame*, const blink::WebContextMenuData&); - blink::WebUserMediaClient* userMediaClient(); - void printPage(blink::WebFrame*); - blink::WebNotificationPresenter* notificationPresenter(); - blink::WebGeolocationClient* geolocationClient(); - blink::WebMIDIClient* webMIDIClient(); - blink::WebSpeechInputController* speechInputController(blink::WebSpeechInputListener*); - blink::WebSpeechRecognizer* speechRecognizer(); - bool requestPointerLock(); - void requestPointerUnlock(); - bool isPointerLocked(); - void didFocus(); - void didBlur(); - void setToolTipText(const blink::WebString&, blink::WebTextDirection); - void didAddMessageToConsole(const blink::WebConsoleMessage&, const blink::WebString& sourceName, unsigned sourceLine); - void runModalAlertDialog(blink::WebFrame*, const blink::WebString&); - bool runModalConfirmDialog(blink::WebFrame*, const blink::WebString&); - bool runModalPromptDialog(blink::WebFrame*, const blink::WebString& message, const blink::WebString& defaultValue, blink::WebString* actualValue); - bool runModalBeforeUnloadDialog(blink::WebFrame*, const blink::WebString&); - - void didStartProvisionalLoad(blink::WebFrame*); - void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame*); - bool didFailProvisionalLoad(blink::WebFrame*, const blink::WebURLError&); - void didCommitProvisionalLoad(blink::WebFrame*, bool isNewNavigation); - void didReceiveTitle(blink::WebFrame*, const blink::WebString& title, blink::WebTextDirection); - void didChangeIcon(blink::WebFrame*, blink::WebIconURL::Type); - void didFinishDocumentLoad(blink::WebFrame*); - void didHandleOnloadEvents(blink::WebFrame*); - void didFailLoad(blink::WebFrame*, const blink::WebURLError&); - void didFinishLoad(blink::WebFrame*); - void didChangeLocationWithinPage(blink::WebFrame*); - void didDetectXSS(blink::WebFrame*, const blink::WebURL& insecureURL, bool didBlockEntirePage); - void didDispatchPingLoader(blink::WebFrame*, const blink::WebURL&); - void willRequestResource(blink::WebFrame*, const blink::WebCachedURLRequest&); - void didCreateDataSource(blink::WebFrame*, blink::WebDataSource*); - void willSendRequest(blink::WebFrame*, unsigned identifier, blink::WebURLRequest&, const blink::WebURLResponse& redirectResponse); - void didReceiveResponse(blink::WebFrame*, unsigned identifier, const blink::WebURLResponse&); - void didChangeResourcePriority(blink::WebFrame*, unsigned identifier, const blink::WebURLRequest::Priority&); - void didFinishResourceLoad(blink::WebFrame*, unsigned identifier); - blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame*, blink::WebDataSource::ExtraData*, const blink::WebURLRequest&, blink::WebNavigationType, blink::WebNavigationPolicy defaultPolicy, bool isRedirect); - bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMessageEvent); - void resetInputMethod(); - -private: - template<class, typename, typename> friend class WebFrameTestProxy; - void locationChangeDone(blink::WebFrame*); - void paintRect(const blink::WebRect&); - void paintInvalidatedRegion(); - void paintPagesWithBoundaries(); - SkCanvas* canvas(); - void displayRepaintMask(); - void invalidateAll(); - void animateNow(); - - blink::WebWidget* webWidget(); - - TestInterfaces* m_testInterfaces; - WebTestDelegate* m_delegate; - blink::WebWidget* m_webWidget; - - WebTaskList m_taskList; - - WebScopedPtr<SpellCheckClient> m_spellcheck; - WebScopedPtr<WebUserMediaClientMock> m_userMediaClient; - - // Painting. - WebScopedPtr<SkCanvas> m_canvas; - blink::WebRect m_paintRect; - bool m_isPainting; - bool m_animateScheduled; - std::map<unsigned, std::string> m_resourceIdentifierMap; - std::map<unsigned, blink::WebURLRequest> m_requestMap; - - bool m_logConsoleOutput; - int m_chooserCount; - - WebScopedPtr<blink::WebGeolocationClientMock> m_geolocationClient; - WebScopedPtr<blink::WebMIDIClientMock> m_midiClient; - WebScopedPtr<MockWebSpeechRecognizer> m_speechRecognizer; - WebScopedPtr<MockWebSpeechInputController> m_speechInputController; - WebScopedPtr<MockWebValidationMessageClient> m_validationMessageClient; - - // FIXME:: We want to move away from this pattern and mark classes - // as Noncopyable, but this class is marked as WEBTESTRUNNER_EXPORT - // while WebNonCopyable is not, so we cannot inherit from WebNonCopyable. - // To overcome the problem, for now not inheriting from WebNonCopyable - // but plan to fix it when we make the change of making WebNonCopyable - // a macro rather than class. We will have a single way to mark all classes - // as Noncopyable. - // Tracked under: http://code.google.com/p/chromium/issues/detail?id=229178 -private: - WebTestProxyBase(WebTestProxyBase&); - WebTestProxyBase& operator=(const WebTestProxyBase&); -}; - -// Use this template to inject methods into your WebViewClient/WebFrameClient -// implementation required for the running layout tests. -template<class Base, typename T> -class WebTestProxy : public Base, public WebTestProxyBase, public blink::WebNonCopyable { -public: - explicit WebTestProxy(T t) - : Base(t) - { - } - - virtual ~WebTestProxy() { } - - // WebViewClient implementation. - virtual void didInvalidateRect(const blink::WebRect& rect) - { - WebTestProxyBase::didInvalidateRect(rect); - } - virtual void didScrollRect(int dx, int dy, const blink::WebRect& clipRect) - { - WebTestProxyBase::didScrollRect(dx, dy, clipRect); - } - virtual void scheduleComposite() - { - WebTestProxyBase::scheduleComposite(); - } - virtual void scheduleAnimation() - { - WebTestProxyBase::scheduleAnimation(); - } - virtual void setWindowRect(const blink::WebRect& rect) - { - WebTestProxyBase::setWindowRect(rect); - Base::setWindowRect(rect); - } - virtual void show(blink::WebNavigationPolicy policy) - { - WebTestProxyBase::show(policy); - Base::show(policy); - } - virtual void didAutoResize(const blink::WebSize& newSize) - { - WebTestProxyBase::didAutoResize(newSize); - Base::didAutoResize(newSize); - } - virtual void postAccessibilityEvent(const blink::WebAXObject& object, blink::WebAXEvent event) - { - WebTestProxyBase::postAccessibilityEvent(object, event); - Base::postAccessibilityEvent(object, event); - } - virtual void startDragging(blink::WebFrame* frame, const blink::WebDragData& data, blink::WebDragOperationsMask mask, const blink::WebImage& image, const blink::WebPoint& point) - { - WebTestProxyBase::startDragging(frame, data, mask, image, point); - // Don't forward this call to Base because we don't want to do a real drag-and-drop. - } - virtual void didChangeSelection(bool isEmptySelection) - { - WebTestProxyBase::didChangeSelection(isEmptySelection); - Base::didChangeSelection(isEmptySelection); - } - virtual void didChangeContents() - { - WebTestProxyBase::didChangeContents(); - Base::didChangeContents(); - } - virtual blink::WebView* createView(blink::WebFrame* creator, const blink::WebURLRequest& request, const blink::WebWindowFeatures& features, const blink::WebString& frameName, blink::WebNavigationPolicy policy, bool suppressOpener) - { - if (!WebTestProxyBase::createView(creator, request, features, frameName, policy, suppressOpener)) - return 0; - return Base::createView(creator, request, features, frameName, policy, suppressOpener); - } - virtual void setStatusText(const blink::WebString& text) - { - WebTestProxyBase::setStatusText(text); - Base::setStatusText(text); - } - virtual void didStopLoading() - { - WebTestProxyBase::didStopLoading(); - Base::didStopLoading(); - } - virtual void showContextMenu(blink::WebFrame* frame, const blink::WebContextMenuData& contextMenuData) - { - WebTestProxyBase::showContextMenu(frame, contextMenuData); - Base::showContextMenu(frame, contextMenuData); - } - virtual blink::WebUserMediaClient* userMediaClient() - { - return WebTestProxyBase::userMediaClient(); - } - virtual void printPage(blink::WebFrame* frame) - { - WebTestProxyBase::printPage(frame); - } - virtual blink::WebNotificationPresenter* notificationPresenter() - { - return WebTestProxyBase::notificationPresenter(); - } - virtual blink::WebGeolocationClient* geolocationClient() - { - return WebTestProxyBase::geolocationClient(); - } - virtual blink::WebMIDIClient* webMIDIClient() - { - return WebTestProxyBase::webMIDIClient(); - } - virtual blink::WebSpeechInputController* speechInputController(blink::WebSpeechInputListener* listener) - { - return WebTestProxyBase::speechInputController(listener); - } - virtual blink::WebSpeechRecognizer* speechRecognizer() - { - return WebTestProxyBase::speechRecognizer(); - } - virtual bool requestPointerLock() - { - return WebTestProxyBase::requestPointerLock(); - } - virtual void requestPointerUnlock() - { - WebTestProxyBase::requestPointerUnlock(); - } - virtual bool isPointerLocked() - { - return WebTestProxyBase::isPointerLocked(); - } - virtual void didFocus() - { - WebTestProxyBase::didFocus(); - Base::didFocus(); - } - virtual void didBlur() - { - WebTestProxyBase::didBlur(); - Base::didBlur(); - } - virtual void setToolTipText(const blink::WebString& text, blink::WebTextDirection hint) - { - WebTestProxyBase::setToolTipText(text, hint); - Base::setToolTipText(text, hint); - } - virtual void resetInputMethod() - { - WebTestProxyBase::resetInputMethod(); - } - - virtual void didStartProvisionalLoad(blink::WebFrame* frame) - { - WebTestProxyBase::didStartProvisionalLoad(frame); - Base::didStartProvisionalLoad(frame); - } - virtual void didReceiveServerRedirectForProvisionalLoad(blink::WebFrame* frame) - { - WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(frame); - Base::didReceiveServerRedirectForProvisionalLoad(frame); - } - virtual void didFailProvisionalLoad(blink::WebFrame* frame, const blink::WebURLError& error) - { - // If the test finished, don't notify the embedder of the failed load, - // as we already destroyed the document loader. - if (WebTestProxyBase::didFailProvisionalLoad(frame, error)) - return; - Base::didFailProvisionalLoad(frame, error); - } - virtual void didCommitProvisionalLoad(blink::WebFrame* frame, bool isNewNavigation) - { - WebTestProxyBase::didCommitProvisionalLoad(frame, isNewNavigation); - Base::didCommitProvisionalLoad(frame, isNewNavigation); - } - virtual void didReceiveTitle(blink::WebFrame* frame, const blink::WebString& title, blink::WebTextDirection direction) - { - WebTestProxyBase::didReceiveTitle(frame, title, direction); - Base::didReceiveTitle(frame, title, direction); - } - virtual void didChangeIcon(blink::WebFrame* frame, blink::WebIconURL::Type iconType) - { - WebTestProxyBase::didChangeIcon(frame, iconType); - Base::didChangeIcon(frame, iconType); - } - virtual void didFinishDocumentLoad(blink::WebFrame* frame) - { - WebTestProxyBase::didFinishDocumentLoad(frame); - Base::didFinishDocumentLoad(frame); - } - virtual void didHandleOnloadEvents(blink::WebFrame* frame) - { - WebTestProxyBase::didHandleOnloadEvents(frame); - Base::didHandleOnloadEvents(frame); - } - virtual void didFailLoad(blink::WebFrame* frame, const blink::WebURLError& error) - { - WebTestProxyBase::didFailLoad(frame, error); - Base::didFailLoad(frame, error); - } - virtual void didFinishLoad(blink::WebFrame* frame) - { - WebTestProxyBase::didFinishLoad(frame); - Base::didFinishLoad(frame); - } - virtual void didDetectXSS(blink::WebFrame* frame, const blink::WebURL& insecureURL, bool didBlockEntirePage) - { - WebTestProxyBase::didDetectXSS(frame, insecureURL, didBlockEntirePage); - Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); - } - virtual void willRequestResource(blink::WebFrame* frame, const blink::WebCachedURLRequest& request) - { - WebTestProxyBase::willRequestResource(frame, request); - Base::willRequestResource(frame, request); - } - virtual void didCreateDataSource(blink::WebFrame* frame, blink::WebDataSource* ds) - { - WebTestProxyBase::didCreateDataSource(frame, ds); - Base::didCreateDataSource(frame, ds); - } - virtual void willSendRequest(blink::WebFrame* frame, unsigned identifier, blink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse) - { - WebTestProxyBase::willSendRequest(frame, identifier, request, redirectResponse); - Base::willSendRequest(frame, identifier, request, redirectResponse); - } - virtual void didReceiveResponse(blink::WebFrame* frame, unsigned identifier, const blink::WebURLResponse& response) - { - WebTestProxyBase::didReceiveResponse(frame, identifier, response); - Base::didReceiveResponse(frame, identifier, response); - } - virtual void didChangeResourcePriority(blink::WebFrame* frame, unsigned identifier, const blink::WebURLRequest::Priority& priority) - { - WebTestProxyBase::didChangeResourcePriority(frame, identifier, priority); - Base::didChangeResourcePriority(frame, identifier, priority); - } - virtual void didFinishResourceLoad(blink::WebFrame* frame, unsigned identifier) - { - WebTestProxyBase::didFinishResourceLoad(frame, identifier); - Base::didFinishResourceLoad(frame, identifier); - } - virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, const blink::WebString& sourceName, unsigned sourceLine, const blink::WebString& stackTrace) - { - WebTestProxyBase::didAddMessageToConsole(message, sourceName, sourceLine); - Base::didAddMessageToConsole(message, sourceName, sourceLine, stackTrace); - } - virtual void runModalAlertDialog(blink::WebFrame* frame, const blink::WebString& message) - { - WebTestProxyBase::runModalAlertDialog(frame, message); - Base::runModalAlertDialog(frame, message); - } - virtual bool runModalConfirmDialog(blink::WebFrame* frame, const blink::WebString& message) - { - WebTestProxyBase::runModalConfirmDialog(frame, message); - return Base::runModalConfirmDialog(frame, message); - } - virtual bool runModalPromptDialog(blink::WebFrame* frame, const blink::WebString& message, const blink::WebString& defaultValue, blink::WebString* actualValue) - { - WebTestProxyBase::runModalPromptDialog(frame, message, defaultValue, actualValue); - return Base::runModalPromptDialog(frame, message, defaultValue, actualValue); - } - virtual bool runModalBeforeUnloadDialog(blink::WebFrame* frame, const blink::WebString& message) - { - return WebTestProxyBase::runModalBeforeUnloadDialog(frame, message); - } - virtual blink::WebNavigationPolicy decidePolicyForNavigation(blink::WebFrame* frame, blink::WebDataSource::ExtraData* extraData, const blink::WebURLRequest& request, blink::WebNavigationType type, blink::WebNavigationPolicy defaultPolicy, bool isRedirect) - { - blink::WebNavigationPolicy policy = WebTestProxyBase::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); - if (policy == blink::WebNavigationPolicyIgnore) - return policy; - return Base::decidePolicyForNavigation(frame, extraData, request, type, defaultPolicy, isRedirect); - } - virtual bool willCheckAndDispatchMessageEvent(blink::WebFrame* sourceFrame, blink::WebFrame* targetFrame, blink::WebSecurityOrigin target, blink::WebDOMMessageEvent event) - { - if (WebTestProxyBase::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event)) - return true; - return Base::willCheckAndDispatchMessageEvent(sourceFrame, targetFrame, target, event); - } - virtual blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient* client, const blink::WebColor& color) - { - return WebTestProxyBase::createColorChooser(client, color); - } - virtual blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient* client, const blink::WebColor& color, const blink::WebVector<blink::WebColorSuggestion>& suggestions) - { - return WebTestProxyBase::createColorChooser(client, color, suggestions); - } - virtual bool runFileChooser(const blink::WebFileChooserParams& params, blink::WebFileChooserCompletion* completion) - { - return WebTestProxyBase::runFileChooser(params, completion); - } - virtual void postSpellCheckEvent(const blink::WebString& eventName) - { - WebTestProxyBase::postSpellCheckEvent(eventName); - } -}; - -} - -#endif // WebTestProxy_h diff --git a/chromium/third_party/WebKit/public/testing/WebTestRunner.h b/chromium/third_party/WebKit/public/testing/WebTestRunner.h deleted file mode 100644 index 017c689be95..00000000000 --- a/chromium/third_party/WebKit/public/testing/WebTestRunner.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -#ifndef WebTestRunner_h -#define WebTestRunner_h - -namespace blink { -class WebArrayBufferView; -class WebPermissionClient; -} - -namespace WebTestRunner { - -class WebTestRunner { -public: - // Returns a mock WebPermissionClient that is used for layout tests. An - // embedder should use this for all WebViews it creates. - virtual blink::WebPermissionClient* webPermissions() const = 0; - - // After WebTestDelegate::testFinished was invoked, the following methods - // can be used to determine what kind of dump the main WebTestProxy can - // provide. - - // If true, WebTestDelegate::audioData returns an audio dump and no text - // or pixel results are available. - virtual bool shouldDumpAsAudio() const = 0; - virtual const blink::WebArrayBufferView* audioData() const = 0; - - // Returns true if the call to WebTestProxy::captureTree will invoke - // WebTestDelegate::captureHistoryForWindow. - virtual bool shouldDumpBackForwardList() const = 0; - - // Returns true if WebTestProxy::capturePixels should be invoked after - // capturing text results. - virtual bool shouldGeneratePixelResults() = 0; -}; - -} - -#endif // WebTestRunner_h diff --git a/chromium/third_party/WebKit/public/web/DEPS b/chromium/third_party/WebKit/public/web/DEPS new file mode 100644 index 00000000000..a06a7c3f37b --- /dev/null +++ b/chromium/third_party/WebKit/public/web/DEPS @@ -0,0 +1,7 @@ +include_rules = [ + "+../platform", + "+core", + + # For subdirectories. + "+../../platform", +] diff --git a/chromium/third_party/WebKit/public/web/OWNERS b/chromium/third_party/WebKit/public/web/OWNERS new file mode 100644 index 00000000000..a56fa87dcfe --- /dev/null +++ b/chromium/third_party/WebKit/public/web/OWNERS @@ -0,0 +1,2 @@ +per-file WebAXEnums.h=dmazzoni@chromium.org +per-file WebAXEnums.h=aboxhall@chromium.org diff --git a/chromium/third_party/WebKit/public/web/WebAXEnums.h b/chromium/third_party/WebKit/public/web/WebAXEnums.h index 2989a8cd073..e8880d9630e 100644 --- a/chromium/third_party/WebKit/public/web/WebAXEnums.h +++ b/chromium/third_party/WebKit/public/web/WebAXEnums.h @@ -56,6 +56,7 @@ enum WebAXEvent { WebAXEventRowCollapsed, WebAXEventRowCountChanged, WebAXEventRowExpanded, + WebAXEventScrollPositionChanged, WebAXEventScrolledToAnchor, WebAXEventSelectedChildrenChanged, WebAXEventSelectedTextChanged, @@ -98,6 +99,7 @@ enum WebAXRole { WebAXRoleDocument, WebAXRoleDrawer, WebAXRoleEditableText, + WebAXRoleEmbeddedObject, WebAXRoleFooter, WebAXRoleForm, WebAXRoleGrid, @@ -106,6 +108,7 @@ enum WebAXRole { WebAXRoleHeading, WebAXRoleHelpTag, WebAXRoleHorizontalRule, + WebAXRoleIframe, WebAXRoleIgnored, WebAXRoleImageMapLink, WebAXRoleImageMap, diff --git a/chromium/third_party/WebKit/public/web/WebAXObject.h b/chromium/third_party/WebKit/public/web/WebAXObject.h index e9335c686ca..c5990347fb5 100644 --- a/chromium/third_party/WebKit/public/web/WebAXObject.h +++ b/chromium/third_party/WebKit/public/web/WebAXObject.h @@ -76,19 +76,19 @@ public: BLINK_EXPORT static void enableAccessibility(); BLINK_EXPORT static bool accessibilityEnabled(); - BLINK_EXPORT void startCachingComputedObjectAttributesUntilTreeMutates(); - BLINK_EXPORT void stopCachingComputedObjectAttributes(); - // Temporary: this flag will only be toggleable until Chromium has it on by default. BLINK_EXPORT static void enableInlineTextBoxAccessibility(); BLINK_EXPORT int axID() const; - // Update the underlying tree, and return true if this object is + // Update layout on the underlying tree, and return true if this object is // still valid (not detached). Note that calling this method // can cause other WebAXObjects to become invalid, too, // so always call isDetached if updateBackingStoreAndCheckValidity // has been called on any object, or if any other WebCore code has run. + BLINK_EXPORT bool updateLayoutAndCheckValidity(); + + // FIXME: Deprecated - remove once callers use updateLayoutAndCheckValidity, instead. BLINK_EXPORT bool updateBackingStoreAndCheckValidity(); BLINK_EXPORT WebString accessibilityDescription() const; @@ -123,11 +123,17 @@ public: BLINK_EXPORT bool isVisited() const; BLINK_EXPORT WebString accessKey() const; + BLINK_EXPORT WebAXObject ariaActiveDescendant() const; + BLINK_EXPORT bool ariaControls(WebVector<WebAXObject>& controlsElements) const; + BLINK_EXPORT bool ariaDescribedby(WebVector<WebAXObject>& describedbyElements) const; + BLINK_EXPORT bool ariaFlowTo(WebVector<WebAXObject>& flowToElements) const; BLINK_EXPORT bool ariaHasPopup() const; + BLINK_EXPORT bool ariaLabelledby(WebVector<WebAXObject>& labelledbyElements) const; BLINK_EXPORT bool ariaLiveRegionAtomic() const; BLINK_EXPORT bool ariaLiveRegionBusy() const; BLINK_EXPORT WebString ariaLiveRegionRelevant() const; BLINK_EXPORT WebString ariaLiveRegionStatus() const; + BLINK_EXPORT bool ariaOwns(WebVector<WebAXObject>& ownsElements) const; BLINK_EXPORT WebRect boundingBoxRect() const; BLINK_EXPORT bool canvasHasFallbackContent() const; BLINK_EXPORT WebPoint clickPoint() const; diff --git a/chromium/third_party/WebKit/public/web/WebActiveWheelFlingParameters.h b/chromium/third_party/WebKit/public/web/WebActiveWheelFlingParameters.h index 82a09a38a40..2a125b9a675 100644 --- a/chromium/third_party/WebKit/public/web/WebActiveWheelFlingParameters.h +++ b/chromium/third_party/WebKit/public/web/WebActiveWheelFlingParameters.h @@ -28,6 +28,7 @@ #include "../platform/WebCommon.h" #include "../platform/WebFloatPoint.h" +#include "../platform/WebGestureDevice.h" #include "../platform/WebPoint.h" #include "../platform/WebSize.h" #include "WebInputEvent.h" @@ -39,13 +40,13 @@ struct WebActiveWheelFlingParameters { WebPoint point; WebPoint globalPoint; int modifiers; - WebGestureEvent::SourceDevice sourceDevice; + WebGestureDevice sourceDevice; WebSize cumulativeScroll; double startTime; WebActiveWheelFlingParameters() : modifiers(0) - , sourceDevice(WebGestureEvent::Touchpad) + , sourceDevice(WebGestureDeviceTouchpad) , startTime(0) { } diff --git a/chromium/third_party/WebKit/public/web/WebCrossOriginPreflightResultCache.h b/chromium/third_party/WebKit/public/web/WebArrayBufferConverter.h index b4902683d2e..1b8eea6aa57 100644 --- a/chromium/third_party/WebKit/public/web/WebCrossOriginPreflightResultCache.h +++ b/chromium/third_party/WebKit/public/web/WebArrayBufferConverter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2014 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 @@ -28,23 +28,26 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebCrossOriginPreflightResultCache_h -#define WebCrossOriginPreflightResultCache_h +#ifndef WebArrayBufferConverter_h +#define WebArrayBufferConverter_h -#include "../platform/WebCommon.h" +#include "public/platform/WebArrayBuffer.h" + +namespace v8 { +class Isolate; +class Object; +class Value; +template <class T> class Handle; +} namespace blink { -// An interface to configure WebKit's cross-origin preflight result cache. -class WebCrossOriginPreflightResultCache { +class WebArrayBufferConverter { public: - // Clears the cache. - BLINK_EXPORT static void clear(); - -private: - WebCrossOriginPreflightResultCache(); // Not intended to be instanced. + BLINK_EXPORT static v8::Handle<v8::Value> toV8Value(WebArrayBuffer*, v8::Handle<v8::Object>, v8::Isolate*); + BLINK_EXPORT static WebArrayBuffer* createFromV8Value(v8::Handle<v8::Value>, v8::Isolate*); }; } // namespace blink -#endif +#endif // WebArrayBufferConverter_h diff --git a/chromium/third_party/WebKit/public/web/WebAutofillClient.h b/chromium/third_party/WebKit/public/web/WebAutofillClient.h index 9e63a01b30f..7fef5f0ad72 100644 --- a/chromium/third_party/WebKit/public/web/WebAutofillClient.h +++ b/chromium/third_party/WebKit/public/web/WebAutofillClient.h @@ -33,66 +33,27 @@ namespace blink { +class WebFormControlElement; class WebFormElement; -class WebFrame; class WebInputElement; class WebKeyboardEvent; class WebNode; -class WebString; template <typename T> class WebVector; class WebAutofillClient { public: - enum { - MenuItemIDAutocompleteEntry = 0, - MenuItemIDWarningMessage = -1, - MenuItemIDPasswordEntry = -2, - MenuItemIDSeparator = -3, - MenuItemIDClearForm = -4, - MenuItemIDAutofillOptions = -5, - MenuItemIDDataListEntry = -6 - }; - - // Informs the browser that the user has accepted an Autofill suggestion for - // a WebNode. A positive |itemID| is a unique id used to identify the set - // of Autofill profiles. If it is AutocompleteEntryMenuItemID, then the - // suggestion is an Autocomplete suggestion; and |value| stores the - // suggested text. |index| is an index of the selected suggestion in the - // list of suggestions provided by the client. - virtual void didAcceptAutofillSuggestion(const WebNode&, - const WebString& value, - const WebString& label, - int itemID, - unsigned index) { } - - // Informs the browser that the user has selected an Autofill suggestion for - // a WebNode. This happens when the user hovers over a suggestion or uses - // the arrow keys to navigate to a suggestion. - virtual void didSelectAutofillSuggestion(const WebNode&, - const WebString& name, - const WebString& label, - int itemID) { } - - // Informs the browser that the user has cleared the selection from the - // Autofill suggestions popup. This happens when a user uses the arrow - // keys to navigate outside the range of possible selections. - virtual void didClearAutofillSelection(const WebNode&) { } - // Informs the browser an interactive autocomplete has been requested. - virtual void didRequestAutocomplete(WebFrame*, const WebFormElement&) { } - - // Instructs the browser to remove the Autocomplete entry specified from - // its DB. - virtual void removeAutocompleteSuggestion(const WebString& name, - const WebString& value) { } + virtual void didRequestAutocomplete(const WebFormElement&) { } // These methods are called when the users edits a text-field. virtual void textFieldDidEndEditing(const WebInputElement&) { } - virtual void textFieldDidChange(const WebInputElement&) { } + virtual void textFieldDidChange(const WebFormControlElement&) { } virtual void textFieldDidReceiveKeyDown(const WebInputElement&, const WebKeyboardEvent&) { } // This is called when a datalist indicator is clicked. virtual void openTextDataListChooser(const WebInputElement&) { } + // Called the first time the user interacts with the page after a load. + virtual void firstUserGestureObserved() { } // Informs the client whether or not any subsequent text changes should be ignored. virtual void setIgnoreTextChanges(bool ignore) { } diff --git a/chromium/third_party/WebKit/public/web/WebBindings.h b/chromium/third_party/WebKit/public/web/WebBindings.h index a83120a5282..494e73610d2 100644 --- a/chromium/third_party/WebKit/public/web/WebBindings.h +++ b/chromium/third_party/WebKit/public/web/WebBindings.h @@ -135,6 +135,11 @@ public: // _NPN_UnregisterObject BLINK_EXPORT static void unregisterObject(NPObject*); + // Unlike unregisterObject, only drops the V8 wrapper object, + // not touching the NPObject itself, except for decrementing + // its references counter. + BLINK_EXPORT static void dropV8WrapperForObject(NPObject*); + // NPN_UTF8FromIdentifier BLINK_EXPORT static NPUTF8* utf8FromIdentifier(NPIdentifier); diff --git a/chromium/third_party/WebKit/public/web/WebBlob.h b/chromium/third_party/WebKit/public/web/WebBlob.h index 07d39844f80..3d0d829c98b 100644 --- a/chromium/third_party/WebKit/public/web/WebBlob.h +++ b/chromium/third_party/WebKit/public/web/WebBlob.h @@ -37,7 +37,13 @@ #include "public/platform/WebString.h" #include "public/platform/WebURL.h" +#if BLINK_IMPLEMENTATION +#include "platform/heap/Handle.h" +#endif + namespace v8 { +class Isolate; +class Object; class Value; template <class T> class Handle; } @@ -58,6 +64,7 @@ public: return *this; } + BLINK_EXPORT static WebBlob createFromUUID(const WebString& uuid, const WebString& type, long long size); BLINK_EXPORT static WebBlob createFromFile(const WebString& path, long long size); BLINK_EXPORT static WebBlob fromV8Value(v8::Handle<v8::Value>); @@ -67,12 +74,11 @@ public: bool isNull() const { return m_private.isNull(); } - BLINK_EXPORT v8::Handle<v8::Value> toV8Value(); + BLINK_EXPORT v8::Handle<v8::Value> toV8Value(v8::Handle<v8::Object> creationContext, v8::Isolate*); #if BLINK_IMPLEMENTATION - WebBlob(const WTF::PassRefPtr<WebCore::Blob>&); - WebBlob& operator=(const WTF::PassRefPtr<WebCore::Blob>&); - operator WTF::PassRefPtr<WebCore::Blob>() const; + explicit WebBlob(const PassRefPtrWillBeRawPtr<WebCore::Blob>&); + WebBlob& operator=(const PassRefPtrWillBeRawPtr<WebCore::Blob>&); #endif protected: diff --git a/chromium/third_party/WebKit/public/web/WebCompositionUnderline.h b/chromium/third_party/WebKit/public/web/WebCompositionUnderline.h index 2c586620537..21c065ba487 100644 --- a/chromium/third_party/WebKit/public/web/WebCompositionUnderline.h +++ b/chromium/third_party/WebKit/public/web/WebCompositionUnderline.h @@ -42,18 +42,36 @@ struct WebCompositionUnderline { : startOffset(0) , endOffset(0) , color(0) - , thick(false) { } + , thick(false) + , backgroundColor(0) { } + // FIXME(huangs): remove this constructor. WebCompositionUnderline(unsigned s, unsigned e, WebColor c, bool t) : startOffset(s) , endOffset(e) , color(c) - , thick(t) { } + , thick(t) + , backgroundColor(0) { } + WebCompositionUnderline(unsigned s, unsigned e, WebColor c, bool t, WebColor bc) + : startOffset(s) + , endOffset(e) + , color(c) + , thick(t) + , backgroundColor(bc) { } + + bool operator<(const WebCompositionUnderline& other) const + { + return startOffset != other.startOffset ? startOffset < other.startOffset : endOffset < other.endOffset; + } + + // Need to update IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline) + // if members change. unsigned startOffset; unsigned endOffset; WebColor color; bool thick; + WebColor backgroundColor; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebConsoleMessage.h b/chromium/third_party/WebKit/public/web/WebConsoleMessage.h index cf6a54ecf43..616e8ebb0fd 100644 --- a/chromium/third_party/WebKit/public/web/WebConsoleMessage.h +++ b/chromium/third_party/WebKit/public/web/WebConsoleMessage.h @@ -42,6 +42,7 @@ struct WebConsoleMessage { LevelInfo = 5, LevelWarning = 2, LevelError = 3, + LevelLast = LevelInfo }; Level level; diff --git a/chromium/third_party/WebKit/public/web/WebContentSecurityPolicy.h b/chromium/third_party/WebKit/public/web/WebContentSecurityPolicy.h index f649e439818..ee2d8569fb6 100644 --- a/chromium/third_party/WebKit/public/web/WebContentSecurityPolicy.h +++ b/chromium/third_party/WebKit/public/web/WebContentSecurityPolicy.h @@ -36,6 +36,7 @@ namespace blink { enum WebContentSecurityPolicyType { WebContentSecurityPolicyTypeReport, WebContentSecurityPolicyTypeEnforce, + WebContentSecurityPolicyTypeLast = WebContentSecurityPolicyTypeEnforce }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebContextMenuData.h b/chromium/third_party/WebKit/public/web/WebContextMenuData.h index 8c8459d2f59..09cb0f4251f 100644 --- a/chromium/third_party/WebKit/public/web/WebContextMenuData.h +++ b/chromium/third_party/WebKit/public/web/WebContextMenuData.h @@ -55,10 +55,13 @@ struct WebContextMenuData { MediaTypeVideo, // An audio node is selected. MediaTypeAudio, + // A canvas node is selected. + MediaTypeCanvas, // A file node is selected. MediaTypeFile, // A plugin node is selected. MediaTypePlugin, + MediaTypeLast = MediaTypePlugin }; // The type of media the context menu is being invoked on. MediaType mediaType; @@ -99,7 +102,7 @@ struct WebContextMenuData { MediaLoop = 0x8, MediaCanSave = 0x10, MediaHasAudio = 0x20, - MediaHasVideo = 0x40, + MediaCanToggleControls = 0x40, MediaControls = 0x80, MediaCanPrint = 0x100, MediaCanRotate = 0x200, @@ -111,9 +114,6 @@ struct WebContextMenuData { // The raw text of the selection in context. WebString selectedText; - // Whether speech input is enabled. - bool isSpeechInputEnabled; - // Whether spell checking is enabled. bool isSpellCheckingEnabled; @@ -172,7 +172,6 @@ struct WebContextMenuData { : mediaType(MediaTypeNone) , hasImageContents(true) , mediaFlags(MediaNone) - , isSpeechInputEnabled(false) , isSpellCheckingEnabled(false) , isEditable(false) , writingDirectionDefault(CheckableMenuItemDisabled) diff --git a/chromium/third_party/WebKit/public/platform/mac/WebThemeEngine.h b/chromium/third_party/WebKit/public/web/WebCryptoNormalize.h index 1753c2eddd9..16ad8042b94 100644 --- a/chromium/third_party/WebKit/public/platform/mac/WebThemeEngine.h +++ b/chromium/third_party/WebKit/public/web/WebCryptoNormalize.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2014 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 @@ -28,50 +28,33 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebThemeEngine_h -#define WebThemeEngine_h +#ifndef WebCryptoNormalize_h +#define WebCryptoNormalize_h -#include "../WebCanvas.h" +#include "../platform/WebCommon.h" -namespace blink { - -struct WebRect; - -class WebThemeEngine { -public: - enum State { - StateDisabled, - StateInactive, - StateActive, - StatePressed, - }; +#include "../platform/WebCryptoAlgorithm.h" - enum Size { - SizeRegular, - SizeSmall, - }; +namespace v8 { +class Isolate; +class Object; +template <class T> class Handle; +} - enum ScrollbarOrientation { - ScrollbarOrientationHorizontal, - ScrollbarOrientationVertical, - }; - - enum ScrollbarParent { - ScrollbarParentScrollView, - ScrollbarParentRenderLayer, - }; - - struct ScrollbarInfo { - ScrollbarOrientation orientation; - ScrollbarParent parent; - int maxValue; - int currentValue; - int visibleSize; - int totalSize; - }; +namespace blink { - virtual void paintScrollbarThumb(WebCanvas*, State, Size, const WebRect&, const ScrollbarInfo&) { } -}; +class WebString; + +// Converts a javascript Dictionary to a WebCryptoAlgorithm object. +// +// This corresponds with "normalizing" [1] the algorithm, and then validating +// the expected parameters for the algorithm/operation combination. +// +// On failure returns an null WebCryptoAlgorithm, sets the int to the +// ExceptionCode and the WebString to a (non-localized) debug string. +// +// [1] http://www.w3.org/TR/WebCryptoAPI/#algorithm-normalizing-rules +BLINK_EXPORT WebCryptoAlgorithm normalizeCryptoAlgorithm(v8::Handle<v8::Object>, WebCryptoOperation, int* exceptionCode, WebString* errorDetails, v8::Isolate*); } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebDOMActivityLogger.h b/chromium/third_party/WebKit/public/web/WebDOMActivityLogger.h index 9664be51107..7cc4d205c5f 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMActivityLogger.h +++ b/chromium/third_party/WebKit/public/web/WebDOMActivityLogger.h @@ -41,16 +41,23 @@ namespace blink { class WebDOMActivityLogger { public: virtual ~WebDOMActivityLogger() { } - virtual void log(const WebString& apiName, int argc, const v8::Handle<v8::Value>* argv, const WebString& extraInfo, const WebURL& url, const WebString& title) { } + + virtual void logGetter(const WebString& apiName, const WebURL& url, const WebString& title) { } + virtual void logSetter(const WebString& apiName, const v8::Handle<v8::Value>& newValue, const WebURL& url, const WebString& title) { } + virtual void logSetter(const WebString& apiName, const v8::Handle<v8::Value>& newValue, const v8::Handle<v8::Value>& oldValue, const WebURL& url, const WebString& title) { } + virtual void logMethod(const WebString& apiName, int argc, const v8::Handle<v8::Value>* argv, const WebURL& url, const WebString& title) { } }; -// Checks if a logger already exists for the world identified -// by worldId (worldId may be 0 identifying the main world). -BLINK_EXPORT bool hasDOMActivityLogger(int worldId); +// Checks if a logger already exists for the world identified by worldId and +// extensionID (worldId may be 0 identifying the main world). Extension ID is +// used only in the case of main world and ignored otherwise. +BLINK_EXPORT bool hasDOMActivityLogger(int worldId, const WebString& extensionId); -// Checks if the provided logger is non-null and if so associates it -// with the world identified by worldId (worldId may be 0 identifying the main world). -BLINK_EXPORT void setDOMActivityLogger(int worldId, WebDOMActivityLogger*); +// Checks if the provided logger is non-null and if so associates it with the +// world identified by worldId and extension ID (worldId may be 0 identifying +// the main world). The extension ID is ignored for other worlds than the main +// one. +BLINK_EXPORT void setDOMActivityLogger(int worldId, const WebString& extensionId, WebDOMActivityLogger*); } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebDOMCustomEvent.h b/chromium/third_party/WebKit/public/web/WebDOMCustomEvent.h index e6f2f671409..f8189634249 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMCustomEvent.h +++ b/chromium/third_party/WebKit/public/web/WebDOMCustomEvent.h @@ -35,7 +35,6 @@ namespace blink { -class WebFrame; class WebString; class WebDOMCustomEvent : public WebDOMEvent { diff --git a/chromium/third_party/WebKit/public/web/WebDOMError.h b/chromium/third_party/WebKit/public/web/WebDOMError.h index 4ca7733d47e..ec7e9c7d026 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMError.h +++ b/chromium/third_party/WebKit/public/web/WebDOMError.h @@ -36,6 +36,8 @@ #include "public/platform/WebString.h" namespace v8 { +class Isolate; +class Object; class Value; template <class T> class Handle; } @@ -64,12 +66,11 @@ public: BLINK_EXPORT WebString name() const; BLINK_EXPORT WebString message() const; - BLINK_EXPORT v8::Handle<v8::Value> toV8Value(); + BLINK_EXPORT v8::Handle<v8::Value> toV8Value(v8::Handle<v8::Object> creationContext, v8::Isolate*); #if BLINK_IMPLEMENTATION - WebDOMError(const WTF::PassRefPtr<WebCore::DOMError>&); - WebDOMError& operator=(const WTF::PassRefPtr<WebCore::DOMError>&); - operator WTF::PassRefPtr<WebCore::DOMError>() const; + explicit WebDOMError(const PassRefPtrWillBeRawPtr<WebCore::DOMError>&); + WebDOMError& operator=(const PassRefPtrWillBeRawPtr<WebCore::DOMError>&); #endif protected: diff --git a/chromium/third_party/WebKit/public/web/WebDOMEvent.h b/chromium/third_party/WebKit/public/web/WebDOMEvent.h index 4be814f37e6..2ee49325cea 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMEvent.h +++ b/chromium/third_party/WebKit/public/web/WebDOMEvent.h @@ -90,11 +90,10 @@ public: BLINK_EXPORT bool isPopStateEvent() const; BLINK_EXPORT bool isProgressEvent() const; BLINK_EXPORT bool isXMLHttpRequestProgressEvent() const; - BLINK_EXPORT bool isBeforeLoadEvent() const; #if BLINK_IMPLEMENTATION - WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>&); - operator WTF::PassRefPtr<WebCore::Event>() const; + WebDOMEvent(const PassRefPtrWillBeRawPtr<WebCore::Event>&); + operator PassRefPtrWillBeRawPtr<WebCore::Event>() const; #endif template<typename T> T to() @@ -112,9 +111,8 @@ public: } protected: - typedef WebCore::Event WebDOMEventPrivate; #if BLINK_IMPLEMENTATION - void assign(const WTF::PassRefPtr<WebDOMEventPrivate>&); + void assign(const PassRefPtrWillBeRawPtr<WebCore::Event>&); template<typename T> T* unwrap() { @@ -127,7 +125,7 @@ protected: } #endif - WebPrivatePtr<WebDOMEventPrivate> m_private; + WebPrivatePtr<WebCore::Event> m_private; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebDOMFileSystem.h b/chromium/third_party/WebKit/public/web/WebDOMFileSystem.h index b69d3d49467..6af71cfe00d 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMFileSystem.h +++ b/chromium/third_party/WebKit/public/web/WebDOMFileSystem.h @@ -35,8 +35,15 @@ #include "../platform/WebPrivatePtr.h" #include "../platform/WebString.h" #include "../platform/WebURL.h" +#include "WebFrame.h" + +#if BLINK_IMPLEMENTATION +#include "platform/heap/Handle.h" +#endif namespace v8 { +class Isolate; +class Object; class Value; template <class T> class Handle; } @@ -47,6 +54,15 @@ namespace blink { class WebDOMFileSystem { public: + enum SerializableType { + SerializableTypeSerializable, + SerializableTypeNotSerializable, + }; + enum EntryType { + EntryTypeFile, + EntryTypeDirectory, + }; + ~WebDOMFileSystem() { reset(); } WebDOMFileSystem() { } @@ -58,6 +74,17 @@ public: } BLINK_EXPORT static WebDOMFileSystem fromV8Value(v8::Handle<v8::Value>); + // Create file system URL from the given entry. + BLINK_EXPORT static WebURL createFileSystemURL(v8::Handle<v8::Value> entry); + + // FIXME: Deprecate the last argument when all filesystems become + // serializable. + BLINK_EXPORT static WebDOMFileSystem create( + WebLocalFrame*, + WebFileSystemType, + const WebString& name, + const WebURL& rootURL, + SerializableType = SerializableTypeNotSerializable); BLINK_EXPORT void reset(); BLINK_EXPORT void assign(const WebDOMFileSystem&); @@ -66,12 +93,17 @@ public: BLINK_EXPORT WebFileSystem::Type type() const; BLINK_EXPORT WebURL rootURL() const; + BLINK_EXPORT v8::Handle<v8::Value> toV8Value(v8::Handle<v8::Object> creationContext, v8::Isolate*); + BLINK_EXPORT v8::Handle<v8::Value> createV8Entry( + const WebString& path, + EntryType, + v8::Handle<v8::Object> creationContext, v8::Isolate*); + bool isNull() const { return m_private.isNull(); } #if BLINK_IMPLEMENTATION - WebDOMFileSystem(const WTF::PassRefPtr<WebCore::DOMFileSystem>&); - WebDOMFileSystem& operator=(const WTF::PassRefPtr<WebCore::DOMFileSystem>&); - operator WTF::PassRefPtr<WebCore::DOMFileSystem>() const; + WebDOMFileSystem(WebCore::DOMFileSystem*); + WebDOMFileSystem& operator=(WebCore::DOMFileSystem*); #endif private: diff --git a/chromium/third_party/WebKit/public/web/WebDOMMediaStreamTrack.h b/chromium/third_party/WebKit/public/web/WebDOMMediaStreamTrack.h index 5eed104dae1..76097214816 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMMediaStreamTrack.h +++ b/chromium/third_party/WebKit/public/web/WebDOMMediaStreamTrack.h @@ -68,7 +68,7 @@ public: private: #if BLINK_IMPLEMENTATION - WebDOMMediaStreamTrack(WTF::PassRefPtr<WebCore::MediaStreamTrack>); + WebDOMMediaStreamTrack(PassRefPtrWillBeRawPtr<WebCore::MediaStreamTrack>); #endif WebPrivatePtr<WebCore::MediaStreamTrack> m_private; diff --git a/chromium/third_party/WebKit/public/web/WebDOMMessageEvent.h b/chromium/third_party/WebKit/public/web/WebDOMMessageEvent.h index 92623f16589..c220c0efd26 100644 --- a/chromium/third_party/WebKit/public/web/WebDOMMessageEvent.h +++ b/chromium/third_party/WebKit/public/web/WebDOMMessageEvent.h @@ -55,7 +55,7 @@ public: BLINK_EXPORT WebMessagePortChannelArray releaseChannels(); #if BLINK_IMPLEMENTATION - explicit WebDOMMessageEvent(const WTF::PassRefPtr<WebCore::MessageEvent>& e) : WebDOMEvent(e) { } + explicit WebDOMMessageEvent(const PassRefPtrWillBeRawPtr<WebCore::MessageEvent>& e) : WebDOMEvent(e) { } #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebDataSource.h b/chromium/third_party/WebKit/public/web/WebDataSource.h index eedbaf3c7f5..6437ab70a7d 100644 --- a/chromium/third_party/WebKit/public/web/WebDataSource.h +++ b/chromium/third_party/WebKit/public/web/WebDataSource.h @@ -102,13 +102,6 @@ public: virtual ExtraData* extraData() const = 0; virtual void setExtraData(ExtraData*) = 0; - // The application cache host associated with this datasource. - virtual WebApplicationCacheHost* applicationCacheHost() = 0; - - // Set deferMainResourceDataLoad flag on the loader. This is used for - // testing. - virtual void setDeferMainResourceDataLoad(bool) = 0; - // Sets the navigation start time for this datasource. Ordinarily, // navigation start is determined in WebCore. But, in some situations, // the embedder might have a better value and can override it here. This diff --git a/chromium/third_party/WebKit/public/web/WebDevToolsAgent.h b/chromium/third_party/WebKit/public/web/WebDevToolsAgent.h index 73a8f82ca4b..2adad796c95 100644 --- a/chromium/third_party/WebKit/public/web/WebDevToolsAgent.h +++ b/chromium/third_party/WebKit/public/web/WebDevToolsAgent.h @@ -37,7 +37,6 @@ namespace blink { class WebDevToolsAgentClient; class WebDevToolsMessageTransport; -class WebFrame; class WebString; class WebURLRequest; class WebURLResponse; @@ -51,14 +50,12 @@ class WebDevToolsAgent { public: virtual ~WebDevToolsAgent() {} - // Returns WebKit WebInspector protocol version. - BLINK_EXPORT static WebString inspectorProtocolVersion(); - - // Returns true if and only if the given protocol version is supported by the WebKit Web Inspector. - BLINK_EXPORT static bool supportsInspectorProtocolVersion(const WebString& version); - + // FIXME: remove once migrated to the one with host_id. virtual void attach() = 0; virtual void reattach(const WebString& savedState) = 0; + + virtual void attach(const WebString& hostId) = 0; + virtual void reattach(const WebString& hostId, const WebString& savedState) = 0; virtual void detach() = 0; virtual void didNavigate() = 0; @@ -74,20 +71,19 @@ public: virtual void willComposite() = 0; virtual void didComposite() = 0; - // FIXME: remove it once the client side stops firing these. - virtual void processGPUEvent(double timestamp, int phase, bool foreign) = 0; - class GPUEvent { public: - GPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes) : + GPUEvent(double timestamp, int phase, bool foreign, uint64_t usedGPUMemoryBytes) : timestamp(timestamp), phase(phase), foreign(foreign), - usedGPUMemoryBytes(usedGPUMemoryBytes) { } + usedGPUMemoryBytes(usedGPUMemoryBytes), + limitGPUMemoryBytes(0) { } double timestamp; int phase; bool foreign; - size_t usedGPUMemoryBytes; + uint64_t usedGPUMemoryBytes; + uint64_t limitGPUMemoryBytes; }; virtual void processGPUEvent(const GPUEvent&) = 0; diff --git a/chromium/third_party/WebKit/public/web/WebDevToolsAgentClient.h b/chromium/third_party/WebKit/public/web/WebDevToolsAgentClient.h index f89ccb1640b..23730ee6749 100644 --- a/chromium/third_party/WebKit/public/web/WebDevToolsAgentClient.h +++ b/chromium/third_party/WebKit/public/web/WebDevToolsAgentClient.h @@ -36,6 +36,7 @@ namespace blink { class WebString; +struct WebDeviceEmulationParams; struct WebDevToolsMessageData; struct WebRect; struct WebSize; @@ -46,8 +47,12 @@ public: virtual void sendDebuggerOutput(const WebString&) { } // Returns the identifier of the entity hosting this agent. + // FIXME: remove once migrated to debuggerId(). virtual int hostIdentifier() { return -1; } + // Returns unique identifier of the entity within process. + virtual int debuggerId() { return hostIdentifier(); } + // Save the agent state in order to pass it later into WebDevToolsAgent::reattach // if the same client is reattached to another agent. virtual void saveAgentRuntimeState(const WebString&) { } @@ -59,9 +64,8 @@ public: virtual void quitNow() = 0; }; virtual WebKitClientMessageLoop* createClientMessageLoop() { return 0; } - - virtual void clearBrowserCache() { } - virtual void clearBrowserCookies() { } + virtual void willEnterDebugLoop() { } + virtual void didExitDebugLoop() { } class AllocatedObjectVisitor { public: @@ -83,24 +87,22 @@ public: int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues, unsigned char flags, double timestamp); - virtual void setTraceEventCallback(TraceEventCallback) { } + virtual void setTraceEventCallback(const WebString& categoryFilter, TraceEventCallback) { } + virtual void resetTraceEventCallback() { } + virtual void enableTracing(const WebString& categoryFilter) { } + virtual void disableTracing() { } virtual void startGPUEventsRecording() { } virtual void stopGPUEventsRecording() { } - // Called to emulate device dimensions, scale factor and input. Window should - // occupy the whole device screen, while the view should be located at |viewRect|. - // x-coordinate of |screenRect| defines the left and right gutters' width, - // y-coordinate defines the top and bottom gutters' height. - // With |fitToView| set, contents should be scaled down to fit into embedder window. - // All sizes are measured in device independent pixels. - virtual void enableDeviceEmulation( - const WebRect& screenRect, const WebRect& viewRect, - float deviceScaleFactor, bool fitToView) { } + // Enables device emulation as specified in params. + virtual void enableDeviceEmulation(const WebDeviceEmulationParams& params) { } // Cancel emulation started via |enableDeviceEmulation| call. virtual void disableDeviceEmulation() { } + virtual void setTouchEventEmulationEnabled(bool enabled, bool allowPinch) { } + protected: ~WebDevToolsAgentClient() { } }; diff --git a/chromium/third_party/WebKit/public/web/WebDeviceEmulationParams.h b/chromium/third_party/WebKit/public/web/WebDeviceEmulationParams.h new file mode 100644 index 00000000000..ac4dbbd78d8 --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebDeviceEmulationParams.h @@ -0,0 +1,52 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebDeviceEmulationParams_h +#define WebDeviceEmulationParams_h + +#include "public/platform/WebFloatPoint.h" +#include "public/platform/WebRect.h" +#include "public/platform/WebSize.h" + +namespace blink { + +// All sizes are measured in device independent pixels. +struct WebDeviceEmulationParams { + // For mobile, screen has the same size as view, which is positioned at (0;0). + // For desktop, screen size and view position are preserved. + enum ScreenPosition { + Desktop, + Mobile + }; + + ScreenPosition screenPosition; + + // If zero, the original device scale factor is preserved. + float deviceScaleFactor; + + // Emulated view size. Empty size means no override. + WebSize viewSize; + + // Whether emulated view should be scaled down if necessary to fit into available space. + bool fitToView; + + // Insets of emulated view inside available view space, in fit to view mode. + WebSize viewInsets; + + // Offset of emulated view inside available space, not in fit to view mode. + WebFloatPoint offset; + + // Scale of emulated view inside available space, not in fit to view mode. + float scale; + + WebDeviceEmulationParams() + : screenPosition(Desktop) + , deviceScaleFactor(0) + , fitToView(false) + , scale(1) { } +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/web/WebDocument.h b/chromium/third_party/WebKit/public/web/WebDocument.h index d0eba00d1ee..4e8b2f6f3b0 100644 --- a/chromium/third_party/WebKit/public/web/WebDocument.h +++ b/chromium/third_party/WebKit/public/web/WebDocument.h @@ -35,6 +35,7 @@ #include "../platform/WebVector.h" #include "WebDraggableRegion.h" #include "WebExceptionCode.h" +#include "WebFrame.h" #include "WebNode.h" #include "WebSecurityOrigin.h" @@ -56,8 +57,7 @@ class WebAXObject; class WebDocumentType; class WebElement; class WebFormElement; -class WebFrame; -class WebNodeCollection; +class WebElementCollection; class WebNodeList; class WebString; class WebURL; @@ -65,11 +65,6 @@ class WebURL; // Provides readonly access to some properties of a DOM document. class WebDocument : public WebNode { public: - // FIXME: Stop using this from Chromium code and get rid of this enum. - enum UserStyleLevel { - UserStyleAuthorLevel - }; - WebDocument() { } WebDocument(const WebDocument& e) : WebNode(e) { } @@ -87,12 +82,14 @@ public: BLINK_EXPORT WebString encoding() const; BLINK_EXPORT WebString contentLanguage() const; BLINK_EXPORT WebString referrer() const; - + BLINK_EXPORT WebColor themeColor() const; + // TODO: Remove when chromium is changed to themeColor(). + BLINK_EXPORT WebColor brandColor() const { return 0; } // The url of the OpenSearch Desription Document (if any). BLINK_EXPORT WebURL openSearchDescriptionURL() const; // Returns the frame the document belongs to or 0 if the document is frameless. - BLINK_EXPORT WebFrame* frame() const; + BLINK_EXPORT WebLocalFrame* frame() const; BLINK_EXPORT bool isHTMLDocument() const; BLINK_EXPORT bool isXHTMLDocument() const; BLINK_EXPORT bool isPluginDocument() const; @@ -107,12 +104,12 @@ public: BLINK_EXPORT WebElement body() const; BLINK_EXPORT WebElement head(); BLINK_EXPORT WebString title() const; - BLINK_EXPORT WebNodeCollection all(); + BLINK_EXPORT WebElementCollection all(); BLINK_EXPORT void forms(WebVector<WebFormElement>&) const; BLINK_EXPORT void images(WebVector<WebElement>&); BLINK_EXPORT WebURL completeURL(const WebString&) const; BLINK_EXPORT WebElement getElementById(const WebString&) const; - BLINK_EXPORT WebNode focusedNode() const; + BLINK_EXPORT WebElement focusedElement() const; BLINK_EXPORT WebDocumentType doctype() const; BLINK_EXPORT void cancelFullScreen(); BLINK_EXPORT WebElement fullScreenElement() const; @@ -130,8 +127,6 @@ public: // Gets the accessibility object for an object on this page by ID. BLINK_EXPORT WebAXObject accessibilityObjectFromID(int axID) const; // Inserts the given CSS source code as a stylesheet in the document. - // FIXME: Delete insertUserStyleSheet once Chromium code stops calling it. - BLINK_EXPORT void insertUserStyleSheet(const WebString& sourceCode, UserStyleLevel); BLINK_EXPORT void insertStyleSheet(const WebString& sourceCode); // Arranges to call WebFrameClient::didMatchCSS(frame(), ...) when one of @@ -144,9 +139,9 @@ public: BLINK_EXPORT v8::Handle<v8::Value> registerEmbedderCustomElement(const WebString& name, v8::Handle<v8::Value> options, WebExceptionCode&); #if BLINK_IMPLEMENTATION - WebDocument(const WTF::PassRefPtr<WebCore::Document>&); - WebDocument& operator=(const WTF::PassRefPtr<WebCore::Document>&); - operator WTF::PassRefPtr<WebCore::Document>() const; + WebDocument(const PassRefPtrWillBeRawPtr<WebCore::Document>&); + WebDocument& operator=(const PassRefPtrWillBeRawPtr<WebCore::Document>&); + operator PassRefPtrWillBeRawPtr<WebCore::Document>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebDocumentType.h b/chromium/third_party/WebKit/public/web/WebDocumentType.h index 87608658908..a23eebd9554 100644 --- a/chromium/third_party/WebKit/public/web/WebDocumentType.h +++ b/chromium/third_party/WebKit/public/web/WebDocumentType.h @@ -57,9 +57,9 @@ public: BLINK_EXPORT WebString name() const; #if BLINK_IMPLEMENTATION - WebDocumentType(const WTF::PassRefPtr<WebCore::DocumentType>&); - WebDocumentType& operator=(const WTF::PassRefPtr<WebCore::DocumentType>&); - operator WTF::PassRefPtr<WebCore::DocumentType>() const; + WebDocumentType(const PassRefPtrWillBeRawPtr<WebCore::DocumentType>&); + WebDocumentType& operator=(const PassRefPtrWillBeRawPtr<WebCore::DocumentType>&); + operator PassRefPtrWillBeRawPtr<WebCore::DocumentType>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebDragStatus.h b/chromium/third_party/WebKit/public/web/WebDragStatus.h index 0e41f233277..81ba39024ac 100644 --- a/chromium/third_party/WebKit/public/web/WebDragStatus.h +++ b/chromium/third_party/WebKit/public/web/WebDragStatus.h @@ -38,7 +38,8 @@ enum WebDragStatus { WebDragStatusEnter, WebDragStatusOver, WebDragStatusLeave, - WebDragStatusDrop + WebDragStatusDrop, + WebDragStatusLast = WebDragStatusDrop }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebElement.h b/chromium/third_party/WebKit/public/web/WebElement.h index 3bfd310f39d..9308da0ad79 100644 --- a/chromium/third_party/WebKit/public/web/WebElement.h +++ b/chromium/third_party/WebKit/public/web/WebElement.h @@ -89,9 +89,9 @@ struct WebRect; BLINK_EXPORT WebImage imageContents(); #if BLINK_IMPLEMENTATION - WebElement(const WTF::PassRefPtr<WebCore::Element>&); - WebElement& operator=(const WTF::PassRefPtr<WebCore::Element>&); - operator WTF::PassRefPtr<WebCore::Element>() const; + WebElement(const PassRefPtrWillBeRawPtr<WebCore::Element>&); + WebElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::Element>&); + operator PassRefPtrWillBeRawPtr<WebCore::Element>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebNodeCollection.h b/chromium/third_party/WebKit/public/web/WebElementCollection.h index a01ac7b9bae..28a8ac9b0a9 100644 --- a/chromium/third_party/WebKit/public/web/WebNodeCollection.h +++ b/chromium/third_party/WebKit/public/web/WebElementCollection.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2014 Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,48 +29,50 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebNodeCollection_h -#define WebNodeCollection_h +#ifndef WebElementCollection_h +#define WebElementCollection_h #include "../platform/WebCommon.h" +#include "../platform/WebPrivatePtr.h" namespace WebCore { class HTMLCollection; } #if BLINK_IMPLEMENTATION +#include "platform/heap/Handle.h" namespace WTF { template <typename T> class PassRefPtr; } #endif namespace blink { -class WebNode; +class WebElement; // Provides readonly access to some properties of a DOM node. -class WebNodeCollection { +class WebElementCollection { public: - ~WebNodeCollection() { reset(); } + ~WebElementCollection() { reset(); } - WebNodeCollection() : m_private(0), m_current(0) { } - WebNodeCollection(const WebNodeCollection& n) : m_private(0) { assign(n); } - WebNodeCollection& operator=(const WebNodeCollection& n) + WebElementCollection() : m_current(0) { } + WebElementCollection(const WebElementCollection& n) { assign(n); } + WebElementCollection& operator=(const WebElementCollection& n) { assign(n); return *this; } - bool isNull() const { return !m_private; } + bool isNull() const { return m_private.isNull(); } BLINK_EXPORT void reset(); - BLINK_EXPORT void assign(const WebNodeCollection&); + BLINK_EXPORT void assign(const WebElementCollection&); BLINK_EXPORT unsigned length() const; - BLINK_EXPORT WebNode nextItem() const; - BLINK_EXPORT WebNode firstItem() const; + BLINK_EXPORT WebElement nextItem() const; + BLINK_EXPORT WebElement firstItem() const; #if BLINK_IMPLEMENTATION - WebNodeCollection(const WTF::PassRefPtr<WebCore::HTMLCollection>&); + WebElementCollection(const PassRefPtrWillBeRawPtr<WebCore::HTMLCollection>&); + WebElementCollection& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLCollection>&); #endif private: - void assign(WebCore::HTMLCollection*); - WebCore::HTMLCollection* m_private; + WebPrivatePtr<WebCore::HTMLCollection> m_private; mutable unsigned m_current; }; diff --git a/chromium/third_party/WebKit/public/web/WebEmbeddedWorker.h b/chromium/third_party/WebKit/public/web/WebEmbeddedWorker.h index 21af406f706..4ba3c9262a1 100644 --- a/chromium/third_party/WebKit/public/web/WebEmbeddedWorker.h +++ b/chromium/third_party/WebKit/public/web/WebEmbeddedWorker.h @@ -36,6 +36,7 @@ namespace blink { class WebServiceWorkerContextClient; +class WebString; class WebWorkerPermissionClientProxy; struct WebEmbeddedWorkerStartData; @@ -56,6 +57,17 @@ public: // Starts and terminates WorkerThread and WorkerGlobalScope. virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) = 0; virtual void terminateWorkerContext() = 0; + + // Resumes starting a worker startup that was paused via + // WebEmbeddedWorkerStartData.pauseAfterDownloadMode. + virtual void resumeAfterDownload() = 0; + + // Inspector related methods. + virtual void resumeWorkerContext() = 0; + virtual void attachDevTools() = 0; + virtual void reattachDevTools(const WebString& savedState) = 0; + virtual void detachDevTools() = 0; + virtual void dispatchDevToolsMessage(const WebString&) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h b/chromium/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h index c5cf380e489..25751e69620 100644 --- a/chromium/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h +++ b/chromium/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h @@ -37,15 +37,27 @@ namespace blink { +// FIXME: delete after waitForDebugger is in use in both chrome and blink. enum WebEmbeddedWorkerStartMode { WebEmbeddedWorkerStartModeDontPauseOnStart, WebEmbeddedWorkerStartModePauseOnStart }; struct WebEmbeddedWorkerStartData { + enum PauseAfterDownloadMode { + DontPauseAfterDownload, + PauseAfterDownload, + }; + enum WaitForDebuggerMode { + DontWaitForDebugger, + WaitForDebugger + }; + WebURL scriptURL; WebString userAgent; - WebEmbeddedWorkerStartMode startMode; + WebEmbeddedWorkerStartMode startMode; // FIXME: ditto delete + PauseAfterDownloadMode pauseAfterDownloadMode; + WaitForDebuggerMode waitForDebuggerMode; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebFontDescription.h b/chromium/third_party/WebKit/public/web/WebFontDescription.h index d40030caae6..b7b29ba0e11 100644 --- a/chromium/third_party/WebKit/public/web/WebFontDescription.h +++ b/chromium/third_party/WebKit/public/web/WebFontDescription.h @@ -95,7 +95,7 @@ struct WebFontDescription { short wordSpacing; #if BLINK_IMPLEMENTATION - WebFontDescription(const WebCore::FontDescription&, short fontLetterSpacing, short fontWordSpacing); + WebFontDescription(const WebCore::FontDescription&); operator WebCore::FontDescription() const; #endif diff --git a/chromium/third_party/WebKit/public/web/WebFormControlElement.h b/chromium/third_party/WebKit/public/web/WebFormControlElement.h index a6abd72ffa5..e8862d1d549 100644 --- a/chromium/third_party/WebKit/public/web/WebFormControlElement.h +++ b/chromium/third_party/WebKit/public/web/WebFormControlElement.h @@ -59,11 +59,55 @@ public: BLINK_EXPORT WebString formControlName() const; BLINK_EXPORT WebString formControlType() const; + // FIXME: remove this method when no longer used. BLINK_EXPORT void dispatchFormControlChangeEvent(); BLINK_EXPORT bool isAutofilled() const; BLINK_EXPORT void setAutofilled(bool); + // Returns true if autocomplete attribute of the element is not set as "off". + BLINK_EXPORT bool autoComplete() const; + + // Sets value for input element, textarea element and select element. For select + // element it finds the option with value matches the given parameter and make the + // option as the current selection. + BLINK_EXPORT void setValue(const WebString&, bool sendEvents = false); + // Returns value of element. For select element, it returns the value of + // the selected option if present. If no selected option, an empty string + // is returned. If element doesn't fall into input element, textarea element + // and select element categories, a null string is returned. + BLINK_EXPORT WebString value() const; + // Sets suggested value for element. For select element it finds the option + // with value matches the given parameter and make the option as the suggested + // selection. The goal of introducing suggested value is to not leak any information + // to JavaScript. + BLINK_EXPORT void setSuggestedValue(const WebString&); + // Returns suggested value of element. If element doesn't fall into input element, + // textarea element and select element categories, a null string is returned. + BLINK_EXPORT WebString suggestedValue() const; + + // Returns the non-sanitized, exact value inside the text input field + // or insisde the textarea. If neither input element nor textarea element, + // a null string is returned. + BLINK_EXPORT WebString editingValue() const; + + // Sets character selection range. + BLINK_EXPORT void setSelectionRange(int start, int end); + // Returned value represents a cursor/caret position at the current + // selection's start for text input field or textarea. If neither input + // element nor textarea element, 0 is returned. + BLINK_EXPORT int selectionStart() const; + // Returned value represents a cursor/caret position at the current + // selection's end for text input field or textarea. If neither input + // element nor textarea element, 0 is returned. + BLINK_EXPORT int selectionEnd() const; + + // Returns direction of text of element. + BLINK_EXPORT WebString directionForFormData() const; + + // Returns true if sumit is activated. + BLINK_EXPORT bool isActivatedSubmit() const; + // Returns the name that should be used for the specified |element| when // storing autofill data. This is either the field name or its id, an empty // string if it has no name and no id. @@ -72,9 +116,9 @@ public: BLINK_EXPORT WebFormElement form() const; #if BLINK_IMPLEMENTATION - WebFormControlElement(const WTF::PassRefPtr<WebCore::HTMLFormControlElement>&); - WebFormControlElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormControlElement>&); - operator WTF::PassRefPtr<WebCore::HTMLFormControlElement>() const; + WebFormControlElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLFormControlElement>&); + WebFormControlElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLFormControlElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLFormControlElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebFormElement.h b/chromium/third_party/WebKit/public/web/WebFormElement.h index 0d012053883..3181e827693 100644 --- a/chromium/third_party/WebKit/public/web/WebFormElement.h +++ b/chromium/third_party/WebKit/public/web/WebFormElement.h @@ -68,7 +68,9 @@ namespace blink { // FIXME: Deprecate and replace with WebVector<WebElement>. BLINK_EXPORT void getNamedElements(const WebString&, WebVector<WebNode>&); BLINK_EXPORT void getFormControlElements(WebVector<WebFormControlElement>&) const; - BLINK_EXPORT bool checkValidityWithoutDispatchingEvents(); + + // NOTE: This function dispatches "invalid" events. Only call this if required by a specification (e.g. requestAutocomplete()). + BLINK_EXPORT bool checkValidity(); enum AutocompleteResult { AutocompleteResultSuccess, @@ -79,9 +81,9 @@ namespace blink { BLINK_EXPORT void finishRequestAutocomplete(WebFormElement::AutocompleteResult); #if BLINK_IMPLEMENTATION - WebFormElement(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); - WebFormElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); - operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const; + WebFormElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLFormElement>&); + WebFormElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLFormElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLFormElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebFrame.h b/chromium/third_party/WebKit/public/web/WebFrame.h index f99ae66f4ba..669b865c08d 100644 --- a/chromium/third_party/WebKit/public/web/WebFrame.h +++ b/chromium/third_party/WebKit/public/web/WebFrame.h @@ -31,18 +31,24 @@ #ifndef WebFrame_h #define WebFrame_h -#include "../platform/WebCanvas.h" -#include "../platform/WebFileSystem.h" -#include "../platform/WebFileSystemType.h" -#include "../platform/WebMessagePortChannel.h" -#include "../platform/WebReferrerPolicy.h" -#include "../platform/WebURL.h" +#include "WebCompositionUnderline.h" +#include "WebHistoryItem.h" #include "WebIconURL.h" #include "WebNode.h" #include "WebURLLoaderOptions.h" +#include "public/platform/WebCanvas.h" +#include "public/platform/WebMessagePortChannel.h" +#include "public/platform/WebPrivateOwnPtr.h" +#include "public/platform/WebReferrerPolicy.h" +#include "public/platform/WebURL.h" +#include "public/platform/WebURLRequest.h" struct NPObject; +#if BLINK_IMPLEMENTATION +namespace WebCore { class Frame; } +#endif + namespace v8 { class Context; class Function; @@ -54,19 +60,22 @@ template <class T> class Local; namespace blink { +class OpenedFrameTracker; class WebData; class WebDataSource; class WebDocument; class WebElement; class WebFormElement; class WebFrameClient; -class WebHistoryItem; class WebInputElement; class WebLayer; +class WebLocalFrame; class WebPerformance; class WebPermissionClient; class WebRange; +class WebRemoteFrame; class WebSecurityOrigin; +class WebSharedWorkerRepositoryClient; class WebString; class WebURL; class WebURLLoader; @@ -85,6 +94,12 @@ struct WebURLLoaderOptions; template <typename T> class WebVector; +// Frames may be rendered in process ('local') or out of process ('remote'). +// A remote frame is always cross-site; a local frame may be either same-site or +// cross-site. +// WebFrame is the base class for both WebLocalFrame and WebRemoteFrame and +// contains methods that are valid on both local and remote frames, such as +// getting a frame's parent or its opener. class WebFrame { public: // Control of renderTreeAsText output @@ -95,39 +110,15 @@ public: }; typedef unsigned RenderAsTextControls; - // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). - // It is valid to pass a null client pointer. - BLINK_EXPORT static WebFrame* create(WebFrameClient*); - - // Same as create(WebFrameClient*) except the embedder may explicitly pass - // in the identifier for the WebFrame. This can be used with - // generateEmbedderIdentifier() if constructing the WebFrameClient for this - // frame requires the identifier. - // - // FIXME: Move the embedderIdentifier concept fully to the embedder and - // remove this factory method. - BLINK_EXPORT static WebFrame* create(WebFrameClient*, long long embedderIdentifier); - - // Generates an identifier suitable for use with create() above. - // Never returns -1. - BLINK_EXPORT static long long generateEmbedderIdentifier(); - // Returns the number of live WebFrame objects, used for leak checking. BLINK_EXPORT static int instanceCount(); - // Returns the WebFrame associated with the current V8 context. This - // function can return 0 if the context is associated with a Document that - // is not currently being displayed in a Frame. - BLINK_EXPORT static WebFrame* frameForCurrentContext(); + virtual bool isWebLocalFrame() const = 0; + virtual WebLocalFrame* toWebLocalFrame() = 0; + virtual bool isWebRemoteFrame() const = 0; + virtual WebRemoteFrame* toWebRemoteFrame() = 0; - // Returns the frame corresponding to the given context. This can return 0 - // if the context is detached from the frame, or if the context doesn't - // correspond to a frame (e.g., workers). - BLINK_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); - - // Returns the frame inside a given frame or iframe element. Returns 0 if - // the given element is not a frame, iframe or if the frame is empty. - BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); + BLINK_EXPORT void swap(WebFrame*); // This method closes and deletes the WebFrame. virtual void close() = 0; @@ -146,17 +137,16 @@ public: // frame name unique within the hierarchy. virtual void setName(const WebString&) = 0; - // A globally unique identifier for this frame. - // FIXME: Convert users to embedderIdentifier() and remove identifier(). - long long identifier() const { return embedderIdentifier(); } - virtual long long embedderIdentifier() const = 0; - // The urls of the given combination types of favicon (if any) specified by // the document loaded in this frame. The iconTypesMask is a bit-mask of // WebIconURL::Type values, used to select from the available set of icon // URLs virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const = 0; + // Notify the WebFrame as to whether its frame will be rendered in a + // separate renderer process. + virtual void setIsRemote(bool) = 0; + // For a WebFrame with contents being rendered in another process, this // sets a layer for use by the in-process compositor. WebLayer should be // null if the content is being rendered in the current process. @@ -164,6 +154,7 @@ public: // Initializes the various client interfaces. virtual void setPermissionClient(WebPermissionClient*) = 0; + virtual void setSharedWorkerRepositoryClient(WebSharedWorkerRepositoryClient*) = 0; // Geometry ----------------------------------------------------------- @@ -201,39 +192,42 @@ public: virtual WebView* view() const = 0; // Returns the frame that opened this frame or 0 if there is none. - virtual WebFrame* opener() const = 0; + BLINK_EXPORT WebFrame* opener() const; // Sets the frame that opened this one or 0 if there is none. - virtual void setOpener(const WebFrame*) = 0; + virtual void setOpener(WebFrame*); // Reset the frame that opened this frame to 0. // This is executed between layout tests runs void clearOpener() { setOpener(0); } + // Adds the given frame as a child of this frame. + BLINK_EXPORT void appendChild(WebFrame*); + + // Removes the given child from this frame. + virtual void removeChild(WebFrame*); + // Returns the parent frame or 0 if this is a top-most frame. - virtual WebFrame* parent() const = 0; + BLINK_EXPORT WebFrame* parent() const; // Returns the top-most frame in the hierarchy containing this frame. - virtual WebFrame* top() const = 0; + BLINK_EXPORT WebFrame* top() const; // Returns the first/last child frame. - virtual WebFrame* firstChild() const = 0; - virtual WebFrame* lastChild() const = 0; + BLINK_EXPORT WebFrame* firstChild() const; + BLINK_EXPORT WebFrame* lastChild() const; - // Returns the next/previous sibling frame. - virtual WebFrame* nextSibling() const = 0; - virtual WebFrame* previousSibling() const = 0; + // Returns the previous/next sibling frame. + BLINK_EXPORT WebFrame* previousSibling() const; + BLINK_EXPORT WebFrame* nextSibling() const; - // Returns the next/previous frame in "frame traversal order" + // Returns the previous/next frame in "frame traversal order", // optionally wrapping around. - virtual WebFrame* traverseNext(bool wrap) const = 0; - virtual WebFrame* traversePrevious(bool wrap) const = 0; + BLINK_EXPORT WebFrame* traversePrevious(bool wrap) const; + BLINK_EXPORT WebFrame* traverseNext(bool wrap) const; // Returns the child frame identified by the given name. - virtual WebFrame* findChildByName(const WebString& name) const = 0; - - // Returns the child frame identified by the given xpath expression. - virtual WebFrame* findChildByExpression(const WebString& xpath) const = 0; + BLINK_EXPORT WebFrame* findChildByName(const WebString& name) const; // Content ------------------------------------------------------------ @@ -243,6 +237,16 @@ public: virtual WebPerformance performance() const = 0; + // Closing ------------------------------------------------------------- + + // Runs beforeunload handlers for this frame, returning false if a + // handler suppressed unloading. + virtual bool dispatchBeforeUnloadEvent() = 0; + + // Runs unload handlers for this frame. + virtual void dispatchUnloadEvent() = 0; + + // Scripting ---------------------------------------------------------- // Returns a NPObject corresponding to this frame's DOMWindow. @@ -311,7 +315,7 @@ public: // canExecute(). virtual v8::Handle<v8::Value> callFunctionEvenIfScriptDisabled( v8::Handle<v8::Function>, - v8::Handle<v8::Object>, + v8::Handle<v8::Value>, int argc, v8::Handle<v8::Value> argv[]) = 0; @@ -322,23 +326,6 @@ public: // be calling this API. virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0; - // Creates an instance of file system object. - virtual v8::Handle<v8::Value> createFileSystem(WebFileSystemType, - const WebString& name, - const WebString& rootURL) = 0; - // Creates an instance of serializable file system object. - // FIXME: Remove this API after we have a better way of creating serialized - // file system object. - virtual v8::Handle<v8::Value> createSerializableFileSystem(WebFileSystemType, - const WebString& name, - const WebString& rootURL) = 0; - // Creates an instance of file or directory entry object. - virtual v8::Handle<v8::Value> createFileEntry(WebFileSystemType, - const WebString& fileSystemName, - const WebString& fileSystemRootURL, - const WebString& filePath, - bool isDirectory) = 0; - // Navigation ---------------------------------------------------------- // Reload the current document. @@ -353,8 +340,11 @@ public: virtual void loadRequest(const WebURLRequest&) = 0; // Load the given history state, corresponding to a back/forward - // navigation. - virtual void loadHistoryItem(const WebHistoryItem&) = 0; + // navigation of a frame. Multiple frames may be navigated via separate calls. + virtual void loadHistoryItem( + const WebHistoryItem&, + WebHistoryLoadType, + WebURLRequest::CachePolicy = WebURLRequest::UseProtocolCachePolicy) = 0; // Loads the given data with specific mime type and optional text // encoding. For HTML data, baseURL indicates the security origin of @@ -388,14 +378,6 @@ public: // Returns the data source that is currently loaded. virtual WebDataSource* dataSource() const = 0; - // Returns the previous history item. Check WebHistoryItem::isNull() - // before using. - virtual WebHistoryItem previousHistoryItem() const = 0; - - // Returns the current history item. Check WebHistoryItem::isNull() - // before using. - virtual WebHistoryItem currentHistoryItem() const = 0; - // View-source rendering mode. Set this before loading an URL to cause // it to be rendered in view-source mode. virtual void enableViewSourceMode(bool) = 0; @@ -484,6 +466,10 @@ public: virtual void moveRangeSelection(const WebPoint& base, const WebPoint& extent) = 0; virtual void moveCaretSelection(const WebPoint&) = 0; + virtual bool setEditableSelectionOffsets(int start, int end) = 0; + virtual bool setCompositionFromExistingText(int compositionStart, int compositionEnd, const WebVector<WebCompositionUnderline>& underlines) = 0; + virtual void extendSelectionAndDelete(int before, int after) = 0; + virtual void setCaretVisible(bool) = 0; // Printing ------------------------------------------------------------ @@ -617,13 +603,26 @@ public: virtual int selectNearestFindMatch(const WebFloatPoint&, WebRect* selectionRect) = 0; + + // Set the tickmarks for the frame. This will override the default tickmarks + // generated by find results. If this is called with an empty array, the + // default behavior will be restored. + virtual void setTickmarks(const WebVector<WebRect>&) = 0; + // OrientationChange event --------------------------------------------- + // Notify the frame that the screen orientation has changed. + virtual void sendOrientationChangeEvent() = 0; + + // FIXME: this is only there for backward compatibility, it will be removed. // Orientation is the interface orientation in degrees. // Some examples are: // 0 is straight up; -90 is when the device is rotated 90 clockwise; // 90 is when rotated counter clockwise. - virtual void sendOrientationChangeEvent(int orientation) = 0; + void sendOrientationChangeEvent(int orientation) + { + sendOrientationChangeEvent(); + } // Events -------------------------------------------------------------- @@ -674,10 +673,31 @@ public: // text form. This is used only by layout tests. virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; +#if BLINK_IMPLEMENTATION + static WebFrame* fromFrame(WebCore::Frame*); +#endif + protected: - ~WebFrame() { } + explicit WebFrame(); + virtual ~WebFrame(); + +private: + friend class OpenedFrameTracker; + + WebFrame* m_parent; + WebFrame* m_previousSibling; + WebFrame* m_nextSibling; + WebFrame* m_firstChild; + WebFrame* m_lastChild; + + WebFrame* m_opener; + WebPrivateOwnPtr<OpenedFrameTracker> m_openedFrameTracker; }; +#if BLINK_IMPLEMENTATION +WebCore::Frame* toWebCoreFrame(const WebFrame*); +#endif + } // namespace blink #endif diff --git a/chromium/third_party/WebKit/public/web/WebFrameClient.h b/chromium/third_party/WebKit/public/web/WebFrameClient.h index 13c4494fcb1..271c652da28 100644 --- a/chromium/third_party/WebKit/public/web/WebFrameClient.h +++ b/chromium/third_party/WebKit/public/web/WebFrameClient.h @@ -31,8 +31,12 @@ #ifndef WebFrameClient_h #define WebFrameClient_h +#include "../platform/WebColor.h" #include "WebDOMMessageEvent.h" #include "WebDataSource.h" +#include "WebFrame.h" +#include "WebHistoryCommitType.h" +#include "WebHistoryItem.h" #include "WebIconURL.h" #include "WebNavigationPolicy.h" #include "WebNavigationType.h" @@ -41,6 +45,7 @@ #include "public/platform/WebCommon.h" #include "public/platform/WebFileSystem.h" #include "public/platform/WebFileSystemType.h" +#include "public/platform/WebStorageQuotaCallbacks.h" #include "public/platform/WebStorageQuotaType.h" #include "public/platform/WebURLError.h" #include "public/platform/WebURLRequest.h" @@ -51,27 +56,38 @@ namespace blink { class WebApplicationCacheHost; class WebApplicationCacheHostClient; class WebCachedURLRequest; +class WebColorChooser; +class WebColorChooserClient; +class WebContentDecryptionModule; class WebCookieJar; class WebDataSource; class WebDOMEvent; class WebFormElement; -class WebFrame; +class WebGeolocationClient; +class WebInputEvent; class WebMediaPlayer; class WebMediaPlayerClient; +class WebMIDIClient; +class WebNotificationPresenter; class WebServiceWorkerProvider; class WebServiceWorkerProviderClient; +class WebSocketHandle; class WebNode; class WebPlugin; class WebRTCPeerConnectionHandler; +class WebScreenOrientationClient; class WebSharedWorker; class WebSharedWorkerClient; class WebSocketStreamHandle; -class WebStorageQuotaCallbacks; class WebString; class WebURL; class WebURLLoader; class WebURLResponse; +class WebUserMediaClient; class WebWorkerPermissionClientProxy; +struct WebColorSuggestion; +struct WebConsoleMessage; +struct WebContextMenuData; struct WebPluginParams; struct WebRect; struct WebSize; @@ -82,67 +98,84 @@ public: // Factory methods ----------------------------------------------------- // May return null. - virtual WebPlugin* createPlugin(WebFrame*, const WebPluginParams&) { return 0; } + virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { return 0; } // May return null. - virtual WebMediaPlayer* createMediaPlayer(WebFrame*, const WebURL&, WebMediaPlayerClient*) { return 0; } + virtual WebMediaPlayer* createMediaPlayer(WebLocalFrame*, const WebURL&, WebMediaPlayerClient*) { return 0; } // May return null. - virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*) { return 0; } + virtual WebContentDecryptionModule* createContentDecryptionModule(WebLocalFrame*, const WebSecurityOrigin&, const WebString& keySystem) { return 0; } - // May return null. Takes ownership of the client. - virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebFrame*, WebServiceWorkerProviderClient*) { return 0; } + // May return null. + virtual WebApplicationCacheHost* createApplicationCacheHost(WebLocalFrame*, WebApplicationCacheHostClient*) { return 0; } + + // May return null. + virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebLocalFrame* frame) { return 0; } // May return null. - virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(WebFrame*) { return 0; } + virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(WebLocalFrame*) { return 0; } // Services ------------------------------------------------------------ // A frame specific cookie jar. May return null, in which case // WebKitPlatformSupport::cookieJar() will be called to access cookies. - virtual WebCookieJar* cookieJar(WebFrame*) { return 0; } + virtual WebCookieJar* cookieJar(WebLocalFrame*) { return 0; } // General notifications ----------------------------------------------- + // Indicates if creating a plugin without an associated renderer is supported. + virtual bool canCreatePluginWithoutRenderer(const WebString& mimeType) { return false; } + // Indicates that another page has accessed the DOM of the initial empty // document of a main frame. After this, it is no longer safe to show a // pending navigation's URL, because a URL spoof is possible. - virtual void didAccessInitialDocument(WebFrame*) { } + virtual void didAccessInitialDocument(WebLocalFrame*) { } // A child frame was created in this frame. This is called when the frame // is created and initialized. Takes the name of the new frame, the parent // frame and returns a new WebFrame. The WebFrame is considered in-use // until frameDetached() is called on it. - virtual WebFrame* createChildFrame(WebFrame* parent, const WebString& frameName) { return 0; } - // FIXME: Remove when all embedders use createChildFrame(). - virtual void didCreateFrame(WebFrame* parent, WebFrame* child) { } + // Note: If you override this, you should almost certainly be overriding + // frameDetached(). + virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& frameName) { return 0; } // This frame set its opener to null, disowning it. // See http://html.spec.whatwg.org/#dom-opener. - virtual void didDisownOpener(WebFrame*) { } + virtual void didDisownOpener(WebLocalFrame*) { } // This frame has been detached from the view, but has not been closed yet. virtual void frameDetached(WebFrame*) { } + // This frame has become focused.. + virtual void frameFocused() { } + // This frame is about to be closed. This is called after frameDetached, // when the document is being unloaded, due to new one committing. virtual void willClose(WebFrame*) { } // This frame's name has changed. - virtual void didChangeName(WebFrame*, const WebString&) { } + virtual void didChangeName(WebLocalFrame*, const WebString&) { } // Called when a watched CSS selector matches or stops matching. - virtual void didMatchCSS(WebFrame*, const WebVector<WebString>& newlyMatchingSelectors, const WebVector<WebString>& stoppedMatchingSelectors) { } + virtual void didMatchCSS(WebLocalFrame*, const WebVector<WebString>& newlyMatchingSelectors, const WebVector<WebString>& stoppedMatchingSelectors) { } + + + // Console messages ---------------------------------------------------- + + // Whether or not we should report a detailed message for the given source. + virtual bool shouldReportDetailedMessageForSource(const WebString& source) { return false; } + + // A new message was added to the console. + virtual void didAddMessageToConsole(const WebConsoleMessage&, const WebString& sourceName, unsigned sourceLine, const WebString& stackTrace) { } + // Load commands ------------------------------------------------------- // The client should handle the navigation externally. virtual void loadURLExternally( - WebFrame*, const WebURLRequest&, WebNavigationPolicy) { } - virtual void loadURLExternally( - WebFrame*, const WebURLRequest&, WebNavigationPolicy, const WebString& downloadName) { } + WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy, const WebString& downloadName) { } // Navigational queries ------------------------------------------------ @@ -150,151 +183,232 @@ public: // The client may choose to alter the navigation policy. Otherwise, // defaultPolicy should just be returned. virtual WebNavigationPolicy decidePolicyForNavigation( - WebFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavigationType, + WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavigationType, WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPolicy; } + // During a history navigation, we may choose to load new subframes from history as well. + // This returns such a history item if appropriate. + virtual WebHistoryItem historyItemForNewChildFrame(WebFrame*) { return WebHistoryItem(); } + // Navigational notifications ------------------------------------------ + // These notifications bracket any loading that occurs in the WebFrame. + virtual void didStartLoading(bool toDifferentDocument) { } + virtual void didStopLoading() { } + + // Notification that some progress was made loading the current frame. + // loadProgress is a value between 0 (nothing loaded) and 1.0 (frame fully + // loaded). + virtual void didChangeLoadProgress(double loadProgress) { } + // A form submission has been requested, but the page's submit event handler // hasn't yet had a chance to run (and possibly alter/interrupt the submit.) - virtual void willSendSubmitEvent(WebFrame*, const WebFormElement&) { } + virtual void willSendSubmitEvent(WebLocalFrame*, const WebFormElement&) { } // A form submission is about to occur. - virtual void willSubmitForm(WebFrame*, const WebFormElement&) { } + virtual void willSubmitForm(WebLocalFrame*, const WebFormElement&) { } // A datasource has been created for a new navigation. The given // datasource will become the provisional datasource for the frame. - virtual void didCreateDataSource(WebFrame*, WebDataSource*) { } + virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { } // A new provisional load has been started. - virtual void didStartProvisionalLoad(WebFrame*) { } + virtual void didStartProvisionalLoad(WebLocalFrame*) { } // The provisional load was redirected via a HTTP 3xx response. - virtual void didReceiveServerRedirectForProvisionalLoad(WebFrame*) { } + virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { } // The provisional load failed. - virtual void didFailProvisionalLoad(WebFrame*, const WebURLError&) { } + virtual void didFailProvisionalLoad(WebLocalFrame*, const WebURLError&) { } // The provisional datasource is now committed. The first part of the // response body has been received, and the encoding of the response // body is known. - virtual void didCommitProvisionalLoad(WebFrame*, bool isNewNavigation) { } + virtual void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHistoryCommitType) { } // The window object for the frame has been cleared of any extra // properties that may have been set by script from the previously // loaded document. - virtual void didClearWindowObject(WebFrame*) { } + virtual void didClearWindowObject(WebLocalFrame* frame) { } // The document element has been created. - virtual void didCreateDocumentElement(WebFrame*) { } + virtual void didCreateDocumentElement(WebLocalFrame*) { } // The page title is available. - virtual void didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction) { } + virtual void didReceiveTitle(WebLocalFrame* frame, const WebString& title, WebTextDirection direction) { } // The icon for the page have changed. - virtual void didChangeIcon(WebFrame*, WebIconURL::Type) { } + virtual void didChangeIcon(WebLocalFrame*, WebIconURL::Type) { } // The frame's document finished loading. - virtual void didFinishDocumentLoad(WebFrame*) { } + virtual void didFinishDocumentLoad(WebLocalFrame*) { } // The 'load' event was dispatched. - virtual void didHandleOnloadEvents(WebFrame*) { } + virtual void didHandleOnloadEvents(WebLocalFrame*) { } // The frame's document or one of its subresources failed to load. - virtual void didFailLoad(WebFrame*, const WebURLError&) { } + virtual void didFailLoad(WebLocalFrame*, const WebURLError&) { } // The frame's document and all of its subresources succeeded to load. - virtual void didFinishLoad(WebFrame*) { } + virtual void didFinishLoad(WebLocalFrame*) { } // The navigation resulted in no change to the documents within the page. // For example, the navigation may have just resulted in scrolling to a // named anchor or a PopState event may have been dispatched. - virtual void didNavigateWithinPage(WebFrame*, bool isNewNavigation) { } + virtual void didNavigateWithinPage(WebLocalFrame*, const WebHistoryItem&, WebHistoryCommitType) { } // Called upon update to scroll position, document state, and other // non-navigational events related to the data held by WebHistoryItem. // WARNING: This method may be called very frequently. - virtual void didUpdateCurrentHistoryItem(WebFrame*) { } + virtual void didUpdateCurrentHistoryItem(WebLocalFrame*) { } + + // The frame's manifest has changed. + virtual void didChangeManifest(WebLocalFrame*) { } + + // TODO: Remove when chromium is changed to use didChangeThemeColor(). + virtual void didChangeBrandColor() { } + + // The frame's theme color has changed. + virtual void didChangeThemeColor() { } + + // Misc ---------------------------------------------------------------- + + // Called to retrieve the provider of desktop notifications. + virtual WebNotificationPresenter* notificationPresenter() { return 0; } + + + // Editing ------------------------------------------------------------- + + // These methods allow the client to intercept and overrule editing + // operations. + virtual void didChangeSelection(bool isSelectionEmpty) { } + + + // Dialogs ------------------------------------------------------------- + + // This method opens the color chooser and returns a new WebColorChooser + // instance. If there is a WebColorChooser already from the last time this + // was called, it ends the color chooser by calling endChooser, and replaces + // it with the new one. The given list of suggestions can be used to show a + // simple interface with a limited set of choices. + + virtual WebColorChooser* createColorChooser( + WebColorChooserClient*, + const WebColor&, + const WebVector<WebColorSuggestion>&) { return 0; } + + // Displays a modal alert dialog containing the given message. Returns + // once the user dismisses the dialog. + virtual void runModalAlertDialog(const WebString& message) { } + + // Displays a modal confirmation dialog with the given message as + // description and OK/Cancel choices. Returns true if the user selects + // 'OK' or false otherwise. + virtual bool runModalConfirmDialog(const WebString& message) { return false; } + + // Displays a modal input dialog with the given message as description + // and OK/Cancel choices. The input field is pre-filled with + // defaultValue. Returns true if the user selects 'OK' or false + // otherwise. Upon returning true, actualValue contains the value of + // the input field. + virtual bool runModalPromptDialog( + const WebString& message, const WebString& defaultValue, + WebString* actualValue) { return false; } + + // Displays a modal confirmation dialog containing the given message as + // description and OK/Cancel choices, where 'OK' means that it is okay + // to proceed with closing the view. Returns true if the user selects + // 'OK' or false otherwise. + virtual bool runModalBeforeUnloadDialog( + bool isReload, const WebString& message) { return true; } + + + // UI ------------------------------------------------------------------ + + // Shows a context menu with commands relevant to a specific element on + // the given frame. Additional context data is supplied. + virtual void showContextMenu(const WebContextMenuData&) { } + + // Called when the data attached to the currently displayed context menu is + // invalidated. The context menu may be closed if possible. + virtual void clearContextMenu() { } // Low-level resource notifications ------------------------------------ // An element will request a resource. - virtual void willRequestResource(WebFrame*, const WebCachedURLRequest&) { } + virtual void willRequestResource(WebLocalFrame*, const WebCachedURLRequest&) { } // The request is after preconnect is triggered. - virtual void willRequestAfterPreconnect(WebFrame*, WebURLRequest&) { } + virtual void willRequestAfterPreconnect(WebLocalFrame*, WebURLRequest&) { } // A request is about to be sent out, and the client may modify it. Request // is writable, and changes to the URL, for example, will change the request // made. If this request is the result of a redirect, then redirectResponse // will be non-null and contain the response that triggered the redirect. virtual void willSendRequest( - WebFrame*, unsigned identifier, WebURLRequest&, + WebLocalFrame*, unsigned identifier, WebURLRequest&, const WebURLResponse& redirectResponse) { } // Response headers have been received for the resource request given // by identifier. virtual void didReceiveResponse( - WebFrame*, unsigned identifier, const WebURLResponse&) { } + WebLocalFrame*, unsigned identifier, const WebURLResponse&) { } virtual void didChangeResourcePriority( - WebFrame*, unsigned identifier, const blink::WebURLRequest::Priority&) { } + WebLocalFrame* webFrame, unsigned identifier, const blink::WebURLRequest::Priority& priority, int) { } // The resource request given by identifier succeeded. virtual void didFinishResourceLoad( - WebFrame*, unsigned identifier) { } + WebLocalFrame*, unsigned identifier) { } // The specified request was satified from WebCore's memory cache. virtual void didLoadResourceFromMemoryCache( - WebFrame*, const WebURLRequest&, const WebURLResponse&) { } + WebLocalFrame*, const WebURLRequest&, const WebURLResponse&) { } // This frame has displayed inactive content (such as an image) from an // insecure source. Inactive content cannot spread to other frames. - virtual void didDisplayInsecureContent(WebFrame*) { } + virtual void didDisplayInsecureContent(WebLocalFrame*) { } // The indicated security origin has run active content (such as a // script) from an insecure source. Note that the insecure content can // spread to other frames in the same origin. - virtual void didRunInsecureContent(WebFrame*, const WebSecurityOrigin&, const WebURL& insecureURL) { } + virtual void didRunInsecureContent(WebLocalFrame*, const WebSecurityOrigin&, const WebURL& insecureURL) { } // A reflected XSS was encountered in the page and suppressed. - virtual void didDetectXSS(WebFrame*, const WebURL&, bool didBlockEntirePage) { } + virtual void didDetectXSS(WebLocalFrame*, const WebURL&, bool didBlockEntirePage) { } // A PingLoader was created, and a request dispatched to a URL. - virtual void didDispatchPingLoader(WebFrame*, const WebURL&) { } + virtual void didDispatchPingLoader(WebLocalFrame*, const WebURL&) { } // The loaders in this frame have been stopped. - virtual void didAbortLoading(WebFrame*) { } + virtual void didAbortLoading(WebLocalFrame*) { } - // Script notifications ------------------------------------------------ - // Script in the page tried to allocate too much memory. - virtual void didExhaustMemoryAvailableForScript(WebFrame*) { } + // Script notifications ------------------------------------------------ // Notifies that a new script context has been created for this frame. // This is similar to didClearWindowObject but only called once per // frame context. - virtual void didCreateScriptContext(WebFrame*, v8::Handle<v8::Context>, int extensionGroup, int worldId) { } + virtual void didCreateScriptContext(WebLocalFrame*, v8::Handle<v8::Context>, int extensionGroup, int worldId) { } // WebKit is about to release its reference to a v8 context for a frame. - virtual void willReleaseScriptContext(WebFrame*, v8::Handle<v8::Context>, int worldId) { } + virtual void willReleaseScriptContext(WebLocalFrame*, v8::Handle<v8::Context>, int worldId) { } + // Geometry notifications ---------------------------------------------- // The frame's document finished the initial non-empty layout of a page. - virtual void didFirstVisuallyNonEmptyLayout(WebFrame*) { } - - // The size of the content area changed. - virtual void didChangeContentsSize(WebFrame*, const WebSize&) { } + virtual void didFirstVisuallyNonEmptyLayout(WebLocalFrame*) { } // The main frame scrolled. - virtual void didChangeScrollOffset(WebFrame*) { } + virtual void didChangeScrollOffset(WebLocalFrame*) { } // If the frame is loading an HTML document, this will be called to // notify that the <body> will be attached soon. - virtual void willInsertBody(WebFrame*) { } + virtual void willInsertBody(WebLocalFrame*) { } + // Find-in-page notifications ------------------------------------------ @@ -313,6 +427,7 @@ public: virtual void reportFindInPageSelection( int identifier, int activeMatchOrdinal, const WebRect& selection) { } + // Quota --------------------------------------------------------- // Requests a new quota size for the origin's storage. @@ -323,22 +438,40 @@ public: // is called with an error code otherwise. // Note that the requesting quota size may not always be granted and // a smaller amount of quota than requested might be returned. - // The callbacks object is deleted when the callback method is called - // and does not need to be (and should not be) deleted manually. virtual void requestStorageQuota( - WebFrame*, WebStorageQuotaType, + WebLocalFrame*, WebStorageQuotaType, unsigned long long newQuotaInBytes, - WebStorageQuotaCallbacks*) { } + WebStorageQuotaCallbacks) { } // WebSocket ----------------------------------------------------- - // A WebSocket object is going to open new stream connection. + // A WebSocket object is going to open a new socket stream connection. Used + // by the old WebSocket implementation. virtual void willOpenSocketStream(WebSocketStreamHandle*) { } + // A WebSocket object is going to open a new WebSocket connection. Used by + // the new WebSocket implementation. + virtual void willOpenWebSocket(WebSocketHandle*) { } + + + // Geolocation --------------------------------------------------------- + + // Access the embedder API for (client-based) geolocation client . + virtual WebGeolocationClient* geolocationClient() { return 0; } + + // MediaStream ----------------------------------------------------- // A new WebRTCPeerConnectionHandler is created. - virtual void willStartUsingPeerConnectionHandler(WebFrame*, WebRTCPeerConnectionHandler*) { } + virtual void willStartUsingPeerConnectionHandler(WebLocalFrame*, WebRTCPeerConnectionHandler*) { } + + virtual WebUserMediaClient* userMediaClient() { return 0; } + + + // Web MIDI ------------------------------------------------------------- + + virtual WebMIDIClient* webMIDIClient() { return 0; } + // Messages ------------------------------------------------------ @@ -346,7 +479,7 @@ public: // gives the embedder a chance to handle it instead of WebKit. Returns true // if the embedder handled it. virtual bool willCheckAndDispatchMessageEvent( - WebFrame* sourceFrame, + WebLocalFrame* sourceFrame, WebFrame* targetFrame, WebSecurityOrigin target, WebDOMMessageEvent event) { return false; } @@ -354,11 +487,12 @@ public: // Asks the embedder if a specific user agent should be used for the given // URL. Non-empty strings indicate an override should be used. Otherwise, // Platform::current()->userAgent() will be called to provide one. - virtual WebString userAgentOverride(WebFrame*, const WebURL& url) { return WebString(); } + virtual WebString userAgentOverride(WebLocalFrame*, const WebURL& url) { return WebString(); } // Asks the embedder what value the network stack will send for the DNT // header. An empty string indicates that no DNT header will be send. - virtual WebString doNotTrackValue(WebFrame*) { return WebString(); } + virtual WebString doNotTrackValue(WebLocalFrame*) { return WebString(); } + // WebGL ------------------------------------------------------ @@ -366,15 +500,28 @@ public: // This call is placed here instead of WebPermissionClient because this // class is implemented in content/, and putting it here avoids adding // more public content/ APIs. - virtual bool allowWebGL(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowWebGL(WebLocalFrame*, bool defaultValue) { return defaultValue; } // Notifies the client that a WebGL context was lost on this page with the // given reason (one of the GL_ARB_robustness status codes; see // Extensions3D.h in WebCore/platform/graphics). - virtual void didLoseWebGLContext(WebFrame*, int) { } + virtual void didLoseWebGLContext(WebLocalFrame*, int) { } + + // FIXME: Remove this method once we have input routing in the browser + // process. See http://crbug.com/339659. + virtual void forwardInputEvent(const WebInputEvent*) { } + + // Send initial drawing parameters to a child frame that is being rendered out of process. + virtual void initializeChildFrame(const WebRect& frameRect, float scaleFactor) { } + + + // Screen Orientation -------------------------------------------------- + + // Access the embedder API for (client-based) screen orientation client . + virtual WebScreenOrientationClient* webScreenOrientationClient() { return 0; } protected: - ~WebFrameClient() { } + virtual ~WebFrameClient() { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebGeolocationClientMock.h b/chromium/third_party/WebKit/public/web/WebGeolocationClientMock.h deleted file mode 100644 index f20e6cc60b8..00000000000 --- a/chromium/third_party/WebKit/public/web/WebGeolocationClientMock.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2010, 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. - */ - -#ifndef WebGeolocationClientMock_h -#define WebGeolocationClientMock_h - -#include "../platform/WebCommon.h" -#include "../platform/WebPrivateOwnPtr.h" -#include "WebGeolocationClient.h" - -namespace WebCore { -class GeolocationClientMock; -} - -namespace blink { -class WebGeolocationPosition; -class WebString; - -class WebGeolocationClientMock : public WebGeolocationClient { -public: - BLINK_EXPORT static WebGeolocationClientMock* create(); - ~WebGeolocationClientMock() { reset(); } - - BLINK_EXPORT void setPosition(double latitude, double longitude, double accuracy); - BLINK_EXPORT void setPositionUnavailableError(const WebString& message); - BLINK_EXPORT void setPermission(bool); - BLINK_EXPORT int numberOfPendingPermissionRequests() const; - BLINK_EXPORT void resetMock(); - - virtual void startUpdating(); - virtual void stopUpdating(); - virtual void setEnableHighAccuracy(bool); - - virtual void geolocationDestroyed(); - virtual void setController(WebGeolocationController*); - - virtual void requestPermission(const WebGeolocationPermissionRequest&); - virtual void cancelPermissionRequest(const WebGeolocationPermissionRequest&); - - virtual bool lastPosition(WebGeolocationPosition& webPosition); - -private: - WebGeolocationClientMock(); - BLINK_EXPORT void reset(); - - WebPrivateOwnPtr<WebCore::GeolocationClientMock> m_clientMock; -}; -} - -#endif // WebGeolocationClientMock_h diff --git a/chromium/third_party/WebKit/public/web/WebGeolocationError.h b/chromium/third_party/WebKit/public/web/WebGeolocationError.h index 949b3ccec68..6e25662176f 100644 --- a/chromium/third_party/WebKit/public/web/WebGeolocationError.h +++ b/chromium/third_party/WebKit/public/web/WebGeolocationError.h @@ -29,10 +29,6 @@ #include "../platform/WebCommon.h" #include "../platform/WebPrivatePtr.h" -#if BLINK_IMPLEMENTATION -#include "wtf/PassRefPtr.h" -#endif - namespace WebCore { class GeolocationError; } namespace blink { @@ -55,9 +51,9 @@ public: BLINK_EXPORT void reset(); #if BLINK_IMPLEMENTATION - WebGeolocationError(WTF::PassRefPtr<WebCore::GeolocationError>); - WebGeolocationError& operator=(WTF::PassRefPtr<WebCore::GeolocationError>); - operator WTF::PassRefPtr<WebCore::GeolocationError>() const; + WebGeolocationError(WebCore::GeolocationError*); + WebGeolocationError& operator=(WebCore::GeolocationError*); + operator WebCore::GeolocationError*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h b/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h index 5236f6d2587..38ed97a41e4 100644 --- a/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h +++ b/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h @@ -43,20 +43,19 @@ class WebSecurityOrigin; // WebGeolocationClient::cancelPermissionRequest (request cancelled). class WebGeolocationPermissionRequest { public: + ~WebGeolocationPermissionRequest() { reset(); } BLINK_EXPORT WebSecurityOrigin securityOrigin() const; BLINK_EXPORT void setIsAllowed(bool); #if BLINK_IMPLEMENTATION - WebGeolocationPermissionRequest(WebCore::Geolocation* geolocation) - : m_private(geolocation) - { - } - - WebCore::Geolocation* geolocation() const { return m_private; } + WebGeolocationPermissionRequest(WebCore::Geolocation*); + WebCore::Geolocation* geolocation() const { return m_private.get(); } #endif private: - WebCore::Geolocation* m_private; + BLINK_EXPORT void reset(); + + WebPrivatePtr<WebCore::Geolocation> m_private; }; } diff --git a/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequestManager.h b/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequestManager.h index eca31d6b04d..23c3edd1444 100644 --- a/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequestManager.h +++ b/chromium/third_party/WebKit/public/web/WebGeolocationPermissionRequestManager.h @@ -54,7 +54,6 @@ private: BLINK_EXPORT void reset(); WebPrivateOwnPtr<WebGeolocationPermissionRequestManagerPrivate> m_private; - int m_lastId; }; } diff --git a/chromium/third_party/WebKit/public/web/WebGeolocationPosition.h b/chromium/third_party/WebKit/public/web/WebGeolocationPosition.h index 84d13636327..43ad42a6d42 100644 --- a/chromium/third_party/WebKit/public/web/WebGeolocationPosition.h +++ b/chromium/third_party/WebKit/public/web/WebGeolocationPosition.h @@ -29,10 +29,6 @@ #include "../platform/WebCommon.h" #include "../platform/WebPrivatePtr.h" -#if BLINK_IMPLEMENTATION -#include "wtf/PassRefPtr.h" -#endif - namespace WebCore { class GeolocationPosition; } namespace blink { @@ -52,9 +48,9 @@ public: BLINK_EXPORT void reset(); #if BLINK_IMPLEMENTATION - WebGeolocationPosition(WTF::PassRefPtr<WebCore::GeolocationPosition>); - WebGeolocationPosition& operator=(WTF::PassRefPtr<WebCore::GeolocationPosition>); - operator WTF::PassRefPtr<WebCore::GeolocationPosition>() const; + WebGeolocationPosition(WebCore::GeolocationPosition*); + WebGeolocationPosition& operator=(WebCore::GeolocationPosition*); + operator WebCore::GeolocationPosition*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/web/gtk/WebInputEventFactory.h b/chromium/third_party/WebKit/public/web/WebHeap.h index aa55faceb91..6f23c21fa6c 100644 --- a/chromium/third_party/WebKit/public/web/gtk/WebInputEventFactory.h +++ b/chromium/third_party/WebKit/public/web/WebHeap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2014 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 @@ -28,32 +28,34 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebInputEventFactory_h -#define WebInputEventFactory_h +#ifndef WebHeap_h +#define WebHeap_h -#include "../../platform/WebCommon.h" - -typedef struct _GdkEventButton GdkEventButton; -typedef struct _GdkEventMotion GdkEventMotion; -typedef struct _GdkEventCrossing GdkEventCrossing; -typedef struct _GdkEventScroll GdkEventScroll; -typedef struct _GdkEventKey GdkEventKey; +#include "public/platform/WebCommon.h" namespace blink { -class WebKeyboardEvent; -class WebMouseEvent; -class WebMouseWheelEvent; - -class WebInputEventFactory { +class WebHeap { public: - BLINK_EXPORT static WebKeyboardEvent keyboardEvent(const GdkEventKey*); - BLINK_EXPORT static WebKeyboardEvent keyboardEvent(wchar_t character, int state, double timeStampSeconds); - BLINK_EXPORT static WebMouseEvent mouseEvent(const GdkEventButton*); - BLINK_EXPORT static WebMouseEvent mouseEvent(const GdkEventMotion*); - BLINK_EXPORT static WebMouseEvent mouseEvent(const GdkEventCrossing*); - BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(const GdkEventScroll*); - BLINK_EXPORT static bool isSystemKeyEvent(const WebKeyboardEvent&); + // Attach thread to the garbage collector managed heap. Thread can + // allocate or use garbage collector managed objects only while it is + // attached. + BLINK_EXPORT static void attachThread(); + + // Detach thread from the garbage collector managed heap. Thread can + // no longer allocate or use garbage collector managed objects. + BLINK_EXPORT static void detachThread(); + + // While this object is active on the stack current thread is marked as + // being at safepoint. It can't manipulate garbage collector managed objects + // until it leaves safepoint, but it can block indefinitely. + // When thread is not at safe-point it must not block indefinitely because + // garbage collector might want to stop it. + class SafePointScope { + public: + BLINK_EXPORT SafePointScope(); + BLINK_EXPORT ~SafePointScope(); + }; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebHelperPlugin.h b/chromium/third_party/WebKit/public/web/WebHelperPlugin.h index cb96a14a8fa..57ec1fd2f1b 100644 --- a/chromium/third_party/WebKit/public/web/WebHelperPlugin.h +++ b/chromium/third_party/WebKit/public/web/WebHelperPlugin.h @@ -32,29 +32,43 @@ #define WebHelperPlugin_h #include "../platform/WebCommon.h" -#include "WebWidget.h" +#include "WebFrame.h" namespace blink { -class WebFrameClient; class WebPlugin; -class WebWidgetClient; +class WebString; -class WebHelperPlugin : public WebWidget { +class WebHelperPlugin { public: - BLINK_EXPORT static WebHelperPlugin* create(WebWidgetClient*); + // May return null if initialization fails. If the returned pointer is + // non-null, the caller must free it by calling destroy(). + BLINK_EXPORT static WebHelperPlugin* create(const WebString& PluginType, WebLocalFrame*); - virtual void initializeFrame(WebFrameClient*) = 0; - - // The returned pointer may be 0 even if initialization was successful. - // For example, if the plugin cannot be found or the plugin is disabled. - // If not 0, the returned pointer is valid for the lifetime of this object. + // Returns a WebPlugin corresponding to the instantiated plugin. This will + // never return null. virtual WebPlugin* getPlugin() = 0; + // Initiates destruction of the WebHelperPlugin. + virtual void destroy() = 0; + protected: - ~WebHelperPlugin() { } + virtual ~WebHelperPlugin() { } }; } // namespace blink +namespace WTF { + +template<typename T> struct OwnedPtrDeleter; +template<> struct OwnedPtrDeleter<blink::WebHelperPlugin> { + static void deletePtr(blink::WebHelperPlugin* plugin) + { + if (plugin) + plugin->destroy(); + } +}; + +} // namespace WTF + #endif diff --git a/chromium/third_party/WebKit/public/web/WebHistoryCommitType.h b/chromium/third_party/WebKit/public/web/WebHistoryCommitType.h new file mode 100644 index 00000000000..d0c7138e55b --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebHistoryCommitType.h @@ -0,0 +1,29 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebHistoryCommitType_h +#define WebHistoryCommitType_h + +namespace blink { + +enum WebHistoryCommitType { + // The default case (link clicks, user-typed urls, etc.), appends + // a new history entry to the back/forward list. + WebStandardCommit, + // A load that originated from history, whether from the + // back/forward list or session restore. The back/forward list is + // not modified, but our position in the list is. + WebBackForwardCommit, + // Each history entry is represented by a tree, where each node + // contains the history state of a single frame in the page. Initial + // loads in a new subframe append a new node to that tree. + WebInitialCommitInChildFrame, + // Reloads, client redirects, etc. Loads that neither originate from + // nor add entries to the back/forward list. + WebHistoryInertCommit +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/web/WebHistoryItem.h b/chromium/third_party/WebKit/public/web/WebHistoryItem.h index a9084030415..a35f6eb8535 100644 --- a/chromium/third_party/WebKit/public/web/WebHistoryItem.h +++ b/chromium/third_party/WebKit/public/web/WebHistoryItem.h @@ -33,6 +33,7 @@ #include "../platform/WebCommon.h" #include "../platform/WebPrivatePtr.h" +#include "../platform/WebReferrerPolicy.h" namespace WebCore { class HistoryItem; } @@ -40,9 +41,15 @@ namespace blink { class WebHTTPBody; class WebString; class WebSerializedScriptValue; +struct WebFloatPoint; struct WebPoint; template <typename T> class WebVector; +enum WebHistoryLoadType { + WebHistorySameDocumentLoad, + WebHistoryDifferentDocumentLoad +}; + // Represents a frame-level navigation entry in session history. A // WebHistoryItem is a node in a tree. // @@ -69,15 +76,16 @@ public: BLINK_EXPORT WebString urlString() const; BLINK_EXPORT void setURLString(const WebString&); - BLINK_EXPORT WebString originalURLString() const; - BLINK_EXPORT void setOriginalURLString(const WebString&); - BLINK_EXPORT WebString referrer() const; - BLINK_EXPORT void setReferrer(const WebString&); + BLINK_EXPORT WebReferrerPolicy referrerPolicy() const; + BLINK_EXPORT void setReferrer(const WebString&, WebReferrerPolicy); BLINK_EXPORT WebString target() const; BLINK_EXPORT void setTarget(const WebString&); + BLINK_EXPORT WebFloatPoint pinchViewportScrollOffset() const; + BLINK_EXPORT void setPinchViewportScrollOffset(const WebFloatPoint&); + BLINK_EXPORT WebPoint scrollOffset() const; BLINK_EXPORT void setScrollOffset(const WebPoint&); @@ -93,9 +101,6 @@ public: BLINK_EXPORT long long documentSequenceNumber() const; BLINK_EXPORT void setDocumentSequenceNumber(long long); - BLINK_EXPORT long long targetFrameID() const; - BLINK_EXPORT void setTargetFrameID(long long); - BLINK_EXPORT WebSerializedScriptValue stateObject() const; BLINK_EXPORT void setStateObject(const WebSerializedScriptValue&); @@ -105,10 +110,6 @@ public: BLINK_EXPORT WebHTTPBody httpBody() const; BLINK_EXPORT void setHTTPBody(const WebHTTPBody&); - BLINK_EXPORT WebVector<WebHistoryItem> children() const; - BLINK_EXPORT void setChildren(const WebVector<WebHistoryItem>&); - BLINK_EXPORT void appendToChildren(const WebHistoryItem&); - BLINK_EXPORT WebVector<WebString> getReferencedFilePaths() const; #if BLINK_IMPLEMENTATION @@ -118,7 +119,6 @@ public: #endif private: - void ensureMutable(); WebPrivatePtr<WebCore::HistoryItem> m_private; }; diff --git a/chromium/third_party/WebKit/public/web/WebIconURL.h b/chromium/third_party/WebKit/public/web/WebIconURL.h index 429c5c36bee..98450d97565 100644 --- a/chromium/third_party/WebKit/public/web/WebIconURL.h +++ b/chromium/third_party/WebKit/public/web/WebIconURL.h @@ -34,7 +34,9 @@ #if BLINK_IMPLEMENTATION #include "core/dom/IconURL.h" #endif -#include "../platform/WebURL.h" +#include "public/platform/WebSize.h" +#include "public/platform/WebURL.h" +#include "public/platform/WebVector.h" namespace blink { @@ -68,10 +70,16 @@ public: return m_iconURL; } + const WebVector<WebSize>& sizes() const + { + return m_sizes; + } + #if BLINK_IMPLEMENTATION WebIconURL(const WebCore::IconURL& iconURL) : m_iconType(static_cast<Type>(iconURL.m_iconType)) , m_iconURL(iconURL.m_iconURL) + , m_sizes(iconURL.m_sizes) { } #endif @@ -79,6 +87,7 @@ public: private: Type m_iconType; WebURL m_iconURL; + WebVector<WebSize> m_sizes; }; } diff --git a/chromium/third_party/WebKit/public/web/WebInputElement.h b/chromium/third_party/WebKit/public/web/WebInputElement.h index c74de0bdb8e..86cf6f1e145 100644 --- a/chromium/third_party/WebKit/public/web/WebInputElement.h +++ b/chromium/third_party/WebKit/public/web/WebInputElement.h @@ -39,17 +39,11 @@ namespace WebCore { class HTMLInputElement; } namespace blink { - class WebNodeCollection; + class WebElementCollection; // Provides readonly access to some properties of a DOM input element node. class WebInputElement : public WebFormControlElement { public: - enum SpeechInputState { - Idle, - Recording, - Recognizing, - }; - WebInputElement() : WebFormControlElement() { } WebInputElement(const WebInputElement& element) : WebFormControlElement(element) { } @@ -69,52 +63,33 @@ namespace blink { BLINK_EXPORT bool isImageButton() const; BLINK_EXPORT bool isRadioButton() const; BLINK_EXPORT bool isCheckbox() const; - BLINK_EXPORT bool autoComplete() const; BLINK_EXPORT int maxLength() const; - BLINK_EXPORT bool isActivatedSubmit() const; BLINK_EXPORT void setActivatedSubmit(bool); BLINK_EXPORT int size() const; - BLINK_EXPORT void setValue(const WebString&, bool sendChangeEvent = false); - BLINK_EXPORT void setChecked(bool, bool sendChangeEvent = false); - BLINK_EXPORT WebString value() const; - // This returns the non-sanitized, exact value inside the text field. - BLINK_EXPORT WebString editingValue() const; + BLINK_EXPORT void setChecked(bool, bool sendEvents = false); // Sets the value inside the text field without being sanitized. // Can't be used if a renderer doesn't exist or on a non text field type. // Caret will be moved to the end. BLINK_EXPORT void setEditingValue(const WebString&); - BLINK_EXPORT void setSuggestedValue(const WebString&); - BLINK_EXPORT WebString suggestedValue() const; - BLINK_EXPORT void setSelectionRange(int, int); - BLINK_EXPORT int selectionStart() const; - BLINK_EXPORT int selectionEnd() const; BLINK_EXPORT bool isValidValue(const WebString&) const; BLINK_EXPORT bool isChecked() const; BLINK_EXPORT bool isMultiple() const; - BLINK_EXPORT WebNodeCollection dataListOptions() const; + BLINK_EXPORT WebElementCollection dataListOptions() const; // Return the localized value for this input type. BLINK_EXPORT WebString localizeValue(const WebString&) const; - BLINK_EXPORT bool isSpeechInputEnabled() const; - BLINK_EXPORT SpeechInputState getSpeechInputState() const; - BLINK_EXPORT void startSpeechInput(); - BLINK_EXPORT void stopSpeechInput(); - // Exposes the default value of the maxLength attribute. BLINK_EXPORT static int defaultMaxLength(); - // Returns the direction of the text in this element. - BLINK_EXPORT WebString directionForFormData() const; - - BLINK_EXPORT WebElement decorationElementFor(void*); - BLINK_EXPORT WebElement passwordGeneratorButtonElement() const; + // If true, forces the text of the element to be visible. + BLINK_EXPORT void setShouldRevealPassword(bool value); #if BLINK_IMPLEMENTATION - WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); - WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); - operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const; + WebInputElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLInputElement>&); + WebInputElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLInputElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLInputElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebInputEvent.h b/chromium/third_party/WebKit/public/web/WebInputEvent.h index 69687fc27b0..58c4a0bb39e 100644 --- a/chromium/third_party/WebKit/public/web/WebInputEvent.h +++ b/chromium/third_party/WebKit/public/web/WebInputEvent.h @@ -32,6 +32,7 @@ #define WebInputEvent_h #include "../platform/WebCommon.h" +#include "../platform/WebGestureDevice.h" #include "../platform/WebRect.h" #include "WebTouchPoint.h" @@ -58,15 +59,6 @@ namespace blink { class WebInputEvent { public: - WebInputEvent(unsigned sizeParam = sizeof(WebInputEvent)) - { - memset(this, 0, sizeParam); - timeStampSeconds = 0.0; - size = sizeParam; - type = Undefined; - modifiers = 0; - } - // When we use an input method (or an input method editor), we receive // two events for a keypress. The former event is a keydown, which // provides a keycode, and the latter is a textinput, which provides @@ -93,26 +85,32 @@ public: enum Type { Undefined = -1, + TypeFirst = Undefined, // WebMouseEvent MouseDown, + MouseTypeFirst = MouseDown, MouseUp, MouseMove, MouseEnter, MouseLeave, ContextMenu, + MouseTypeLast = ContextMenu, // WebMouseWheelEvent MouseWheel, // WebKeyboardEvent RawKeyDown, + KeyboardTypeFirst = RawKeyDown, KeyDown, KeyUp, Char, + KeyboardTypeLast = Char, // WebGestureEvent GestureScrollBegin, + GestureTypeFirst = GestureScrollBegin, GestureScrollEnd, GestureScrollUpdate, GestureScrollUpdateWithoutPropagation, @@ -130,12 +128,17 @@ public: GesturePinchBegin, GesturePinchEnd, GesturePinchUpdate, + GestureTypeLast = GesturePinchUpdate, // WebTouchEvent TouchStart, + TouchTypeFirst = TouchStart, TouchMove, TouchEnd, TouchCancel, + TouchTypeLast = TouchCancel, + + TypeLast = TouchTypeLast }; enum Modifiers { @@ -183,63 +186,35 @@ public: // Returns true if the WebInputEvent |type| is a mouse event. static bool isMouseEventType(int type) { - return type == MouseDown - || type == MouseUp - || type == MouseMove - || type == MouseEnter - || type == MouseLeave - || type == ContextMenu; + return MouseTypeFirst <= type && type <= MouseTypeLast; } // Returns true if the WebInputEvent |type| is a keyboard event. static bool isKeyboardEventType(int type) { - return type == RawKeyDown - || type == KeyDown - || type == KeyUp - || type == Char; + return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; } // Returns true if the WebInputEvent |type| is a touch event. static bool isTouchEventType(int type) { - return type == TouchStart - || type == TouchMove - || type == TouchEnd - || type == TouchCancel; + return TouchTypeFirst <= type && type <= TouchTypeLast; } - // Returns true if the WebInputEvent |type| should be handled as user gesture. - static bool isUserGestureEventType(int type) + // Returns true if the WebInputEvent is a gesture event. + static bool isGestureEventType(int type) { - return isKeyboardEventType(type) - || type == MouseDown - || type == MouseUp - || type == TouchStart - || type == TouchEnd; + return GestureTypeFirst <= type && type <= GestureTypeLast; } - // Returns true if the WebInputEvent is a gesture event. - static bool isGestureEventType(int type) +protected: + explicit WebInputEvent(unsigned sizeParam) { - return type == GestureScrollBegin - || type == GestureScrollEnd - || type == GestureScrollUpdate - || type == GestureScrollUpdateWithoutPropagation - || type == GestureFlingStart - || type == GestureFlingCancel - || type == GesturePinchBegin - || type == GesturePinchEnd - || type == GesturePinchUpdate - || type == GestureTap - || type == GestureTapUnconfirmed - || type == GestureTapDown - || type == GestureTapCancel - || type == GestureShowPress - || type == GestureDoubleTap - || type == GestureTwoFingerTap - || type == GestureLongPress - || type == GestureLongTap; + memset(this, 0, sizeParam); + timeStampSeconds = 0.0; + size = sizeParam; + type = Undefined; + modifiers = 0; } }; @@ -291,8 +266,8 @@ public: // This is a string identifying the key pressed. char keyIdentifier[keyIdentifierLengthCap]; - WebKeyboardEvent(unsigned sizeParam = sizeof(WebKeyboardEvent)) - : WebInputEvent(sizeParam) + WebKeyboardEvent() + : WebInputEvent(sizeof(WebKeyboardEvent)) , windowsKeyCode(0) , nativeKeyCode(0) , isSystemKey(false) @@ -314,7 +289,6 @@ public: class WebMouseEvent : public WebInputEvent { public: - // These values defined for WebCore::MouseButton enum Button { ButtonNone = -1, ButtonLeft, @@ -333,7 +307,23 @@ public: int movementY; int clickCount; - WebMouseEvent(unsigned sizeParam = sizeof(WebMouseEvent)) + WebMouseEvent() + : WebInputEvent(sizeof(WebMouseEvent)) + , button(ButtonNone) + , x(0) + , y(0) + , windowX(0) + , windowY(0) + , globalX(0) + , globalY(0) + , movementX(0) + , movementY(0) + , clickCount(0) + { + } + +protected: + explicit WebMouseEvent(unsigned sizeParam) : WebInputEvent(sizeParam) , button(ButtonNone) , x(0) @@ -379,8 +369,26 @@ public: Phase phase; Phase momentumPhase; - WebMouseWheelEvent(unsigned sizeParam = sizeof(WebMouseWheelEvent)) - : WebMouseEvent(sizeParam) + // See comment at the top of the file for why an int is used here. + // Rubberbanding is an OSX visual effect. When a user scrolls the content + // area with a track pad, and the content area is already at its limit in + // the direction being scrolled, the entire content area is allowed to + // scroll slightly off screen, revealing a grey background. When the user + // lets go, the content area snaps back into place. Blink is responsible + // for this rubberbanding effect, but the embedder may wish to disable + // rubber banding in the left or right direction, if the scroll should have + // an alternate effect. The common case is that a scroll in the left or + // right directions causes a back or forwards navigation, respectively. + // + // These flags prevent rubber banding from starting in a given direction, + // but have no effect on an ongoing rubber banding. A rubber banding that + // started in the vertical direction is allowed to continue in the right + // direction, even if canRubberbandRight is 0. + int canRubberbandLeft; + int canRubberbandRight; + + WebMouseWheelEvent() + : WebMouseEvent(sizeof(WebMouseWheelEvent)) , deltaX(0.0f) , deltaY(0.0f) , wheelTicksX(0.0f) @@ -391,6 +399,8 @@ public: , hasPreciseScrollingDeltas(false) , phase(PhaseNone) , momentumPhase(PhaseNone) + , canRubberbandLeft(true) + , canRubberbandRight(true) { } }; @@ -399,18 +409,15 @@ public: class WebGestureEvent : public WebInputEvent { public: - enum SourceDevice { - Touchpad, - Touchscreen, - }; - int x; int y; int globalX; int globalY; - SourceDevice sourceDevice; + WebGestureDevice sourceDevice; union { + // Tap information must be set for GestureTap, GestureTapUnconfirmed, + // and GestureDoubleTap events. struct { int tapCount; float width; @@ -438,6 +445,13 @@ public: } twoFingerTap; struct { + // Initial motion that triggered the scroll. + // May be redundant with deltaX/deltaY in the first scrollUpdate. + float deltaXHint; + float deltaYHint; + } scrollBegin; + + struct { float deltaX; float deltaY; float velocityX; @@ -454,8 +468,8 @@ public: } pinchUpdate; } data; - WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent)) - : WebInputEvent(sizeParam) + WebGestureEvent() + : WebInputEvent(sizeof(WebGestureEvent)) , x(0) , y(0) , globalX(0) @@ -485,11 +499,17 @@ public: // List of all touches which are currently down and are targeting the event recipient. WebTouchPoint targetTouches[touchesLengthCap]; - WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent)) - : WebInputEvent(sizeParam) + // Whether the event can be canceled (with preventDefault). If true then the browser + // must wait for an ACK for this event. If false then no ACK IPC is expected. + // See comment at the top for why an int is used here instead of a bool. + int cancelable; + + WebTouchEvent() + : WebInputEvent(sizeof(WebTouchEvent)) , touchesLength(0) , changedTouchesLength(0) , targetTouchesLength(0) + , cancelable(true) { } }; diff --git a/chromium/third_party/WebKit/public/web/WebKit.h b/chromium/third_party/WebKit/public/web/WebKit.h index 6b4382f46ed..fedf1ff6170 100644 --- a/chromium/third_party/WebKit/public/web/WebKit.h +++ b/chromium/third_party/WebKit/public/web/WebKit.h @@ -74,6 +74,10 @@ BLINK_EXPORT void shutdownWithoutV8(); BLINK_EXPORT void setLayoutTestMode(bool); BLINK_EXPORT bool layoutTestMode(); +// Alters the rendering of fonts for layout tests. +BLINK_EXPORT void setFontAntialiasingEnabledForTest(bool); +BLINK_EXPORT bool fontAntialiasingEnabledForTest(); + // Enables the named log channel. See WebCore/platform/Logging.h for details. BLINK_EXPORT void enableLogChannel(const char*); diff --git a/chromium/third_party/WebKit/public/web/WebLabelElement.h b/chromium/third_party/WebKit/public/web/WebLabelElement.h index f1ed8516123..8efa52d6387 100644 --- a/chromium/third_party/WebKit/public/web/WebLabelElement.h +++ b/chromium/third_party/WebKit/public/web/WebLabelElement.h @@ -57,9 +57,9 @@ public: BLINK_EXPORT WebElement correspondingControl(); #if BLINK_IMPLEMENTATION - WebLabelElement(const WTF::PassRefPtr<WebCore::HTMLLabelElement>&); - WebLabelElement& operator=(const WTF::PassRefPtr<WebCore::HTMLLabelElement>&); - operator WTF::PassRefPtr<WebCore::HTMLLabelElement>() const; + WebLabelElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLLabelElement>&); + WebLabelElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLLabelElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLLabelElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebLeakDetector.h b/chromium/third_party/WebKit/public/web/WebLeakDetector.h new file mode 100644 index 00000000000..187b86c9a11 --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebLeakDetector.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef WebLeakDetector_h +#define WebLeakDetector_h + +#include "WebFrame.h" +#include "public/platform/WebCommon.h" + +namespace blink { + +class WebLeakDetectorClient { +public: + struct Result { + unsigned numberOfLiveNodes; + unsigned numberOfLiveDocuments; + }; + + virtual void onLeakDetectionComplete(const Result&) = 0; +}; + +class WebLeakDetector { +public: + virtual ~WebLeakDetector() { } + + BLINK_EXPORT static WebLeakDetector* create(WebLeakDetectorClient*); + + // Cleans up the DOM objects and counts them. |WebLeakDetectorClient::onLeakDetectionComplete()| is called when done. + // This is supposed to be used for detecting DOM-object leaks. + virtual void collectGarbageAndGetDOMCounts(WebLocalFrame*) = 0; + + // FIXME: old API to be removed. + static void collectGarbargeAndGetDOMCounts(WebLocalFrame*, unsigned*, unsigned*) { } +}; + +} // namespace blink + +#endif // WebLeakDetector_h diff --git a/chromium/third_party/WebKit/public/web/WebLocalFrame.h b/chromium/third_party/WebKit/public/web/WebLocalFrame.h new file mode 100644 index 00000000000..333748b65d2 --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebLocalFrame.h @@ -0,0 +1,41 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebLocalFrame_h +#define WebLocalFrame_h + +#include "WebFrame.h" + +namespace blink { + +// Interface for interacting with in process frames. This contains methods that +// require interacting with a frame's document. +// FIXME: Move lots of methods from WebFrame in here. +class WebLocalFrame : public WebFrame { +public: + // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). + // It is valid to pass a null client pointer. + BLINK_EXPORT static WebLocalFrame* create(WebFrameClient*); + + // Returns the WebFrame associated with the current V8 context. This + // function can return 0 if the context is associated with a Document that + // is not currently being displayed in a Frame. + BLINK_EXPORT static WebLocalFrame* frameForCurrentContext(); + + // Returns the frame corresponding to the given context. This can return 0 + // if the context is detached from the frame, or if the context doesn't + // correspond to a frame (e.g., workers). + BLINK_EXPORT static WebLocalFrame* frameForContext(v8::Handle<v8::Context>); + + // Returns the frame inside a given frame or iframe element. Returns 0 if + // the given element is not a frame, iframe or if the frame is empty. + BLINK_EXPORT static WebLocalFrame* fromFrameOwnerElement(const WebElement&); + + // Navigation Transitions --------------------------------------------- + virtual void addStyleSheetByURL(const WebString& url) = 0; +}; + +} // namespace blink + +#endif // WebLocalFrame_h diff --git a/chromium/third_party/WebKit/public/web/WebMIDIClient.h b/chromium/third_party/WebKit/public/web/WebMIDIClient.h index 9435b938b2d..157c6be9db8 100644 --- a/chromium/third_party/WebKit/public/web/WebMIDIClient.h +++ b/chromium/third_party/WebKit/public/web/WebMIDIClient.h @@ -38,10 +38,17 @@ class WebMIDIClient { public: virtual ~WebMIDIClient() { } - // Request a permission to use system exclusive messages. Called when MIDIOptions.sysex is true. - virtual void requestSysExPermission(const WebMIDIPermissionRequest&) = 0; - // Cancel the request since the requesting frame may be moving to a new page. - virtual void cancelSysExPermissionRequest(const WebMIDIPermissionRequest&) = 0; + // Request a permission to use system exclusive messages. Called when + // MIDIOptions.sysex is true. + // Once the request is done, any WebMIDIPermissionRequest instances equal to + // |request| must not be accessed after that. + virtual void requestSysexPermission(const WebMIDIPermissionRequest& /* request */) = 0; + + // Cancel the request since the requesting frame may be moving to + // a new page. + // Once canceled, any WebMIDIPermissionRequest instances equal to + // |request| must not be accessed after that. + virtual void cancelSysexPermissionRequest(const WebMIDIPermissionRequest& /* request */) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebMIDIClientMock.h b/chromium/third_party/WebKit/public/web/WebMIDIClientMock.h index 95ba401fa2c..0ed583386a8 100644 --- a/chromium/third_party/WebKit/public/web/WebMIDIClientMock.h +++ b/chromium/third_party/WebKit/public/web/WebMIDIClientMock.h @@ -46,12 +46,12 @@ public: BLINK_EXPORT WebMIDIClientMock(); virtual ~WebMIDIClientMock() { reset(); } - BLINK_EXPORT void setSysExPermission(bool); + BLINK_EXPORT void setSysexPermission(bool); BLINK_EXPORT void resetMock(); // WebMIDIClient - virtual void requestSysExPermission(const WebMIDIPermissionRequest&) OVERRIDE; - virtual void cancelSysExPermissionRequest(const WebMIDIPermissionRequest&) OVERRIDE; + virtual void requestSysexPermission(const WebMIDIPermissionRequest&) OVERRIDE; + virtual void cancelSysexPermissionRequest(const WebMIDIPermissionRequest&) OVERRIDE; private: BLINK_EXPORT void reset(); diff --git a/chromium/third_party/WebKit/public/web/WebMIDIPermissionRequest.h b/chromium/third_party/WebKit/public/web/WebMIDIPermissionRequest.h index fde2901c836..b863fe35eb5 100644 --- a/chromium/third_party/WebKit/public/web/WebMIDIPermissionRequest.h +++ b/chromium/third_party/WebKit/public/web/WebMIDIPermissionRequest.h @@ -32,42 +32,37 @@ #define WebMIDIPermissionRequest_h #include "../platform/WebCommon.h" -#include "../platform/WebPrivatePtr.h" namespace WebCore { -class MIDIAccess; +class MIDIAccessInitializer; } namespace blink { class WebSecurityOrigin; -// WebMIDIPermissionRequest encapsulates a WebCore MIDIAccess object and represents -// a request from WebCore for permissions. -// The underlying MIDIAccess object is guaranteed to be valid until the invocation of -// either WebMIDIPermissionRequest::setIsAllowed (request complete) or -// WebMIDIClient::cancelPermissionRequest (request canceled). +// WebMIDIPermissionRequest encapsulates a WebCore MIDIAccessInitializer +// object and represents a request from WebCore for permissions. +// The request must not outlive the underlying initializer object. +// In other words, the request must be canceled when the underlying +// initializer dies while requesting, class WebMIDIPermissionRequest { public: - WebMIDIPermissionRequest(const WebMIDIPermissionRequest& o) { assign(o); } - ~WebMIDIPermissionRequest() { reset(); }; - + BLINK_EXPORT WebMIDIPermissionRequest(const WebMIDIPermissionRequest& other) + : m_initializer(other.m_initializer) { } BLINK_EXPORT WebSecurityOrigin securityOrigin() const; BLINK_EXPORT void setIsAllowed(bool); - BLINK_EXPORT void reset(); - BLINK_EXPORT void assign(const WebMIDIPermissionRequest&); BLINK_EXPORT bool equals(const WebMIDIPermissionRequest&) const; #if BLINK_IMPLEMENTATION - explicit WebMIDIPermissionRequest(const PassRefPtr<WebCore::MIDIAccess>&); - explicit WebMIDIPermissionRequest(WebCore::MIDIAccess*); + explicit WebMIDIPermissionRequest(WebCore::MIDIAccessInitializer*); - WebCore::MIDIAccess* midiAccess() const { return m_private.get(); } + WebCore::MIDIAccessInitializer* midiAccessInitializer() const { return m_initializer; } #endif private: - WebPrivatePtr<WebCore::MIDIAccess> m_private; + WebCore::MIDIAccessInitializer* m_initializer; }; inline bool operator==(const WebMIDIPermissionRequest& a, const WebMIDIPermissionRequest& b) diff --git a/chromium/third_party/WebKit/public/web/WebMediaDevicesRequest.h b/chromium/third_party/WebKit/public/web/WebMediaDevicesRequest.h new file mode 100644 index 00000000000..268df831f26 --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebMediaDevicesRequest.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2014 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``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 GOOGLE INC. 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. + */ + +#ifndef WebMediaDevicesRequest_h +#define WebMediaDevicesRequest_h + +#include "WebSecurityOrigin.h" +#include "public/platform/WebCommon.h" +#include "public/platform/WebPrivatePtr.h" +#include "public/platform/WebString.h" + +namespace WebCore { +class MediaDevicesRequest; +} + +namespace blink { +class WebDocument; +class WebMediaDeviceInfo; +template <typename T> class WebVector; + +class WebMediaDevicesRequest { +public: + WebMediaDevicesRequest() { } + WebMediaDevicesRequest(const WebMediaDevicesRequest& request) { assign(request); } + ~WebMediaDevicesRequest() { reset(); } + + WebMediaDevicesRequest& operator=(const WebMediaDevicesRequest& other) + { + assign(other); + return *this; + } + + BLINK_EXPORT void reset(); + bool isNull() const { return m_private.isNull(); } + BLINK_EXPORT bool equals(const WebMediaDevicesRequest&) const; + BLINK_EXPORT void assign(const WebMediaDevicesRequest&); + + BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_EXPORT WebDocument ownerDocument() const; + + BLINK_EXPORT void requestSucceeded(WebVector<WebMediaDeviceInfo>); + +#if BLINK_IMPLEMENTATION + WebMediaDevicesRequest(const PassRefPtrWillBeRawPtr<WebCore::MediaDevicesRequest>&); + WebMediaDevicesRequest(WebCore::MediaDevicesRequest*); + operator WebCore::MediaDevicesRequest*() const; +#endif + +private: + WebPrivatePtr<WebCore::MediaDevicesRequest> m_private; +}; + +inline bool operator==(const WebMediaDevicesRequest& a, const WebMediaDevicesRequest& b) +{ + return a.equals(b); +} + +} // namespace blink + +#endif // WebMediaDevicesRequest_h diff --git a/chromium/third_party/WebKit/public/web/WebMediaPlayerAction.h b/chromium/third_party/WebKit/public/web/WebMediaPlayerAction.h index 7a3d591b557..4add3cee0c8 100644 --- a/chromium/third_party/WebKit/public/web/WebMediaPlayerAction.h +++ b/chromium/third_party/WebKit/public/web/WebMediaPlayerAction.h @@ -39,7 +39,8 @@ struct WebMediaPlayerAction { Play, Mute, Loop, - Controls + Controls, + TypeLast = Controls }; Type type; diff --git a/chromium/third_party/WebKit/public/web/WebNavigationPolicy.h b/chromium/third_party/WebKit/public/web/WebNavigationPolicy.h index 36be0db8c55..a7255b1df1a 100644 --- a/chromium/third_party/WebKit/public/web/WebNavigationPolicy.h +++ b/chromium/third_party/WebKit/public/web/WebNavigationPolicy.h @@ -36,6 +36,7 @@ namespace blink { enum WebNavigationPolicy { WebNavigationPolicyIgnore, WebNavigationPolicyDownload, + WebNavigationPolicyDownloadTo, WebNavigationPolicyCurrentTab, WebNavigationPolicyNewBackgroundTab, WebNavigationPolicyNewForegroundTab, diff --git a/chromium/third_party/WebKit/public/web/WebFontCache.h b/chromium/third_party/WebKit/public/web/WebNavigatorContentUtilsClient.h index 9d8df81c158..17350bb46d5 100644 --- a/chromium/third_party/WebKit/public/web/WebFontCache.h +++ b/chromium/third_party/WebKit/public/web/WebNavigatorContentUtilsClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2014, Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,23 +28,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebFontCache_h -#define WebFontCache_h - -#include "../platform/WebCommon.h" +#ifndef WebNavigatorContentUtilsClient_h +#define WebNavigatorContentUtilsClient_h namespace blink { -// An interface to query and configure WebKit's font cache. -class WebFontCache { -public: - // Clears the cache. - BLINK_EXPORT static void clear(); - -private: - WebFontCache(); // Not intended to be instanced. +// The following enum should be consistent with the CustomHandlersState enum +// defined in WebCore. +enum WebCustomHandlersState { + WebCustomHandlersNew, + WebCustomHandlersRegistered, + WebCustomHandlersDeclined }; -} // namespace blink +} // namespace blink #endif diff --git a/chromium/third_party/WebKit/public/web/WebNetworkStateNotifier.h b/chromium/third_party/WebKit/public/web/WebNetworkStateNotifier.h index 5b2ec92fc71..c8d64d5be9d 100644 --- a/chromium/third_party/WebKit/public/web/WebNetworkStateNotifier.h +++ b/chromium/third_party/WebKit/public/web/WebNetworkStateNotifier.h @@ -32,12 +32,14 @@ #define WebNetworkStateNotifier_h #include "../platform/WebCommon.h" +#include "../platform/WebConnectionType.h" namespace blink { class WebNetworkStateNotifier { public: BLINK_EXPORT static void setOnLine(bool); + BLINK_EXPORT static void setWebConnectionType(WebConnectionType); private: WebNetworkStateNotifier(); diff --git a/chromium/third_party/WebKit/public/web/WebNode.h b/chromium/third_party/WebKit/public/web/WebNode.h index 4afdbcb07b3..ba967ff7602 100644 --- a/chromium/third_party/WebKit/public/web/WebNode.h +++ b/chromium/third_party/WebKit/public/web/WebNode.h @@ -44,7 +44,7 @@ class WebDOMEventListener; class WebDOMEventListenerPrivate; class WebDocument; class WebElement; -class WebFrame; +class WebElementCollection; class WebNodeList; class WebPluginContainer; @@ -80,15 +80,15 @@ public: AttributeNode = 2, TextNode = 3, CDataSectionNode = 4, - // EntityReferenceNodes are deprecated and impossible to create in WebKit. - EntityNode = 6, + // EntityReferenceNodes are impossible to create in Blink. + // EntityNodes are impossible to create in Blink. ProcessingInstructionsNode = 7, CommentNode = 8, DocumentNode = 9, DocumentTypeNode = 10, DocumentFragmentNode = 11, - NotationNode = 12, - XPathNamespaceNode = 13, + // NotationNodes are impossible to create in Blink. + // XPathNamespaceNodes are impossible to create in Blink. ShadowRootNode = 14 }; @@ -113,7 +113,7 @@ public: BLINK_EXPORT void addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture); BLINK_EXPORT bool dispatchEvent(const WebDOMEvent&); BLINK_EXPORT void simulateClick(); - BLINK_EXPORT WebNodeList getElementsByTagName(const WebString&) const; + BLINK_EXPORT WebElementCollection getElementsByTagName(const WebString&) const; BLINK_EXPORT WebElement querySelector(const WebString&, WebExceptionCode&) const; BLINK_EXPORT WebElement rootEditableElement() const; BLINK_EXPORT bool focused() const; @@ -141,9 +141,21 @@ public: } #if BLINK_IMPLEMENTATION - WebNode(const WTF::PassRefPtr<WebCore::Node>&); - WebNode& operator=(const WTF::PassRefPtr<WebCore::Node>&); - operator WTF::PassRefPtr<WebCore::Node>() const; + WebNode(const PassRefPtrWillBeRawPtr<WebCore::Node>&); + WebNode& operator=(const PassRefPtrWillBeRawPtr<WebCore::Node>&); + operator PassRefPtrWillBeRawPtr<WebCore::Node>() const; +#if ENABLE(OILPAN) + // This constructor enables creation of WebNodes from Members + // holding WebCore::Node-derived objects (this shows up in WebVector + // assignments, for instance.) It is needed because a RawPtr<T> constructor + // from a Member<U> isn't provided, hence the above constructor + // won't be usable. + template<typename U> + WebNode(const WebCore::Member<U>& other, EnsurePtrConvertibleArgDecl(U, WebCore::Node)) + : m_private(other.get()) + { + } +#endif #endif #if BLINK_IMPLEMENTATION diff --git a/chromium/third_party/WebKit/public/web/WebNodeList.h b/chromium/third_party/WebKit/public/web/WebNodeList.h index 80484366318..96ad0addb09 100644 --- a/chromium/third_party/WebKit/public/web/WebNodeList.h +++ b/chromium/third_party/WebKit/public/web/WebNodeList.h @@ -31,10 +31,12 @@ #ifndef WebNodeList_h #define WebNodeList_h -#include "../platform/WebCommon.h" +#include "public/platform/WebCommon.h" +#include "public/platform/WebPrivatePtr.h" namespace WebCore { class NodeList; } #if BLINK_IMPLEMENTATION +#include "platform/heap/Handle.h" namespace WTF { template <typename T> class PassRefPtr; } #endif @@ -46,8 +48,8 @@ class WebNodeList { public: ~WebNodeList() { reset(); } - WebNodeList() : m_private(0) { } - WebNodeList(const WebNodeList& n) : m_private(0) { assign(n); } + WebNodeList() { } + WebNodeList(const WebNodeList& n) { assign(n); } WebNodeList& operator=(const WebNodeList& n) { assign(n); @@ -61,12 +63,12 @@ public: BLINK_EXPORT WebNode item(size_t) const; #if BLINK_IMPLEMENTATION - WebNodeList(const WTF::PassRefPtr<WebCore::NodeList>&); + WebNodeList(const PassRefPtrWillBeRawPtr<WebCore::NodeList>&); + WebNodeList& operator=(const PassRefPtrWillBeRawPtr<WebCore::NodeList>&); #endif private: - void assign(WebCore::NodeList*); - WebCore::NodeList* m_private; + WebPrivatePtr<WebCore::NodeList> m_private; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebNotification.h b/chromium/third_party/WebKit/public/web/WebNotification.h index 7194602f5c9..1b9587a7cd2 100644 --- a/chromium/third_party/WebKit/public/web/WebNotification.h +++ b/chromium/third_party/WebKit/public/web/WebNotification.h @@ -32,80 +32,73 @@ #define WebNotification_h #include "../platform/WebCommon.h" +#include "../platform/WebPrivatePtr.h" +#include "../platform/WebString.h" #include "WebTextDirection.h" +namespace WebCore { class Notification; } + #if BLINK_IMPLEMENTATION -namespace WebCore { class NotificationBase; } namespace WTF { template <typename T> class PassRefPtr; } #endif -namespace WTF { -class AtomicString; -} - namespace blink { -class WebNotificationPrivate; class WebURL; -class WebString; // Represents access to a desktop notification. class WebNotification { public: - WebNotification() : m_private(0) { } - WebNotification(const WebNotification& other) : m_private(0) { assign(other); } - - ~WebNotification() { reset(); } - - BLINK_EXPORT void reset(); - BLINK_EXPORT void assign(const WebNotification&); - + WebNotification() { } + WebNotification(const WebNotification& other) { assign(other); } WebNotification& operator=(const WebNotification& other) { assign(other); return *this; } - // Operators required to put WebNotification in an ordered map. - bool equals(const WebNotification& other) const { return m_private == other.m_private; } - BLINK_EXPORT bool lessThan(const WebNotification& other) const; + ~WebNotification() { reset(); } - // DEPRECATED: Always returns false. - BLINK_EXPORT bool isHTML() const; + BLINK_EXPORT void reset(); + BLINK_EXPORT void assign(const WebNotification&); - // DEPRECATED: Always returns an invalid URL. - BLINK_EXPORT WebURL url() const; + // Operators required to put WebNotification in an std::map. Mind that the + // order of the notifications in an ordered map will be arbitrary. + BLINK_EXPORT bool equals(const WebNotification& other) const; + BLINK_EXPORT bool lessThan(const WebNotification& other) const; - BLINK_EXPORT WebURL iconURL() const; BLINK_EXPORT WebString title() const; - BLINK_EXPORT WebString body() const; - BLINK_EXPORT WebTextDirection direction() const; - BLINK_EXPORT WebString replaceId() const; + BLINK_EXPORT WebTextDirection direction() const; + BLINK_EXPORT WebString lang() const; + BLINK_EXPORT WebString body() const; + BLINK_EXPORT WebString tag() const; + BLINK_EXPORT WebURL iconURL() const; // Called to indicate the notification has been displayed. - BLINK_EXPORT void dispatchDisplayEvent(); + BLINK_EXPORT void dispatchShowEvent(); // Called to indicate an error has occurred with this notification. BLINK_EXPORT void dispatchErrorEvent(const WebString& errorMessage); - // Called to indicate the notification has been closed. If it was - // closed by the user (as opposed to automatically by the system), - // the byUser parameter will be true. + // Called to indicate the notification has been closed. |byUser| indicates + // whether it was closed by the user instead of automatically by the system. BLINK_EXPORT void dispatchCloseEvent(bool byUser); // Called to indicate the notification was clicked on. BLINK_EXPORT void dispatchClickEvent(); + // FIXME: Remove these methods once Chromium switched to the new APIs. + WebString replaceId() const { return tag(); } + void dispatchDisplayEvent() { dispatchShowEvent(); } + #if BLINK_IMPLEMENTATION - WebNotification(const WTF::PassRefPtr<WebCore::NotificationBase>&); - WebNotification& operator=(const WTF::PassRefPtr<WebCore::NotificationBase>&); - operator WTF::PassRefPtr<WebCore::NotificationBase>() const; + WebNotification(WebCore::Notification*); + WebNotification& operator=(WebCore::Notification*); #endif private: - void assign(WebNotificationPrivate*); - WebNotificationPrivate* m_private; + WebPrivatePtr<WebCore::Notification> m_private; }; inline bool operator==(const WebNotification& a, const WebNotification& b) diff --git a/chromium/third_party/WebKit/public/web/WebNotificationPresenter.h b/chromium/third_party/WebKit/public/web/WebNotificationPresenter.h index 4249d04341b..9277a165478 100644 --- a/chromium/third_party/WebKit/public/web/WebNotificationPresenter.h +++ b/chromium/third_party/WebKit/public/web/WebNotificationPresenter.h @@ -32,13 +32,13 @@ #define WebNotificationPresenter_h #include "../platform/WebString.h" -#include "WebNotificationPermissionCallback.h" -#include "WebSecurityOrigin.h" namespace blink { class WebDocument; class WebNotification; +class WebNotificationPermissionCallback; +class WebSecurityOrigin; // Provides the services to show desktop notifications to the user. class WebNotificationPresenter { @@ -52,7 +52,9 @@ public: // Shows a notification. virtual bool show(const WebNotification&) = 0; - // Cancels a notification previously shown, and removes it if being shown. + // Closes a notification previously shown, and removes it if being shown. + // FIXME: Remove cancel() once Chromium updated to the new name, and make close() pure virtual. + virtual void close(const WebNotification&) { } virtual void cancel(const WebNotification&) = 0; // Indiciates that the notification object subscribed to events for a previously shown notification is diff --git a/chromium/third_party/WebKit/public/web/WebOptionElement.h b/chromium/third_party/WebKit/public/web/WebOptionElement.h index 6c941e40514..ec3bf76ff42 100644 --- a/chromium/third_party/WebKit/public/web/WebOptionElement.h +++ b/chromium/third_party/WebKit/public/web/WebOptionElement.h @@ -62,9 +62,9 @@ public: BLINK_EXPORT bool isEnabled() const; #if BLINK_IMPLEMENTATION - WebOptionElement(const WTF::PassRefPtr<WebCore::HTMLOptionElement>&); - WebOptionElement& operator=(const WTF::PassRefPtr<WebCore::HTMLOptionElement>&); - operator WTF::PassRefPtr<WebCore::HTMLOptionElement>() const; + WebOptionElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLOptionElement>&); + WebOptionElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLOptionElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLOptionElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebPageSerializer.h b/chromium/third_party/WebKit/public/web/WebPageSerializer.h index 89a3a31b832..b018a110126 100644 --- a/chromium/third_party/WebKit/public/web/WebPageSerializer.h +++ b/chromium/third_party/WebKit/public/web/WebPageSerializer.h @@ -34,9 +34,9 @@ #include "../platform/WebCString.h" #include "../platform/WebCommon.h" #include "../platform/WebURL.h" +#include "WebFrame.h" namespace blink { -class WebFrame; class WebPageSerializerClient; class WebString; class WebView; @@ -88,12 +88,13 @@ public: // saved links, which matched with vector:links one by one. // The parameter localDirectoryName is relative path of directory which // contain all saved auxiliary files included all sub frames and resources. - BLINK_EXPORT static bool serialize(WebFrame*, - bool recursive, - WebPageSerializerClient*, - const WebVector<WebURL>& links, - const WebVector<WebString>& localPaths, - const WebString& localDirectoryName); + BLINK_EXPORT static bool serialize( + WebLocalFrame*, + bool recursive, + WebPageSerializerClient*, + const WebVector<WebURL>& links, + const WebVector<WebString>& localPaths, + const WebString& localDirectoryName); // Retrieve all the resource for the passed view, including the main frame // and sub-frames. Returns true if all resources were retrieved diff --git a/chromium/third_party/WebKit/public/web/WebPageVisibilityState.h b/chromium/third_party/WebKit/public/web/WebPageVisibilityState.h index fe02afd42d3..ecd0b7a07f3 100644 --- a/chromium/third_party/WebKit/public/web/WebPageVisibilityState.h +++ b/chromium/third_party/WebKit/public/web/WebPageVisibilityState.h @@ -39,6 +39,7 @@ enum WebPageVisibilityState { WebPageVisibilityStateVisible, WebPageVisibilityStateHidden, WebPageVisibilityStatePrerender, + WebPageVisibilityStateLast = WebPageVisibilityStatePrerender }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebPasswordFormData.h b/chromium/third_party/WebKit/public/web/WebPasswordFormData.h deleted file mode 100644 index 84dc700a59f..00000000000 --- a/chromium/third_party/WebKit/public/web/WebPasswordFormData.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2009 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. - */ - -#ifndef WebPasswordFormData_h -#define WebPasswordFormData_h - -#include "../platform/WebString.h" -#include "../platform/WebURL.h" -#include "../platform/WebVector.h" -#include "WebFormElement.h" - -namespace blink { - -struct WebPasswordFormData { - // If the provided form is suitable for password completion, isValid() will - // return true; - BLINK_EXPORT WebPasswordFormData(const WebFormElement&); - - // If creation failed, return false. - bool isValid() const { return action.isValid(); } - - // The action target of the form. This is the primary data used by the - // PasswordManager for form autofill; that is, the action of the saved - // credentials must match the action of the form on the page to be autofilled. - // If this is empty / not available, it will result in a "restricted" - // IE-like autofill policy, where we wait for the user to type in his - // username before autofilling the password. In these cases, after successful - // login the action URL will automatically be assigned by the - // PasswordManager. - // - // When parsing an HTML form, this must always be set. - WebURL action; - - // The "Realm" for the sign-on (scheme, host, port for SCHEME_HTML, and - // contains the HTTP realm for dialog-based forms). - // The signon_realm is effectively the primary key used for retrieving - // data from the database, so it must not be empty. - WebString signonRealm; - - // The URL (minus query parameters) containing the form. This is the primary - // data used by the PasswordManager to decide (in longest matching prefix - // fashion) whether or not a given PasswordForm result from the database is a - // good fit for a particular form on a page, so it must not be empty. - WebURL origin; - - // The name of the submit button used. Optional; only used in scoring - // of PasswordForm results from the database to make matches as tight as - // possible. - // - // When parsing an HTML form, this must always be set. - WebString submitElement; - - // The name of the username input element. Optional (improves scoring). - // - // When parsing an HTML form, this must always be set. - WebString userNameElement; - - // The username. Optional. - // - // When parsing an HTML form, this is typically empty unless the site - // has implemented some form of autofill. - WebString userNameValue; - - // If the form has more than one field which could possibly contain the - // username, the extra are placed here. Used for autofill in cases where - // our heuristics for determining the username are wrong. Optional. - // - // When parsing an HTML form, this is typically empty. - WebVector<WebString> possibleUserNames; - - // The name of the password input element, Optional (improves scoring). - // - // When parsing an HTML form, this must always be set. - WebString passwordElement; - - // The password. Required. - // - // When parsing an HTML form, this is typically empty. - WebString passwordValue; - - // Value of shouldAutocomplete for the password element. - bool passwordShouldAutocomplete; - - // If the form was a change password form, the name of the - // 'old password' input element. Optional. - WebString oldPasswordElement; - - // The old password. Optional. - WebString oldPasswordValue; - - WebPasswordFormData() - : passwordShouldAutocomplete(false) - { - } -}; - -} // namespace blink - -#endif diff --git a/chromium/third_party/WebKit/public/web/WebPerformance.h b/chromium/third_party/WebKit/public/web/WebPerformance.h index 99d973a8953..a858f352240 100644 --- a/chromium/third_party/WebKit/public/web/WebPerformance.h +++ b/chromium/third_party/WebKit/public/web/WebPerformance.h @@ -35,6 +35,10 @@ #include "../platform/WebPrivatePtr.h" #include "WebNavigationType.h" +#if BLINK_IMPLEMENTATION +#include "platform/heap/Handle.h" +#endif + namespace WebCore { class Performance; } namespace blink { @@ -82,9 +86,8 @@ public: BLINK_EXPORT double loadEventEnd() const; #if BLINK_IMPLEMENTATION - WebPerformance(const WTF::PassRefPtr<WebCore::Performance>&); - WebPerformance& operator=(const WTF::PassRefPtr<WebCore::Performance>&); - operator WTF::PassRefPtr<WebCore::Performance>() const; + WebPerformance(const PassRefPtrWillBeRawPtr<WebCore::Performance>&); + WebPerformance& operator=(const PassRefPtrWillBeRawPtr<WebCore::Performance>&); #endif private: diff --git a/chromium/third_party/WebKit/public/web/WebPermissionClient.h b/chromium/third_party/WebKit/public/web/WebPermissionClient.h index 1fe2ad1976a..b1e9f58c7ef 100644 --- a/chromium/third_party/WebKit/public/web/WebPermissionClient.h +++ b/chromium/third_party/WebKit/public/web/WebPermissionClient.h @@ -31,12 +31,11 @@ #ifndef WebPermissionClient_h #define WebPermissionClient_h -#define WEBPERMISSIONCLIENT_USES_FRAME_FOR_ALL_METHODS +#include "public/platform/WebPermissionCallbacks.h" namespace blink { class WebDocument; -class WebFrame; class WebSecurityOrigin; class WebString; class WebURL; @@ -44,80 +43,73 @@ class WebURL; class WebPermissionClient { public: // Controls whether access to Web Databases is allowed for this frame. - virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) { return true; } + virtual bool allowDatabase(const WebString& name, const WebString& displayName, unsigned long estimatedSize) { return true; } // Controls whether access to File System is allowed for this frame. - virtual bool allowFileSystem(WebFrame*) { return true; } + virtual bool requestFileSystemAccessSync() { return true; } + + // Controls whether access to File System is allowed for this frame. + virtual void requestFileSystemAccessAsync(const WebPermissionCallbacks& callbacks) { WebPermissionCallbacks permissionCallbacks(callbacks); permissionCallbacks.doAllow(); } // Controls whether images are allowed for this frame. - virtual bool allowImage(WebFrame* frame, bool enabledPerSettings, const WebURL& imageURL) { return enabledPerSettings; } + virtual bool allowImage(bool enabledPerSettings, const WebURL& imageURL) { return enabledPerSettings; } // Controls whether access to Indexed DB are allowed for this frame. - virtual bool allowIndexedDB(WebFrame*, const WebString& name, const WebSecurityOrigin&) { return true; } + virtual bool allowIndexedDB(const WebString& name, const WebSecurityOrigin&) { return true; } // Controls whether plugins are allowed for this frame. - virtual bool allowPlugins(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } + virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; } // Controls whether scripts are allowed to execute for this frame. - virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } + virtual bool allowScript(bool enabledPerSettings) { return enabledPerSettings; } // Controls whether scripts loaded from the given URL are allowed to execute for this frame. - virtual bool allowScriptFromSource(WebFrame*, bool enabledPerSettings, const WebURL& scriptURL) { return enabledPerSettings; } + virtual bool allowScriptFromSource(bool enabledPerSettings, const WebURL& scriptURL) { return enabledPerSettings; } // Controls whether insecrure content is allowed to display for this frame. - virtual bool allowDisplayingInsecureContent(WebFrame*, bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } + virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } // Controls whether insecrure scripts are allowed to execute for this frame. - virtual bool allowRunningInsecureContent(WebFrame*, bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } + virtual bool allowRunningInsecureContent(bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } // Controls whether the given script extension should run in a new script // context in this frame. If extensionGroup is 0, the script context is the // frame's main context. Otherwise, it is a context created by - // WebFrame::executeScriptInIsolatedWorld with that same extensionGroup + // WebLocalFrame::executeScriptInIsolatedWorld with that same extensionGroup // value. - virtual bool allowScriptExtension(WebFrame*, const WebString& extensionName, int extensionGroup) { return true; } + virtual bool allowScriptExtension(const WebString& extensionName, int extensionGroup) { return true; } - virtual bool allowScriptExtension(WebFrame* webFrame, const WebString& extensionName, int extensionGroup, int worldId) + virtual bool allowScriptExtension(const WebString& extensionName, int extensionGroup, int worldId) { - return allowScriptExtension(webFrame, extensionName, extensionGroup); + return allowScriptExtension(extensionName, extensionGroup); } // Controls whether HTML5 Web Storage is allowed for this frame. // If local is true, then this is for local storage, otherwise it's for session storage. - virtual bool allowStorage(WebFrame*, bool local) { return true; } + virtual bool allowStorage(bool local) { return true; } // Controls whether access to read the clipboard is allowed for this frame. - virtual bool allowReadFromClipboard(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowReadFromClipboard(bool defaultValue) { return defaultValue; } // Controls whether access to write the clipboard is allowed for this frame. - virtual bool allowWriteToClipboard(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowWriteToClipboard(bool defaultValue) { return defaultValue; } -#if defined(WEBPERMISSIONCLIENT_USES_FRAME_FOR_ALL_METHODS) // Controls whether enabling Web Components API for this frame. - virtual bool allowWebComponents(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowWebComponents(bool defaultValue) { return defaultValue; } // Controls whether to enable MutationEvents for this frame. // The common use case of this method is actually to selectively disable MutationEvents, // but it's been named for consistency with the rest of the interface. - virtual bool allowMutationEvents(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowMutationEvents(bool defaultValue) { return defaultValue; } // Controls whether pushState and related History APIs are enabled for this frame. - virtual bool allowPushState(WebFrame*) { return true; } -#else - // These methods are deprecated and will be removed after Chrome uses the new versions above. - virtual bool allowWebComponents(const WebDocument&, bool defaultValue) { return defaultValue; } - virtual bool allowMutationEvents(const WebDocument&, bool defaultValue) { return defaultValue; } - virtual bool allowPushState(const WebDocument&) { return true; } -#endif - - // Controls whether WebGL extension WEBGL_debug_renderer_info is allowed for this frame. - virtual bool allowWebGLDebugRendererInfo(WebFrame*) { return false; } + virtual bool allowPushState() { return true; } // Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled. - virtual void didNotAllowPlugins(WebFrame*) { } + virtual void didNotAllowPlugins() { } // Notifies the client that the frame would have executed script if script were enabled. - virtual void didNotAllowScript(WebFrame*) { } + virtual void didNotAllowScript() { } protected: ~WebPermissionClient() { } diff --git a/chromium/third_party/WebKit/public/web/WebPlugin.h b/chromium/third_party/WebKit/public/web/WebPlugin.h index 9f046f2decb..a99c3ee217b 100644 --- a/chromium/third_party/WebKit/public/web/WebPlugin.h +++ b/chromium/third_party/WebKit/public/web/WebPlugin.h @@ -45,7 +45,6 @@ namespace blink { class WebDataSource; class WebDragData; -class WebFrame; class WebInputEvent; class WebPluginContainer; class WebURLResponse; @@ -65,6 +64,7 @@ public: virtual void destroy() = 0; virtual WebPluginContainer* container() const { return 0; } + virtual void containerDidDetachFromParent() { } virtual NPObject* scriptableObject() = 0; virtual struct _NPP* pluginNPP() { return 0; } @@ -169,6 +169,7 @@ public: virtual void rotateView(RotationType type) { } virtual bool isPlaceholder() { return true; } + virtual bool shouldPersist() const { return false; } protected: ~WebPlugin() { } diff --git a/chromium/third_party/WebKit/public/web/WebPluginAction.h b/chromium/third_party/WebKit/public/web/WebPluginAction.h index fc039984ea3..69c89210ef7 100644 --- a/chromium/third_party/WebKit/public/web/WebPluginAction.h +++ b/chromium/third_party/WebKit/public/web/WebPluginAction.h @@ -37,7 +37,8 @@ struct WebPluginAction { enum Type { Unknown, Rotate90Clockwise, - Rotate90Counterclockwise + Rotate90Counterclockwise, + TypeLast = Rotate90Counterclockwise }; Type type; diff --git a/chromium/third_party/WebKit/public/web/WebPluginDocument.h b/chromium/third_party/WebKit/public/web/WebPluginDocument.h index 86b3ba7bcf5..27eb1423128 100644 --- a/chromium/third_party/WebKit/public/web/WebPluginDocument.h +++ b/chromium/third_party/WebKit/public/web/WebPluginDocument.h @@ -56,9 +56,9 @@ public: BLINK_EXPORT WebPlugin* plugin(); #if BLINK_IMPLEMENTATION - WebPluginDocument(const WTF::PassRefPtr<WebCore::PluginDocument>&); - WebPluginDocument& operator=(const WTF::PassRefPtr<WebCore::PluginDocument>&); - operator WTF::PassRefPtr<WebCore::PluginDocument>() const; + WebPluginDocument(const PassRefPtrWillBeRawPtr<WebCore::PluginDocument>&); + WebPluginDocument& operator=(const PassRefPtrWillBeRawPtr<WebCore::PluginDocument>&); + operator PassRefPtrWillBeRawPtr<WebCore::PluginDocument>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebPopupMenu.h b/chromium/third_party/WebKit/public/web/WebPopupMenu.h index 29276729784..c7e84e0be6b 100644 --- a/chromium/third_party/WebKit/public/web/WebPopupMenu.h +++ b/chromium/third_party/WebKit/public/web/WebPopupMenu.h @@ -41,9 +41,6 @@ class WebWidgetClient; class WebPopupMenu : public WebWidget { public: BLINK_EXPORT static WebPopupMenu* create(WebWidgetClient*); - - // Sets the minimum height of a popup listbox row. - BLINK_EXPORT static void setMinimumRowHeight(int); }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebPopupType.h b/chromium/third_party/WebKit/public/web/WebPopupType.h index c82dcce2dbc..f9b4956305d 100644 --- a/chromium/third_party/WebKit/public/web/WebPopupType.h +++ b/chromium/third_party/WebKit/public/web/WebPopupType.h @@ -38,7 +38,7 @@ enum WebPopupType { WebPopupTypeSelect, // An HTML select (combo-box) popup. WebPopupTypeSuggestion, // An autofill/autocomplete popup. WebPopupTypePage, // An HTML-capable popup. - WebPopupTypeHelperPlugin, // An off-screen helper plugin. + WebPopupTypeLast = WebPopupTypePage }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebPrintScalingOption.h b/chromium/third_party/WebKit/public/web/WebPrintScalingOption.h index adecf04afb2..b071e400263 100644 --- a/chromium/third_party/WebKit/public/web/WebPrintScalingOption.h +++ b/chromium/third_party/WebKit/public/web/WebPrintScalingOption.h @@ -37,6 +37,7 @@ enum WebPrintScalingOption { WebPrintScalingOptionNone, // Prints the upper left of a page without scaling. Crop the page contents that don't fit on the paper. WebPrintScalingOptionFitToPrintableArea, // Reduces or enlarges each page to fit the printable area of the selected printer paper size. WebPrintScalingOptionSourceSize, // Print output page size is same as the actual source page size. Do not scale/center/fit to printable area. + WebPrintScalingOptionLast = WebPrintScalingOptionSourceSize }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebRange.h b/chromium/third_party/WebKit/public/web/WebRange.h index 3eeeeb0d0c1..cd318a1cf1f 100644 --- a/chromium/third_party/WebKit/public/web/WebRange.h +++ b/chromium/third_party/WebKit/public/web/WebRange.h @@ -31,20 +31,17 @@ #ifndef WebRange_h #define WebRange_h -#include "../platform/WebCommon.h" -#include "../platform/WebVector.h" +#include "WebFrame.h" +#include "public/platform/WebCommon.h" +#include "public/platform/WebPrivatePtr.h" +#include "public/platform/WebVector.h" -#if BLINK_IMPLEMENTATION namespace WebCore { class Range; } -namespace WTF { template <typename T> class PassRefPtr; } -#endif namespace blink { struct WebFloatQuad; -class WebFrame; class WebNode; -class WebRangePrivate; class WebString; // Provides readonly access to some properties of a DOM range. @@ -52,8 +49,8 @@ class WebRange { public: ~WebRange() { reset(); } - WebRange() : m_private(0) { } - WebRange(const WebRange& r) : m_private(0) { assign(r); } + WebRange() { } + WebRange(const WebRange& r) { assign(r); } WebRange& operator=(const WebRange& r) { assign(r); @@ -63,7 +60,7 @@ public: BLINK_EXPORT void reset(); BLINK_EXPORT void assign(const WebRange&); - bool isNull() const { return !m_private; } + bool isNull() const { return m_private.isNull(); } BLINK_EXPORT int startOffset() const; BLINK_EXPORT int endOffset() const; @@ -75,19 +72,17 @@ public: BLINK_EXPORT WebRange expandedToParagraph() const; - BLINK_EXPORT static WebRange fromDocumentRange(WebFrame*, int start, int length); + BLINK_EXPORT static WebRange fromDocumentRange(WebLocalFrame*, int start, int length); BLINK_EXPORT WebVector<WebFloatQuad> textQuads() const; #if BLINK_IMPLEMENTATION - WebRange(const WTF::PassRefPtr<WebCore::Range>&); - WebRange& operator=(const WTF::PassRefPtr<WebCore::Range>&); - operator WTF::PassRefPtr<WebCore::Range>() const; + WebRange(const PassRefPtrWillBeRawPtr<WebCore::Range>&); + operator PassRefPtrWillBeRawPtr<WebCore::Range>() const; #endif private: - void assign(WebRangePrivate*); - WebRangePrivate* m_private; + WebPrivatePtr<WebCore::Range> m_private; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebRemoteFrame.h b/chromium/third_party/WebKit/public/web/WebRemoteFrame.h new file mode 100644 index 00000000000..9afc010d821 --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebRemoteFrame.h @@ -0,0 +1,22 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebRemoteFrame_h +#define WebRemoteFrame_h + +#include "public/web/WebFrame.h" + +namespace blink { + +class WebRemoteFrame : public WebFrame { +public: + BLINK_EXPORT static WebRemoteFrame* create(WebFrameClient*); + + virtual WebLocalFrame* createLocalChild(const WebString& name, WebFrameClient*) = 0; + virtual WebRemoteFrame* createRemoteChild(const WebString& name, WebFrameClient*) = 0; +}; + +} // namespace blink + +#endif // WebRemoteFrame_h diff --git a/chromium/third_party/WebKit/public/web/WebRuntimeFeatures.h b/chromium/third_party/WebKit/public/web/WebRuntimeFeatures.h index 745f24cf989..37eb1ea74fa 100644 --- a/chromium/third_party/WebKit/public/web/WebRuntimeFeatures.h +++ b/chromium/third_party/WebKit/public/web/WebRuntimeFeatures.h @@ -36,29 +36,17 @@ namespace blink { // This class is used to enable runtime features of Blink. -// All features are disabled by default. -// Most clients should call enableStableFeatures() to enable -// features Blink has made API commitments to. +// Stable features are enabled by default. class WebRuntimeFeatures { public: - BLINK_EXPORT static void enableStableFeatures(bool); BLINK_EXPORT static void enableExperimentalFeatures(bool); BLINK_EXPORT static void enableTestOnlyFeatures(bool); BLINK_EXPORT static void enableApplicationCache(bool); - BLINK_EXPORT static bool isApplicationCacheEnabled(); BLINK_EXPORT static void enableDatabase(bool); - BLINK_EXPORT static bool isDatabaseEnabled(); - - BLINK_EXPORT static void enableDeviceMotion(bool); - BLINK_EXPORT static bool isDeviceMotionEnabled(); - - BLINK_EXPORT static void enableDeviceOrientation(bool); - BLINK_EXPORT static bool isDeviceOrientationEnabled(); BLINK_EXPORT static void enableDialogElement(bool); - BLINK_EXPORT static bool isDialogElementEnabled(); BLINK_EXPORT static void enableEncryptedMedia(bool); BLINK_EXPORT static bool isEncryptedMediaEnabled(); @@ -66,109 +54,84 @@ public: BLINK_EXPORT static void enablePrefixedEncryptedMedia(bool); BLINK_EXPORT static bool isPrefixedEncryptedMediaEnabled(); - BLINK_EXPORT static void enableDirectWrite(bool); - BLINK_EXPORT static bool isDirectWriteEnabled(); + BLINK_EXPORT static void enableBleedingEdgeFastPaths(bool); BLINK_EXPORT static void enableExperimentalCanvasFeatures(bool); - BLINK_EXPORT static bool isExperimentalCanvasFeaturesEnabled(); + + BLINK_EXPORT static void enableFastMobileScrolling(bool); BLINK_EXPORT static void enableFastTextAutosizing(bool); - BLINK_EXPORT static bool isFastTextAutosizingEnabled(); BLINK_EXPORT static void enableFileSystem(bool); - BLINK_EXPORT static bool isFileSystemEnabled(); - - BLINK_EXPORT static void enableFullscreen(bool); - BLINK_EXPORT static bool isFullscreenEnabled(); BLINK_EXPORT static void enableGamepad(bool); - BLINK_EXPORT static bool isGamepadEnabled(); - - BLINK_EXPORT static void enableGeolocation(bool); - BLINK_EXPORT static bool isGeolocationEnabled(); - - BLINK_EXPORT static void enableLazyLayout(bool); BLINK_EXPORT static void enableLocalStorage(bool); - BLINK_EXPORT static bool isLocalStorageEnabled(); BLINK_EXPORT static void enableMediaPlayer(bool); - BLINK_EXPORT static bool isMediaPlayerEnabled(); - BLINK_EXPORT static void enableWebKitMediaSource(bool); - BLINK_EXPORT static bool isWebKitMediaSourceEnabled(); + BLINK_EXPORT static void enableSubpixelFontScaling(bool); BLINK_EXPORT static void enableMediaSource(bool); - BLINK_EXPORT static bool isMediaSourceEnabled(); BLINK_EXPORT static void enableMediaStream(bool); - BLINK_EXPORT static bool isMediaStreamEnabled(); BLINK_EXPORT static void enableNotifications(bool); - BLINK_EXPORT static bool isNotificationsEnabled(); BLINK_EXPORT static void enableNavigatorContentUtils(bool); - BLINK_EXPORT static bool isNavigatorContentUtilsEnabled(); + + BLINK_EXPORT static void enableOrientationEvent(bool); BLINK_EXPORT static void enablePagePopup(bool); - BLINK_EXPORT static bool isPagePopupEnabled(); BLINK_EXPORT static void enablePeerConnection(bool); - BLINK_EXPORT static bool isPeerConnectionEnabled(); BLINK_EXPORT static void enableRequestAutocomplete(bool); - BLINK_EXPORT static bool isRequestAutocompleteEnabled(); BLINK_EXPORT static void enableScriptedSpeech(bool); - BLINK_EXPORT static bool isScriptedSpeechEnabled(); BLINK_EXPORT static void enableServiceWorker(bool); - BLINK_EXPORT static bool isServiceWorkerEnabled(); BLINK_EXPORT static void enableSessionStorage(bool); - BLINK_EXPORT static bool isSessionStorageEnabled(); - - BLINK_EXPORT static void enableSpeechInput(bool); - BLINK_EXPORT static bool isSpeechInputEnabled(); BLINK_EXPORT static void enableSpeechSynthesis(bool); - BLINK_EXPORT static bool isSpeechSynthesisEnabled(); BLINK_EXPORT static void enableTouch(bool); - BLINK_EXPORT static bool isTouchEnabled(); - BLINK_EXPORT static void enableWebAnimationsCSS(bool); + BLINK_EXPORT static void enableTouchIconLoading(bool); + BLINK_EXPORT static void enableWebAnimationsSVG(bool); BLINK_EXPORT static void enableWebAudio(bool); - BLINK_EXPORT static bool isWebAudioEnabled(); BLINK_EXPORT static void enableWebGLDraftExtensions(bool); - BLINK_EXPORT static bool isWebGLDraftExtensionsEnabled(); - BLINK_EXPORT static void enableWebMIDI(bool); - BLINK_EXPORT static bool isWebMIDIEnabled(); + BLINK_EXPORT static void enableWebGLImageChromium(bool); - BLINK_EXPORT static void enableDataListElement(bool); - BLINK_EXPORT static bool isDataListElementEnabled(); + BLINK_EXPORT static void enableWebMIDI(bool); BLINK_EXPORT static void enableHTMLImports(bool); - BLINK_EXPORT static bool isHTMLImportsEnabled(); BLINK_EXPORT static void enableXSLT(bool); - BLINK_EXPORT static void enableEmbedderCustomElements(bool); - BLINK_EXPORT static void enableOverlayScrollbars(bool); - BLINK_EXPORT static void enableInputModeAttribute(bool); - BLINK_EXPORT static void enableOverlayFullscreenVideo(bool); BLINK_EXPORT static void enableSharedWorker(bool); BLINK_EXPORT static void enableRepaintAfterLayout(bool); + BLINK_EXPORT static void enableExperimentalWebSocket(bool); + + BLINK_EXPORT static void enableTargetedStyleRecalc(bool); + + BLINK_EXPORT static void enablePreciseMemoryInfo(bool); + + BLINK_EXPORT static void enableLayerSquashing(bool); + + BLINK_EXPORT static void enableShowModalDialog(bool); + private: WebRuntimeFeatures(); }; diff --git a/chromium/third_party/WebKit/public/web/WebScopedWindowFocusAllowedIndicator.h b/chromium/third_party/WebKit/public/web/WebScopedWindowFocusAllowedIndicator.h new file mode 100644 index 00000000000..f3f07b9a37e --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebScopedWindowFocusAllowedIndicator.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef WebScopedWindowFocusAllowedIndicator_h +#define WebScopedWindowFocusAllowedIndicator_h + +#include "public/platform/WebPrivateOwnPtr.h" + +namespace WebCore { +class WindowFocusAllowedIndicator; +} + +namespace blink { + +class WebScopedWindowFocusAllowedIndicator { +public: + WebScopedWindowFocusAllowedIndicator() { initialize(); } + ~WebScopedWindowFocusAllowedIndicator() { reset(); } + +private: + BLINK_EXPORT void initialize(); + BLINK_EXPORT void reset(); + + WebPrivateOwnPtr<WebCore::WindowFocusAllowedIndicator> m_indicator; +}; + +} + +#endif // WebScopedWindowFocusAllowedIndicator_h diff --git a/chromium/third_party/WebKit/public/web/WebScriptController.h b/chromium/third_party/WebKit/public/web/WebScriptController.h index e4a9841c5bb..0f507544d61 100644 --- a/chromium/third_party/WebKit/public/web/WebScriptController.h +++ b/chromium/third_party/WebKit/public/web/WebScriptController.h @@ -46,15 +46,6 @@ public: // v8::Extension object passed. BLINK_EXPORT static void registerExtension(v8::Extension*); - // Enables special settings which are only applicable if V8 is executed - // in the single thread which must be the main thread. - // FIXME: make a try to dynamically detect when this condition is broken - // and automatically switch off single thread mode. - BLINK_EXPORT static void enableV8SingleThreadMode(); - - // Process any pending JavaScript console messages. - BLINK_EXPORT static void flushConsoleMessages(); - private: WebScriptController(); }; diff --git a/chromium/third_party/WebKit/public/web/WebSelectElement.h b/chromium/third_party/WebKit/public/web/WebSelectElement.h index 836959c24fc..6fbe0c27c2f 100644 --- a/chromium/third_party/WebKit/public/web/WebSelectElement.h +++ b/chromium/third_party/WebKit/public/web/WebSelectElement.h @@ -54,14 +54,12 @@ public: } void assign(const WebSelectElement& element) { WebFormControlElement::assign(element); } - BLINK_EXPORT void setValue(const WebString&); - BLINK_EXPORT WebString value() const; BLINK_EXPORT WebVector<WebElement> listItems() const; #if BLINK_IMPLEMENTATION - WebSelectElement(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&); - WebSelectElement& operator=(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&); - operator WTF::PassRefPtr<WebCore::HTMLSelectElement>() const; + WebSelectElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLSelectElement>&); + WebSelectElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLSelectElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLSelectElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h b/chromium/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h index f00ae5ebf72..e285efa1539 100644 --- a/chromium/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h +++ b/chromium/third_party/WebKit/public/web/WebSerializedScriptValueVersion.h @@ -38,7 +38,7 @@ namespace blink { // Embedders may serialize this as out-of-band metadata along with // collections of serialized data so that version skew can be detected // before deserializing individual values. -const unsigned kSerializedScriptValueVersion = 4; +const unsigned kSerializedScriptValueVersion = 6; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebServiceWorkerContextClient.h b/chromium/third_party/WebKit/public/web/WebServiceWorkerContextClient.h index 22e104a7110..0a787469810 100644 --- a/chromium/third_party/WebKit/public/web/WebServiceWorkerContextClient.h +++ b/chromium/third_party/WebKit/public/web/WebServiceWorkerContextClient.h @@ -32,30 +32,54 @@ #define WebServiceWorkerContextClient_h #include "WebWorkerPermissionClientProxy.h" +#include "public/platform/WebMessagePortChannel.h" +#include "public/platform/WebServiceWorkerClientsInfo.h" +#include "public/platform/WebServiceWorkerEventResult.h" +#include "public/platform/WebURL.h" namespace blink { -class WebString; +class WebDataSource; class WebServiceWorkerContextProxy; +class WebServiceWorkerNetworkProvider; +class WebServiceWorkerResponse; +class WebString; -// This interface is implemented by the client. It is suppoed to be created -// on the main thread and then passed on to the worker thread to be owned +// This interface is implemented by the client. It is supposed to be created +// on the main thread and then passed on to the worker thread. // by a newly created WorkerGlobalScope. All methods of this class, except -// for workerContextFailedToStart(), are called on the worker thread. +// for createServiceWorkerNetworkProvider() and workerContextFailedToStart(), +// are called on the worker thread. +// FIXME: Split this into EmbeddedWorkerContextClient and +// ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker +// framework for other implementation (like SharedWorker). class WebServiceWorkerContextClient { public: virtual ~WebServiceWorkerContextClient() { } + // ServiceWorker specific method. Called when script accesses the + // the |scope| attribute of the ServiceWorkerGlobalScope. Immutable per spec. + virtual WebURL scope() const { return WebURL(); } + + // If the worker was started with WebEmbeddedWorkerStartData indicating to pause + // after download, this method is called after the main script resource has been + // downloaded. The scope will not be created and the script will not be loaded until + // WebEmbeddedWorker.resumeAfterDownload() is invoked. + virtual void didPauseAfterDownload() { } + // A new WorkerGlobalScope is created and started to run on the // worker thread. // This also gives back a proxy to the client to talk to the // newly created WorkerGlobalScope. The proxy is held by WorkerGlobalScope // and should not be held by the caller. No proxy methods should be called - // after workerContextDestroyed() is called. + // after willDestroyWorkerContext() is called. virtual void workerContextStarted(WebServiceWorkerContextProxy*) { } - // WorkerGlobalScope is destroyed. The client should clear the - // WebServiceWorkerGlobalScopeProxy when this is called. + // WorkerGlobalScope is about to be destroyed. The client should clear + // the WebServiceWorkerGlobalScopeProxy when this is called. + virtual void willDestroyWorkerContext() { } + + // WorkerGlobalScope is destroyed and the worker is ready to be terminated. virtual void workerContextDestroyed() { } // Starting worker context is failed. This could happen when loading @@ -63,8 +87,47 @@ public: // This is called on the main thread. virtual void workerContextFailedToStart() { } + // Called when the WorkerGlobalScope had an error or an exception. + virtual void reportException(const WebString& errorMessage, int lineNumber, int columnNumber, const WebString& sourceURL) { } + + // Called when the console message is reported. + virtual void reportConsoleMessage(int source, int level, const WebString& message, int lineNumber, const WebString& sourceURL) { } + + // Inspector related messages. virtual void dispatchDevToolsMessage(const WebString&) { } virtual void saveDevToolsAgentState(const WebString&) { } + + // ServiceWorker specific method. + virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEventResult result) { } + + // ServiceWorker specific method. Called after InstallEvent (dispatched + // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's + // script context. + virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWorkerEventResult result) { } + + // ServiceWorker specific methods. Called after FetchEvent is handled by the + // ServiceWorker's script context. When no response is provided, the browser + // should fallback to native fetch. + virtual void didHandleFetchEvent(int fetchEventID) { } + virtual void didHandleFetchEvent(int fetchEventID, const WebServiceWorkerResponse& response) { } + + // ServiceWorker specific method. Called after SyncEvent (dispatched via + // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script + // context. + virtual void didHandleSyncEvent(int syncEventID) { } + + // Ownership of the returned object is transferred to the caller. + virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(blink::WebDataSource*) { return 0; } + + // Ownership of the passed callbacks is transferred to the callee, callee + // should delete the callbacks after calling either onSuccess or onError. + // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are + // passed to the WebServiceWorkerClientsCallbacks implementation. + virtual void getClients(WebServiceWorkerClientsCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } + + // Callee receives ownership of the passed vector. + // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 + virtual void postMessageToClient(int clientID, const WebString&, WebMessagePortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebServiceWorkerContextProxy.h b/chromium/third_party/WebKit/public/web/WebServiceWorkerContextProxy.h index f00f1cd2241..6c6328d0bff 100644 --- a/chromium/third_party/WebKit/public/web/WebServiceWorkerContextProxy.h +++ b/chromium/third_party/WebKit/public/web/WebServiceWorkerContextProxy.h @@ -31,8 +31,11 @@ #ifndef WebServiceWorkerContextProxy_h #define WebServiceWorkerContextProxy_h +#include "public/platform/WebMessagePortChannel.h" + namespace blink { +class WebServiceWorkerRequest; class WebString; // A proxy interface to talk to the worker's GlobalScope implementation. @@ -41,13 +44,18 @@ class WebServiceWorkerContextProxy { public: virtual ~WebServiceWorkerContextProxy() { } - // FIXME: Add service-worker specific methods. + virtual void dispatchActivateEvent(int eventID) = 0; + // FIXME: This needs to pass the active service worker info. + virtual void dispatchInstallEvent(int installEventID) = 0; + virtual void dispatchFetchEvent(int fetchEventID, const WebServiceWorkerRequest& webRequest) = 0; + + virtual void dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray& channels) = 0; + + virtual void dispatchPushEvent(int eventID, const WebString& data) = 0; - virtual void resumeWorkerContext() { } - virtual void attachDevTools() { } - virtual void reattachDevTools(const WebString& savedState) { } - virtual void detachDevTools() { } - virtual void dispatchDevToolsMessage(const WebString&) { } + // Once the ServiceWorker has finished handling the sync event + // didHandleSyncEvent is called on the context client. + virtual void dispatchSyncEvent(int syncEventID) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebServiceWorkerNetworkProvider.h b/chromium/third_party/WebKit/public/web/WebServiceWorkerNetworkProvider.h new file mode 100644 index 00000000000..a48be056d0a --- /dev/null +++ b/chromium/third_party/WebKit/public/web/WebServiceWorkerNetworkProvider.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef WebServiceWorkerNetworkProvider_h +#define WebServiceWorkerNetworkProvider_h + +namespace blink { + +class WebDataSource; +class WebURLRequest; + +// This interface is implemented by the client and is only called on the main thread. +class WebServiceWorkerNetworkProvider { +public: + virtual ~WebServiceWorkerNetworkProvider() { } + + // A request is about to be sent out, and the client may modify it. Request + // is writable, and changes to the URL, for example, will change the request + // made. + virtual void willSendRequest(blink::WebDataSource*, blink::WebURLRequest&) { } +}; + +} // namespace blink + +#endif // WebServiceWorkerNetworkProvider_h diff --git a/chromium/third_party/WebKit/public/web/WebSettings.h b/chromium/third_party/WebKit/public/web/WebSettings.h index 3512c274a99..3ea9d69d5ce 100644 --- a/chromium/third_party/WebKit/public/web/WebSettings.h +++ b/chromium/third_party/WebKit/public/web/WebSettings.h @@ -53,6 +53,7 @@ public: }; virtual bool mainFrameResizesAreOrientationChanges() const = 0; + virtual bool shrinksViewportContentToFit() const = 0; virtual bool scrollAnimatorEnabled() const = 0; virtual bool touchEditingEnabled() const = 0; virtual bool viewportEnabled() const = 0; @@ -60,23 +61,33 @@ public: virtual void setAccelerated2dCanvasEnabled(bool) = 0; virtual void setAccelerated2dCanvasMSAASampleCount(int) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; - virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool) = 0; - virtual void setAcceleratedCompositingForAnimationEnabled(bool) = 0; virtual void setAcceleratedCompositingForCanvasEnabled(bool) = 0; virtual void setAcceleratedCompositingForFiltersEnabled(bool) = 0; virtual void setAcceleratedCompositingForFixedPositionEnabled(bool) = 0; virtual void setAcceleratedCompositingForFixedRootBackgroundEnabled(bool) = 0; virtual void setAcceleratedCompositingForOverflowScrollEnabled(bool) = 0; virtual void setCompositorDrivenAcceleratedScrollingEnabled(bool) = 0; - virtual void setAcceleratedCompositingForTransitionEnabled(bool) = 0; - virtual void setAcceleratedCompositingForPluginsEnabled(bool) = 0; - virtual void setAcceleratedCompositingForScrollableFramesEnabled(bool) = 0; + // Not implemented yet, see http://crbug.com/178119 + virtual void setAcceleratedCompositingForTransitionEnabled(bool) { }; virtual void setAcceleratedCompositingForVideoEnabled(bool) = 0; - virtual void setAcceleratedFiltersEnabled(bool) = 0; + // If set to true, allows frames with an https origin to display passive + // contents at an insecure URL. Otherwise, disallows it. The + // FrameLoaderClient set to the frame may override the value set by this + // method. virtual void setAllowDisplayOfInsecureContent(bool) = 0; virtual void setAllowFileAccessFromFileURLs(bool) = 0; virtual void setAllowCustomScrollbarInMainFrame(bool) = 0; + // If set to true, allows frames with an https origin to run active + // contents at an insecure URL. This includes WebSockets. Otherwise, + // disallows it. The FrameLoaderClient set to the frame may override the + // value set by this method. virtual void setAllowRunningOfInsecureContent(bool) = 0; + // If set to true, allows frames with an https origin to connect WebSockets + // with an insecure URL (ws://). Otherwise, disallows it. Only when this is + // set to true, this value overrides the value set by + // setAllowRunningOfInsecureContent() for WebSockets. The FrameLoaderClient + // set to the frame may override the value set by this method. + virtual void setAllowConnectingInsecureWebSocket(bool) = 0; virtual void setAllowScriptsToCloseWindows(bool) = 0; virtual void setAllowUniversalAccessFromFileURLs(bool) = 0; virtual void setAntialiased2dCanvasEnabled(bool) = 0; @@ -86,7 +97,9 @@ public: virtual void setClobberUserAgentInitialScaleQuirk(bool) = 0; virtual void setCompositedScrollingForFramesEnabled(bool) = 0; virtual void setCompositorTouchHitTesting(bool) = 0; + virtual void setContainerCullingEnabled(bool) = 0; virtual void setCookieEnabled(bool) = 0; + virtual void setNavigateOnDragDrop(bool) = 0; virtual void setCursiveFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0; virtual void setDNSPrefetchingEnabled(bool) = 0; virtual void setDOMPasteAllowed(bool) = 0; @@ -95,24 +108,20 @@ public: virtual void setDefaultTextEncodingName(const WebString&) = 0; virtual void setDefaultVideoPosterURL(const WebString&) = 0; void setDeferred2dCanvasEnabled(bool) { } // temporary stub + virtual void setDeferredFiltersEnabled(bool) = 0; virtual void setDeferredImageDecodingEnabled(bool) = 0; virtual void setDeviceScaleAdjustment(float) = 0; virtual void setDeviceSupportsMouse(bool) = 0; virtual void setDeviceSupportsTouch(bool) = 0; virtual void setDoubleTapToZoomEnabled(bool) = 0; virtual void setDownloadableBinaryFontsEnabled(bool) = 0; - virtual void setEditableLinkBehaviorNeverLive() = 0; virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setEnableScrollAnimator(bool) = 0; virtual void setEnableTouchAdjustment(bool) = 0; virtual void setRegionBasedColumnsEnabled(bool) = 0; virtual void setExperimentalWebGLEnabled(bool) = 0; - virtual void setExperimentalWebSocketEnabled(bool) = 0; virtual void setFantasyFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0; virtual void setFixedFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0; - virtual void setFixedPositionCreatesStackingContext(bool) = 0; - virtual void setForceCompositingMode(bool) = 0; - virtual void setFullScreenEnabled(bool) = 0; virtual void setGestureTapHighlightEnabled(bool) = 0; virtual void setHyperlinkAuditingEnabled(bool) = 0; virtual void setIgnoreMainFrameOverflowHiddenQuirk(bool) = 0; @@ -122,16 +131,14 @@ public: virtual void setJavaScriptCanOpenWindowsAutomatically(bool) = 0; virtual void setJavaScriptEnabled(bool) = 0; virtual void setLayerSquashingEnabled(bool) = 0; - virtual void setLayoutFallbackWidth(int) = 0; virtual void setLoadsImagesAutomatically(bool) = 0; virtual void setLoadWithOverviewMode(bool) = 0; virtual void setLocalStorageEnabled(bool) = 0; virtual void setMainFrameClipsContent(bool) = 0; virtual void setMainFrameResizesAreOrientationChanges(bool) = 0; virtual void setMaxTouchPoints(int) = 0; + virtual void setMediaControlsOverlayPlayButtonEnabled(bool) = 0; virtual void setMediaPlaybackRequiresUserGesture(bool) = 0; - virtual void setMediaFullscreenRequiresUserGesture(bool) = 0; - virtual void setMemoryInfoEnabled(bool) = 0; virtual void setMinimumAccelerated2dCanvasSize(int) = 0; virtual void setMinimumFontSize(int) = 0; virtual void setMinimumLogicalFontSize(int) = 0; @@ -146,7 +153,6 @@ public: virtual void setPinchOverlayScrollbarThickness(int) = 0; virtual void setPinchVirtualViewportEnabled(bool) = 0; virtual void setPluginsEnabled(bool) = 0; - virtual void setPrivilegedWebGLExtensionsEnabled(bool) = 0; virtual void setRenderVSyncNotificationEnabled(bool) = 0; virtual void setReportScreenSizeInPhysicalPixelsQuirk(bool) = 0; virtual void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0; @@ -159,6 +165,7 @@ public: virtual void setShowFPSCounter(bool) = 0; virtual void setShowPaintRects(bool) = 0; virtual void setShrinksStandaloneImagesToFit(bool) = 0; + virtual void setShrinksViewportContentToFit(bool) = 0; virtual void setSmartInsertDeleteEnabled(bool) = 0; // Spatial navigation feature, when enabled, improves the experience // of keyboard-controlling the web pages which originally were not designed @@ -175,15 +182,15 @@ public: virtual void setTextAreasAreResizable(bool) = 0; virtual void setTextAutosizingEnabled(bool) = 0; virtual void setAccessibilityFontScaleFactor(float) = 0; - virtual void setThreadedHTMLParser(bool) = 0; virtual void setTouchDragDropEnabled(bool) = 0; virtual void setTouchEditingEnabled(bool) = 0; virtual void setUnifiedTextCheckerEnabled(bool) = 0; virtual void setUnsafePluginPastingEnabled(bool) = 0; - virtual void setUsesEncodingDetector(bool) = 0; + virtual void setUseExpandedHeuristicsForGpuRasterization(bool) = 0; virtual void setUseLegacyBackgroundSizeShorthandBehavior(bool) = 0; virtual void setUseSolidColorScrollbars(bool) = 0; virtual void setUseWideViewport(bool) = 0; + virtual void setUsesEncodingDetector(bool) = 0; virtual void setValidationMessageTimerMagnification(int) = 0; virtual void setViewportEnabled(bool) = 0; virtual void setViewportMetaEnabled(bool) = 0; @@ -191,7 +198,6 @@ public: virtual void setViewportMetaMergeContentQuirk(bool) = 0; virtual void setViewportMetaNonUserScalableQuirk(bool) = 0; virtual void setViewportMetaZeroValuesQuirk(bool) = 0; - virtual void setVisualWordMovementEnabled(bool) = 0; virtual void setWebAudioEnabled(bool) = 0; virtual void setWebGLErrorsToConsoleEnabled(bool) = 0; virtual void setWebSecurityEnabled(bool) = 0; diff --git a/chromium/third_party/WebKit/public/web/WebSharedWorker.h b/chromium/third_party/WebKit/public/web/WebSharedWorker.h index 377a8fae8ab..27365ad89b2 100644 --- a/chromium/third_party/WebKit/public/web/WebSharedWorker.h +++ b/chromium/third_party/WebKit/public/web/WebSharedWorker.h @@ -33,7 +33,6 @@ #include "../platform/WebCommon.h" #include "WebContentSecurityPolicy.h" -#include "WebSharedWorkerConnector.h" namespace WebCore { class ScriptExecutionContext; @@ -47,13 +46,19 @@ class WebSharedWorkerClient; class WebURL; // This is the interface to a SharedWorker thread. -// FIXME(horo): Make WebSharedWorker independent from WebSharedWorkerConnector. -class WebSharedWorker : public WebSharedWorkerConnector { +class WebSharedWorker { public: // Invoked from the worker thread to instantiate a WebSharedWorker that interacts with the WebKit worker components. BLINK_EXPORT static WebSharedWorker* create(WebSharedWorkerClient*); - virtual ~WebSharedWorker() {}; + virtual void startWorkerContext( + const WebURL& scriptURL, + const WebString& name, + const WebString& contentSecurityPolicy, + WebContentSecurityPolicyType) = 0; + + // Sends a connect event to the SharedWorker context. + virtual void connect(WebMessagePortChannel*) = 0; // Invoked to shutdown the worker when there are no more associated documents. virtual void terminateWorkerContext() = 0; @@ -61,12 +66,12 @@ public: // Notification when the WebCommonWorkerClient is destroyed. virtual void clientDestroyed() = 0; - virtual void pauseWorkerContextOnStart() { } - virtual void resumeWorkerContext() { } - virtual void attachDevTools() { } - virtual void reattachDevTools(const WebString& savedState) { } - virtual void detachDevTools() { } - virtual void dispatchDevToolsMessage(const WebString&) { } + virtual void pauseWorkerContextOnStart() = 0; + virtual void resumeWorkerContext() = 0; + virtual void attachDevTools() = 0; + virtual void reattachDevTools(const WebString& savedState) = 0; + virtual void detachDevTools() = 0; + virtual void dispatchDevToolsMessage(const WebString&) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebSharedWorkerClient.h b/chromium/third_party/WebKit/public/web/WebSharedWorkerClient.h index 1d953c4def3..89362f35c9d 100644 --- a/chromium/third_party/WebKit/public/web/WebSharedWorkerClient.h +++ b/chromium/third_party/WebKit/public/web/WebSharedWorkerClient.h @@ -50,6 +50,9 @@ class WebSharedWorkerClient { public: virtual void workerContextClosed() = 0; virtual void workerContextDestroyed() = 0; + virtual void workerScriptLoaded() = 0; + virtual void workerScriptLoadFailed() = 0; + virtual void selectAppCacheID(long long) = 0; // Returns the notification presenter for this worker context. Pointer // is owned by the object implementing WebSharedWorkerClient. @@ -68,9 +71,6 @@ public: virtual void dispatchDevToolsMessage(const WebString&) { } virtual void saveDevToolsAgentState(const WebString&) { } - -protected: - ~WebSharedWorkerClient() { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebSharedWorkerConnector.h b/chromium/third_party/WebKit/public/web/WebSharedWorkerConnector.h index 8e1d2d682d2..0371737102f 100644 --- a/chromium/third_party/WebKit/public/web/WebSharedWorkerConnector.h +++ b/chromium/third_party/WebKit/public/web/WebSharedWorkerConnector.h @@ -45,27 +45,15 @@ class WebSharedWorkerConnector { public: virtual ~WebSharedWorkerConnector() { } - // Returns false if the thread hasn't been started yet (script loading has not taken place). - // FIXME(atwilson): Remove this when we move the initial script loading into the worker process. - virtual bool isStarted() = 0; - - virtual void startWorkerContext( - const WebURL& scriptURL, - const WebString& name, - const WebString& userAgent, - const WebString& sourceCode, - const WebString& contentSecurityPolicy, - WebContentSecurityPolicyType, - long long scriptResourceAppCacheID) = 0; - class ConnectListener { public: // Invoked once the connect event has been sent so the caller can free this object. virtual void connected() = 0; + virtual void scriptLoadFailed() = 0; }; // Sends a connect event to the SharedWorker context. The listener is invoked when this async operation completes. - virtual void connect(WebMessagePortChannel*, ConnectListener* = 0) = 0; + virtual void connect(WebMessagePortChannel*, ConnectListener*) = 0; }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h b/chromium/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h index 97129a3239f..45a4a6914d8 100644 --- a/chromium/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h +++ b/chromium/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h @@ -31,10 +31,11 @@ #ifndef WebSharedWorkerRepositoryClient_h #define WebSharedWorkerRepositoryClient_h -#include "WebSharedWorker.h" +#include "WebSharedWorkerConnector.h" namespace blink { +enum WebContentSecurityPolicyType; class WebString; class WebURL; @@ -43,15 +44,9 @@ public: // Unique identifier for the parent document of a worker (unique within a given process). typedef unsigned long long DocumentID; - // Creates a new shared worker. This may return null. - // FIXME(horo):Remove this method. - virtual WebSharedWorker* createSharedWorker(const WebURL&, const WebString&, DocumentID) { return 0; } - // Creates a new shared worker connector. This may return null. - virtual WebSharedWorkerConnector* createSharedWorkerConnector(const WebURL& url, const WebString& name, DocumentID id) - { - return createSharedWorker(url, name, id); - } + virtual WebSharedWorkerConnector* createSharedWorkerConnector(const WebURL& url, const WebString& name, DocumentID id, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType) { return 0; } + // Invoked when a document has been detached. DocumentID can be re-used after documentDetached() is invoked. virtual void documentDetached(DocumentID) { } diff --git a/chromium/third_party/WebKit/public/web/WebSocket.h b/chromium/third_party/WebKit/public/web/WebSocket.h index 589a5098000..01755bfb8ae 100644 --- a/chromium/third_party/WebKit/public/web/WebSocket.h +++ b/chromium/third_party/WebKit/public/web/WebSocket.h @@ -33,6 +33,7 @@ #include "../platform/WebCommon.h" #include "../platform/WebPrivatePtr.h" +#include "../platform/WebString.h" namespace WebCore { class WebSocketChannel; } @@ -40,7 +41,6 @@ namespace blink { class WebArrayBuffer; class WebDocument; -class WebString; class WebURL; class WebSocketClient; @@ -84,11 +84,11 @@ public: virtual bool setBinaryType(BinaryType) = 0; virtual void connect(const WebURL&, const WebString& protocol) = 0; - virtual WebString subprotocol() = 0; - virtual WebString extensions() = 0; + virtual WebString subprotocol() { return WebString(); } + virtual WebString extensions() { return WebString(); } virtual bool sendText(const WebString&) = 0; virtual bool sendArrayBuffer(const WebArrayBuffer&) = 0; - virtual unsigned long bufferedAmount() const = 0; + virtual unsigned long bufferedAmount() const { return 0; } virtual void close(int code, const WebString& reason) = 0; virtual void fail(const WebString& reason) = 0; virtual void disconnect() = 0; diff --git a/chromium/third_party/WebKit/public/web/WebSocketClient.h b/chromium/third_party/WebKit/public/web/WebSocketClient.h index 35896f82b0b..666a018cd37 100644 --- a/chromium/third_party/WebKit/public/web/WebSocketClient.h +++ b/chromium/third_party/WebKit/public/web/WebSocketClient.h @@ -46,13 +46,18 @@ public: }; virtual ~WebSocketClient() { } - virtual void didConnect() { } + virtual void didConnect(const WebString& subprotocol, const WebString& extensions) { } virtual void didReceiveMessage(const WebString& message) { } virtual void didReceiveArrayBuffer(const WebArrayBuffer& arrayBuffer) { } virtual void didReceiveMessageError() { } - virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) { } + virtual void didConsumeBufferedAmount(unsigned long consumed) { } virtual void didStartClosingHandshake() { } - virtual void didClose(unsigned long bufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const WebString& reason) { } + virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short code, const WebString& reason) { } + + // FIXME: Deperecate these methods. + virtual void didConnect() { } + virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) { } + virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const WebString& reason) { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebSpeechGrammar.h b/chromium/third_party/WebKit/public/web/WebSpeechGrammar.h index 6c6f1379fd0..f0c4cd2c014 100644 --- a/chromium/third_party/WebKit/public/web/WebSpeechGrammar.h +++ b/chromium/third_party/WebKit/public/web/WebSpeechGrammar.h @@ -49,8 +49,8 @@ public: BLINK_EXPORT void assign(const WebSpeechGrammar&); #if BLINK_IMPLEMENTATION - WebSpeechGrammar(const WTF::PassRefPtr<WebCore::SpeechGrammar>&); - WebSpeechGrammar& operator=(const WTF::PassRefPtr<WebCore::SpeechGrammar>&); + explicit WebSpeechGrammar(WebCore::SpeechGrammar*); + WebSpeechGrammar& operator=(WebCore::SpeechGrammar*); #endif private: diff --git a/chromium/third_party/WebKit/public/web/WebSpeechInputController.h b/chromium/third_party/WebKit/public/web/WebSpeechInputController.h deleted file mode 100644 index 6556330ef7e..00000000000 --- a/chromium/third_party/WebKit/public/web/WebSpeechInputController.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -#ifndef WebSpeechInputController_h -#define WebSpeechInputController_h - -#include "../platform/WebCommon.h" - -namespace blink { - -struct WebRect; -class WebSecurityOrigin; -class WebString; - -// Provides an embedder API called by WebKit. -class WebSpeechInputController { -public: - // Starts speech recognition. Speech will get recorded until the endpointer detects silence, - // runs to the limit or stopRecording is called. Progress indications and the recognized - // text are returned via the listener interface. elementRect is the position - // of the element where the user clicked in the RootView coordinate system. - virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar, const WebSecurityOrigin& origin) - { - BLINK_ASSERT_NOT_REACHED(); - return false; - } - - // Cancels an ongoing recognition and discards any audio recorded so far. No partial - // recognition results are returned to the listener. - virtual void cancelRecognition(int) { BLINK_ASSERT_NOT_REACHED(); } - - // Stops audio recording and performs recognition with the audio recorded until now - // (does not discard audio). This is an optional call and is typically invoked if the user - // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech - // recording 'endpointer' should detect silence in the input and stop recording automatically. - // Call startRecognition() to record audio and recognize speech again. - virtual void stopRecording(int) { BLINK_ASSERT_NOT_REACHED(); } - -protected: - virtual ~WebSpeechInputController() { } -}; - -} // namespace blink - -#endif // WebSpeechInputController_h diff --git a/chromium/third_party/WebKit/public/web/WebSpeechInputListener.h b/chromium/third_party/WebKit/public/web/WebSpeechInputListener.h deleted file mode 100644 index e352a194cd7..00000000000 --- a/chromium/third_party/WebKit/public/web/WebSpeechInputListener.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -#ifndef WebSpeechInputListener_h -#define WebSpeechInputListener_h - -#include "WebSpeechInputResult.h" - -namespace blink { - -class WebString; - -// Provides a WebKit API called by the embedder. -// A typical sequence of calls to the listener would be -// 1 call to didCompleteRecording -// 0 or more calls to setRecognitionResult -// 1 call to didCompleteRecognition -class WebSpeechInputListener { -public: - // Informs that audio recording has completed and recognition is underway. This gets invoked - // irrespective of whether recording was stopped automatically by the 'endpointer' or if - // WebSpeechInputController::stopRecording() was called. - // Typically after this call the listener would update the UI to reflect that recognition is - // in progress. - virtual void didCompleteRecording(int) { BLINK_ASSERT_NOT_REACHED(); } - - // Gives results from speech recognition, either partial or the final results. - // This method can potentially get called multiple times if there are partial results - // available as the user keeps speaking. If the speech could not be recognized properly - // or if there was any other errors in the process, this method may never be called. - virtual void setRecognitionResult(int, const WebSpeechInputResultArray&) { BLINK_ASSERT_NOT_REACHED(); } - - // Informs that speech recognition has completed. This gets invoked irrespective of whether - // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The - // handler typically frees up any temporary resources allocated and waits for the next speech - // recognition request. - virtual void didCompleteRecognition(int) { BLINK_ASSERT_NOT_REACHED(); } - -protected: - ~WebSpeechInputListener() { } -}; - -} // namespace blink - -#endif // WebSpeechInputListener_h diff --git a/chromium/third_party/WebKit/public/web/WebSpeechRecognitionHandle.h b/chromium/third_party/WebKit/public/web/WebSpeechRecognitionHandle.h index 432d8fdfcdc..c56a1be1eed 100644 --- a/chromium/third_party/WebKit/public/web/WebSpeechRecognitionHandle.h +++ b/chromium/third_party/WebKit/public/web/WebSpeechRecognitionHandle.h @@ -62,9 +62,9 @@ public: BLINK_EXPORT bool lessThan(const WebSpeechRecognitionHandle&) const; #if BLINK_IMPLEMENTATION - WebSpeechRecognitionHandle(const WTF::PassRefPtr<WebCore::SpeechRecognition>&); - WebSpeechRecognitionHandle& operator=(const WTF::PassRefPtr<WebCore::SpeechRecognition>&); - operator WTF::PassRefPtr<WebCore::SpeechRecognition>() const; + explicit WebSpeechRecognitionHandle(WebCore::SpeechRecognition*); + WebSpeechRecognitionHandle& operator=(WebCore::SpeechRecognition*); + operator WebCore::SpeechRecognition*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/web/WebSpeechRecognitionResult.h b/chromium/third_party/WebKit/public/web/WebSpeechRecognitionResult.h index e070ca2533f..d34e00bde9e 100644 --- a/chromium/third_party/WebKit/public/web/WebSpeechRecognitionResult.h +++ b/chromium/third_party/WebKit/public/web/WebSpeechRecognitionResult.h @@ -48,7 +48,7 @@ public: BLINK_EXPORT void reset(); #if BLINK_IMPLEMENTATION - operator WTF::PassRefPtr<WebCore::SpeechRecognitionResult>() const; + operator WebCore::SpeechRecognitionResult*() const; #endif private: diff --git a/chromium/third_party/WebKit/public/web/WebSurroundingText.h b/chromium/third_party/WebKit/public/web/WebSurroundingText.h index aa6e268faa5..b5abbc83462 100644 --- a/chromium/third_party/WebKit/public/web/WebSurroundingText.h +++ b/chromium/third_party/WebKit/public/web/WebSurroundingText.h @@ -38,8 +38,11 @@ namespace blink { class WebHitTestResult; class WebNode; +class WebRange; struct WebPoint; +// WebSurroundingText is a Blink API that gives access to the SurroundingText +// API. It allows caller to know the text surrounding a point or a range. class WebSurroundingText { public: WebSurroundingText() { } @@ -48,17 +51,34 @@ public: BLINK_EXPORT bool isNull() const; BLINK_EXPORT void reset(); - // Initializes the object to get the surrounding text centered in the position relative to a provided node. + // Initializes the object to get the surrounding text centered in the + // position relative to a provided node. // The maximum length of the contents retrieved is defined by maxLength. BLINK_EXPORT void initialize(const WebNode&, const WebPoint&, size_t maxLength); + // Initializes the object to get the text surrounding a given range. + // The maximum length of the contents retrieved is defined by maxLength. + // It does not include the text inside the range. + BLINK_EXPORT void initialize(const WebRange&, size_t maxLength); + // Surrounding text content retrieved. BLINK_EXPORT WebString textContent() const; - // Offset in the text content of the initial hit position (or provided offset in the node). + // Offset in the text content of the initial hit position (or provided + // offset in the node). + // This should only be called when WebSurroundingText has been initialized + // with a WebPoint. + // DEPRECATED: use startOffsetInTextContent() or endOffsetInTextContent(). BLINK_EXPORT size_t hitOffsetInTextContent() const; - // Convert start/end positions in the content text string into a WebKit text range. + // Start offset of the initial text in the text content. + BLINK_EXPORT size_t startOffsetInTextContent() const; + + // End offset of the initial text in the text content. + BLINK_EXPORT size_t endOffsetInTextContent() const; + + // Convert start/end positions in the content text string into a WebKit text + // range. BLINK_EXPORT WebRange rangeFromContentOffsets(size_t startOffsetInContent, size_t endOffsetInContent); protected: diff --git a/chromium/third_party/WebKit/public/web/WebTestingSupport.h b/chromium/third_party/WebKit/public/web/WebTestingSupport.h index 5d3ace80639..33f316a7742 100644 --- a/chromium/third_party/WebKit/public/web/WebTestingSupport.h +++ b/chromium/third_party/WebKit/public/web/WebTestingSupport.h @@ -27,15 +27,14 @@ #define WebTestingSupport_h #include "../platform/WebCommon.h" +#include "WebFrame.h" namespace blink { -class WebFrame; - class WebTestingSupport { public: - BLINK_EXPORT static void injectInternalsObject(WebFrame*); - BLINK_EXPORT static void resetInternalsObject(WebFrame*); + BLINK_EXPORT static void injectInternalsObject(WebLocalFrame*); + BLINK_EXPORT static void resetInternalsObject(WebLocalFrame*); }; } diff --git a/chromium/third_party/WebKit/public/web/WebTextAreaElement.h b/chromium/third_party/WebKit/public/web/WebTextAreaElement.h index fae3995b0a0..489a30882b5 100644 --- a/chromium/third_party/WebKit/public/web/WebTextAreaElement.h +++ b/chromium/third_party/WebKit/public/web/WebTextAreaElement.h @@ -52,13 +52,10 @@ public: } void assign(const WebTextAreaElement& element) { WebFormControlElement::assign(element); } - BLINK_EXPORT void setValue(const WebString&); - BLINK_EXPORT WebString value() const; - #if BLINK_IMPLEMENTATION - WebTextAreaElement(const WTF::PassRefPtr<WebCore::HTMLTextAreaElement>&); - WebTextAreaElement& operator=(const WTF::PassRefPtr<WebCore::HTMLTextAreaElement>&); - operator WTF::PassRefPtr<WebCore::HTMLTextAreaElement>() const; + WebTextAreaElement(const PassRefPtrWillBeRawPtr<WebCore::HTMLTextAreaElement>&); + WebTextAreaElement& operator=(const PassRefPtrWillBeRawPtr<WebCore::HTMLTextAreaElement>&); + operator PassRefPtrWillBeRawPtr<WebCore::HTMLTextAreaElement>() const; #endif }; diff --git a/chromium/third_party/WebKit/public/web/WebTextDirection.h b/chromium/third_party/WebKit/public/web/WebTextDirection.h index 3bdbb9e0231..a236c86c6bf 100644 --- a/chromium/third_party/WebKit/public/web/WebTextDirection.h +++ b/chromium/third_party/WebKit/public/web/WebTextDirection.h @@ -38,6 +38,7 @@ enum WebTextDirection { WebTextDirectionDefault, // Natural writing direction ("inherit") WebTextDirectionLeftToRight, WebTextDirectionRightToLeft, + WebTextDirectionLast = WebTextDirectionRightToLeft }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebTouchAction.h b/chromium/third_party/WebKit/public/web/WebTouchAction.h index 0c793d0916b..2643199d264 100755..100644 --- a/chromium/third_party/WebKit/public/web/WebTouchAction.h +++ b/chromium/third_party/WebKit/public/web/WebTouchAction.h @@ -38,7 +38,8 @@ enum WebTouchAction { WebTouchActionAuto = 0x0, WebTouchActionNone = 0x1, WebTouchActionPanX = 0x2, - WebTouchActionPanY = 0x4 + WebTouchActionPanY = 0x4, + WebTouchActionPinchZoom = 0x8, }; inline WebTouchAction operator| (WebTouchAction a, WebTouchAction b) { return WebTouchAction(int(a) | int(b)); } inline WebTouchAction& operator|= (WebTouchAction& a, WebTouchAction b) { return a = a | b; } diff --git a/chromium/third_party/WebKit/public/web/WebTouchPoint.h b/chromium/third_party/WebKit/public/web/WebTouchPoint.h index 0093f0f6f56..fc0231a5cab 100644 --- a/chromium/third_party/WebKit/public/web/WebTouchPoint.h +++ b/chromium/third_party/WebKit/public/web/WebTouchPoint.h @@ -32,7 +32,7 @@ #define WebTouchPoint_h #include "../platform/WebCommon.h" -#include "../platform/WebPoint.h" +#include "../platform/WebFloatPoint.h" namespace blink { @@ -59,11 +59,11 @@ public: int id; State state; - WebPoint screenPosition; - WebPoint position; + WebFloatPoint screenPosition; + WebFloatPoint position; - int radiusX; - int radiusY; + float radiusX; + float radiusY; float rotationAngle; float force; }; diff --git a/chromium/third_party/WebKit/public/web/WebUserGestureIndicator.h b/chromium/third_party/WebKit/public/web/WebUserGestureIndicator.h index 6696086cd13..b7c7f3cfcf1 100644 --- a/chromium/third_party/WebKit/public/web/WebUserGestureIndicator.h +++ b/chromium/third_party/WebKit/public/web/WebUserGestureIndicator.h @@ -37,12 +37,6 @@ namespace blink { class WebUserGestureToken; -class WebUserGestureHandler { -public: - virtual ~WebUserGestureHandler() { } - virtual void onGesture() = 0; -}; - class WebUserGestureIndicator { public: // Returns true if a user gesture is currently being processed. @@ -55,8 +49,6 @@ public: // continue processing the user gesture later on using a // WebScopedUserGesture. BLINK_EXPORT static WebUserGestureToken currentUserGestureToken(); - - BLINK_EXPORT static void setHandler(WebUserGestureHandler*); }; } diff --git a/chromium/third_party/WebKit/public/web/WebUserMediaClient.h b/chromium/third_party/WebKit/public/web/WebUserMediaClient.h index 877fc7bbaec..54fa97b2354 100644 --- a/chromium/third_party/WebKit/public/web/WebUserMediaClient.h +++ b/chromium/third_party/WebKit/public/web/WebUserMediaClient.h @@ -33,7 +33,7 @@ namespace blink { -class WebMediaStreamSource; +class WebMediaDevicesRequest; class WebUserMediaRequest; template <typename T> class WebVector; @@ -43,6 +43,8 @@ public: virtual void requestUserMedia(const WebUserMediaRequest&) = 0; virtual void cancelUserMediaRequest(const WebUserMediaRequest&) = 0; + virtual void requestMediaDevices(const WebMediaDevicesRequest&) { } + virtual void cancelMediaDevicesRequest(const WebMediaDevicesRequest&) { } }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/WebUserMediaRequest.h b/chromium/third_party/WebKit/public/web/WebUserMediaRequest.h index 562e77b09d1..aa85ad68999 100644 --- a/chromium/third_party/WebKit/public/web/WebUserMediaRequest.h +++ b/chromium/third_party/WebKit/public/web/WebUserMediaRequest.h @@ -74,11 +74,15 @@ public: BLINK_EXPORT void requestSucceeded(const WebMediaStream&); - BLINK_EXPORT void requestFailed(const WebString& description = WebString()); + BLINK_EXPORT void requestDenied(const WebString& description = WebString()); BLINK_EXPORT void requestFailedConstraint(const WebString& constraintName, const WebString& description = WebString()); + BLINK_EXPORT void requestFailedUASpecific(const WebString& name, const WebString& constraintName = WebString(), const WebString& description = WebString()); + + // DEPRECATED + BLINK_EXPORT void requestFailed(const WebString& description = WebString()) { requestDenied(description); } #if BLINK_IMPLEMENTATION - WebUserMediaRequest(const PassRefPtr<WebCore::UserMediaRequest>&); + WebUserMediaRequest(const PassRefPtrWillBeRawPtr<WebCore::UserMediaRequest>&); WebUserMediaRequest(WebCore::UserMediaRequest*); operator WebCore::UserMediaRequest*() const; #endif diff --git a/chromium/third_party/WebKit/public/web/WebValidationMessageClient.h b/chromium/third_party/WebKit/public/web/WebValidationMessageClient.h deleted file mode 100644 index 8d827ec5030..00000000000 --- a/chromium/third_party/WebKit/public/web/WebValidationMessageClient.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef WebValidationMessageClient_h -#define WebValidationMessageClient_h - -#include "WebTextDirection.h" - -namespace blink { - -class WebString; -struct WebRect; - -// Client interface to handle form validation message UI. -// Depecated: This wil be removed when Chromium code siwtches to WebViewClient -// functions. -class WebValidationMessageClient { -public: - // Show a notification popup for the specified form vaidation messages - // besides the anchor rectangle. An implementation of this function should - // not hide the popup until hideValidationMessage call. - virtual void showValidationMessage(const WebRect& anchorInRootView, const WebString& mainText, const WebString& supplementalText, WebTextDirection hint) { } - - // Hide notifation popup for form validation messages. - virtual void hideValidationMessage() { } - - // Move the existing notifation popup for the new anchor position. - virtual void moveValidationMessage(const WebRect& anchorInRootView) { } - -protected: - virtual ~WebValidationMessageClient() { } -}; - -} // namespace blink - -#endif diff --git a/chromium/third_party/WebKit/public/web/WebView.h b/chromium/third_party/WebKit/public/web/WebView.h index 6509d981719..098baacc4a5 100644 --- a/chromium/third_party/WebKit/public/web/WebView.h +++ b/chromium/third_party/WebKit/public/web/WebView.h @@ -35,6 +35,8 @@ #include "../platform/WebString.h" #include "../platform/WebVector.h" #include "WebDragOperation.h" +#include "WebHistoryCommitType.h" +#include "WebHistoryItem.h" #include "WebPageVisibilityState.h" #include "WebWidget.h" @@ -51,20 +53,17 @@ class WebGraphicsContext3D; class WebHitTestResult; class WebNode; class WebPageOverlay; -class WebPermissionClient; class WebPrerendererClient; class WebRange; class WebSettings; class WebSpellCheckClient; class WebString; -class WebPasswordGeneratorClient; -class WebSharedWorkerRepositoryClient; -class WebValidationMessageClient; class WebViewClient; struct WebActiveWheelFlingParameters; struct WebMediaPlayerAction; struct WebPluginAction; struct WebPoint; +struct WebFloatPoint; struct WebWindowFeatures; class WebView : public WebWidget { @@ -93,19 +92,12 @@ public: // This WebFrame will receive events for the main frame and must not // be null. virtual void setMainFrame(WebFrame*) = 0; - // FIXME: Remove initializeMainFrame() after clients have migrated to - // setMainFrame(). - virtual void initializeMainFrame(WebFrameClient*) = 0; // Initializes the various client interfaces. virtual void setAutofillClient(WebAutofillClient*) = 0; virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0; - virtual void setPermissionClient(WebPermissionClient*) = 0; virtual void setPrerendererClient(WebPrerendererClient*) = 0; virtual void setSpellCheckClient(WebSpellCheckClient*) = 0; - virtual void setValidationMessageClient(WebValidationMessageClient*) = 0; - virtual void setPasswordGeneratorClient(WebPasswordGeneratorClient*) = 0; - virtual void setSharedWorkerRepositoryClient(WebSharedWorkerRepositoryClient*) = 0; // Options ------------------------------------------------------------- @@ -154,15 +146,9 @@ public: // WebWindowFeatures are ignored. virtual void setWindowFeatures(const WebWindowFeatures&) = 0; - - // Closing ------------------------------------------------------------- - - // Runs beforeunload handlers for the current page, returning false if - // any handler suppressed unloading. - virtual bool dispatchBeforeUnloadEvent() = 0; - - // Runs unload handlers for the current page. - virtual void dispatchUnloadEvent() = 0; + // Marks the WebView as being opened by a DOM call. This is relevant + // for whether window.close() may be called. + virtual void setOpenedByDOM() = 0; // Frames -------------------------------------------------------------- @@ -187,13 +173,10 @@ public: // Focus the first (last if reverse is true) focusable node. virtual void setInitialFocus(bool reverse) = 0; - // Clears the focused node (and selection if a text field is focused) + // Clears the focused element (and selection if a text field is focused) // to ensure that a text field on the page is not eating keystrokes we // send it. - virtual void clearFocusedNode() = 0; - - // Scrolls the node currently in focus into view. - virtual void scrollFocusedNodeIntoView() = 0; + virtual void clearFocusedElement() = 0; // Scrolls the node currently in focus into |rect|, where |rect| is in // window space. @@ -251,15 +234,31 @@ public: // is scaled up, < 1.0 is scaled down. virtual float pageScaleFactor() const = 0; - // Scales the page and the scroll offset by a given factor, while ensuring - // that the new scroll position does not go beyond the edge of the page. - virtual void setPageScaleFactorPreservingScrollOffset(float) = 0; - + // TODO: Obsolete, the origin parameter is ambiguous with two viewports. Remove + // once Chromium side users are removed. // Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y). // setPageScaleFactor() magnifies and shrinks a page without affecting layout. // On the other hand, zooming affects layout of the page. virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0; + // TODO: Reevaluate if this is needed once all users are converted to using the + // virtual viewport pinch model. + // Temporary to keep old style pinch viewport working while we gradually bring up + // virtual viewport pinch. + virtual void setMainFrameScrollOffset(const WebPoint& origin) = 0; + + // Scales the page without affecting layout by using the pinch-to-zoom viewport. + virtual void setPageScaleFactor(float) = 0; + + // Sets the offset of the pinch-to-zoom viewport within the main frame, in + // partial CSS pixels. The offset will be clamped so the pinch viewport + // stays within the frame's bounds. + virtual void setPinchViewportOffset(const WebFloatPoint&) = 0; + + // Gets the pinch viewport's current offset within the page's main frame, + // in partial CSS pixels. + virtual WebFloatPoint pinchViewportOffset() const = 0; + // PageScaleFactor will be force-clamped between minPageScale and maxPageScale // (and these values will persist until setPageScaleFactorLimits is called // again). @@ -268,14 +267,6 @@ public: virtual float minimumPageScaleFactor() const = 0; virtual float maximumPageScaleFactor() const = 0; - // Save the WebView's current scroll and scale state. Each call to this function - // overwrites the previously saved scroll and scale state. - virtual void saveScrollAndScaleState() = 0; - - // Restore the previously saved scroll and scale state. After restoring the - // state, this function deletes any saved scroll and scale state. - virtual void restoreScrollAndScaleState() = 0; - // Reset any saved values for the scroll and scale state. virtual void resetScrollAndScaleState() = 0; @@ -334,16 +325,15 @@ public: // WebView (if there is such an image) virtual void copyImageAt(const WebPoint&) = 0; + // Save as the image located at a particular point in the + // WebView (if there is such an image) + virtual void saveImageAt(const WebPoint&) = 0; + // Notifies the WebView that a drag has terminated. virtual void dragSourceEndedAt( const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperation operation) = 0; - // Notifies the WebView that a drag is going on. - virtual void dragSourceMovedTo( - const WebPoint& clientPoint, const WebPoint& screenPoint, - WebDragOperation operation) = 0; - // Notfies the WebView that the system drag and drop operation has ended. virtual void dragSourceSystemDragEnded() = 0; @@ -409,26 +399,6 @@ public: virtual WebAXObject accessibilityObject() = 0; - // Autofill ----------------------------------------------------------- - - // Notifies the WebView that Autofill suggestions are available for a node. - // |itemIDs| is a vector of IDs for the menu items. A positive itemID is a - // unique ID for the Autofill entries. Other MenuItemIDs are defined in - // WebAutofillClient.h - virtual void applyAutofillSuggestions( - const WebNode&, - const WebVector<WebString>& names, - const WebVector<WebString>& labels, - const WebVector<WebString>& icons, - const WebVector<int>& itemIDs, - int separatorIndex = -1) = 0; - - // Hides any popup (suggestions, selects...) that might be showing. - virtual void hidePopups() = 0; - - virtual void selectAutofillSuggestionAtIndex(unsigned listIndex) = 0; - - // Context menu -------------------------------------------------------- virtual void performCustomContextMenuAction(unsigned action) = 0; @@ -447,6 +417,9 @@ public: // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); + // Hides any popup (suggestions, selects...) that might be showing. + virtual void hidePopups() = 0; + // Visited link state -------------------------------------------------- @@ -487,17 +460,16 @@ public: // Cancels an active fling, returning true if a fling was active. virtual bool endActiveFlingAnimation() = 0; - virtual bool setEditableSelectionOffsets(int start, int end) = 0; - virtual bool setCompositionFromExistingText(int compositionStart, int compositionEnd, const WebVector<WebCompositionUnderline>& underlines) = 0; - virtual void extendSelectionAndDelete(int before, int after) = 0; - - virtual bool isSelectionEditable() const = 0; - virtual void setShowPaintRects(bool) = 0; virtual void setShowFPSCounter(bool) = 0; virtual void setContinuousPaintingEnabled(bool) = 0; virtual void setShowScrollBottleneckRects(bool) = 0; + // Compute the bounds of the root element of the current selection and fills + // the out-parameter on success. |bounds| coordinates will be relative to + // the contents window and will take into account the current scale level. + virtual void getSelectionRootBounds(WebRect& bounds) const = 0; + // Visibility ----------------------------------------------------------- // Sets the visibility of the WebView. @@ -517,6 +489,14 @@ public: virtual void addPageOverlay(WebPageOverlay*, int /*z-order*/) = 0; virtual void removePageOverlay(WebPageOverlay*) = 0; + + // i18n ----------------------------------------------------------------- + + // Inform the WebView that the accept languages have changed. + // If the WebView wants to get the accept languages value, it will have + // to call the WebViewClient::acceptLanguages(). + virtual void acceptLanguagesChanged() = 0; + // Testing functionality for TestRunner --------------------------------- protected: diff --git a/chromium/third_party/WebKit/public/web/WebViewClient.h b/chromium/third_party/WebKit/public/web/WebViewClient.h index 847237d5b92..748a9d3dcfa 100644 --- a/chromium/third_party/WebKit/public/web/WebViewClient.h +++ b/chromium/third_party/WebKit/public/web/WebViewClient.h @@ -31,7 +31,6 @@ #ifndef WebViewClient_h #define WebViewClient_h -#include "../platform/WebColor.h" #include "../platform/WebGraphicsContext3D.h" #include "../platform/WebString.h" #include "WebAXEnums.h" @@ -39,6 +38,8 @@ #include "WebDragOperation.h" #include "WebFileChooserCompletion.h" #include "WebFileChooserParams.h" +#include "WebFrame.h" +#include "WebNavigatorContentUtilsClient.h" #include "WebPageVisibilityState.h" #include "WebPopupType.h" #include "WebTextAffinity.h" @@ -48,8 +49,6 @@ namespace blink { class WebAXObject; -class WebColorChooser; -class WebColorChooserClient; class WebCompositorOutputSurface; class WebDateTimeChooserCompletion; class WebDragData; @@ -57,31 +56,21 @@ class WebElement; class WebExternalPopupMenu; class WebExternalPopupMenuClient; class WebFileChooserCompletion; -class WebFrame; -class WebGeolocationClient; -class WebGeolocationService; class WebGestureEvent; -class WebHelperPlugin; class WebHitTestResult; class WebImage; class WebInputElement; class WebKeyboardEvent; -class WebMIDIClient; class WebNode; -class WebNotificationPresenter; +class WebPushClient; class WebRange; -class WebSpeechInputController; -class WebSpeechInputListener; class WebSpeechRecognizer; class WebStorageNamespace; class WebURL; class WebURLRequest; -class WebUserMediaClient; class WebView; class WebWidget; -struct WebColorSuggestion; struct WebConsoleMessage; -struct WebContextMenuData; struct WebDateTimeChooserParams; struct WebPoint; struct WebPopupMenuInfo; @@ -103,7 +92,7 @@ public: // could be fulfilled. The client should not load the request. // The policy parameter indicates how the new view will be displayed in // WebWidgetClient::show. - virtual WebView* createView(WebFrame* creator, + virtual WebView* createView(WebLocalFrame* creator, const WebURLRequest& request, const WebWindowFeatures& features, const WebString& name, @@ -125,21 +114,11 @@ public: // Misc ---------------------------------------------------------------- - // Whether or not we should report a detailed message for the given source. - virtual bool shouldReportDetailedMessageForSource(const WebString& source) { return false; } - - // A new message was added to the console. - virtual void didAddMessageToConsole( - const WebConsoleMessage&, const WebString& sourceName, unsigned sourceLine, const WebString& stackTrace) { } - // Called when script in the page calls window.print(). If frame is // non-null, then it selects a particular frame, including its // children, to print. Otherwise, the main frame and its children // should be printed. - virtual void printPage(WebFrame*) { } - - // Called to retrieve the provider of desktop notifications. - virtual WebNotificationPresenter* notificationPresenter() { return 0; } + virtual void printPage(WebLocalFrame*) { } // This method enumerates all the files in the path. It returns immediately // and asynchronously invokes the WebFileChooserCompletion with all the @@ -147,29 +126,13 @@ public: // will never be called. virtual bool enumerateChosenDirectory(const WebString& path, WebFileChooserCompletion*) { return false; } - // Creates the main WebFrame for the specified WebHelperPlugin. - // Called by WebHelperPlugin to provide the WebFrameClient interface for the WebFrame. - virtual void initializeHelperPluginWebFrame(WebHelperPlugin*) { } - - // Navigational -------------------------------------------------------- - - // These notifications bracket any loading that occurs in the WebView. - virtual void didStartLoading() { } - virtual void didStopLoading() { } - - // Notification that some progress was made loading the current page. - // loadProgress is a value between 0 (nothing loaded) and 1.0 (frame fully - // loaded). - virtual void didChangeLoadProgress(WebFrame*, double loadProgress) { } // Editing ------------------------------------------------------------- // These methods allow the client to intercept and overrule editing // operations. virtual void didCancelCompositionOnSelectionChange() { } - virtual void didChangeSelection(bool isSelectionEmpty) { } virtual void didChangeContents() { } - virtual void didExecuteCommand(const WebString& commandName) { } // This method is called in response to WebView's handleInputEvent() // when the default action for the current keyboard event is not @@ -180,22 +143,8 @@ public: // indicating that the default action should be suppressed. virtual bool handleCurrentKeyboardEvent() { return false; } - // Dialogs ------------------------------------------------------------- - - // This method opens the color chooser and returns a new WebColorChooser - // instance. If there is a WebColorChooser already from the last time this - // was called, it ends the color chooser by calling endChooser, and replaces - // it with the new one. The given list of suggestions can be used to show a - // simple interface with a limited set of choices. - - // FIXME: Should be removed when the chromium side change lands. - virtual WebColorChooser* createColorChooser(WebColorChooserClient*, - const WebColor&) { return 0; } - virtual WebColorChooser* createColorChooser( - WebColorChooserClient*, - const WebColor&, - const WebVector<WebColorSuggestion>&) { return 0; } + // Dialogs ------------------------------------------------------------- // This method returns immediately after showing the dialog. When the // dialog is closed, it should call the WebFileChooserCompletion to @@ -222,33 +171,6 @@ public: // Move the existing notifation popup to the new anchor position. virtual void moveValidationMessage(const WebRect& anchorInRootView) { } - // Displays a modal alert dialog containing the given message. Returns - // once the user dismisses the dialog. - virtual void runModalAlertDialog( - WebFrame*, const WebString& message) { } - - // Displays a modal confirmation dialog with the given message as - // description and OK/Cancel choices. Returns true if the user selects - // 'OK' or false otherwise. - virtual bool runModalConfirmDialog( - WebFrame*, const WebString& message) { return false; } - - // Displays a modal input dialog with the given message as description - // and OK/Cancel choices. The input field is pre-filled with - // defaultValue. Returns true if the user selects 'OK' or false - // otherwise. Upon returning true, actualValue contains the value of - // the input field. - virtual bool runModalPromptDialog( - WebFrame*, const WebString& message, const WebString& defaultValue, - WebString* actualValue) { return false; } - - // Displays a modal confirmation dialog containing the given message as - // description and OK/Cancel choices, where 'OK' means that it is okay - // to proceed with closing the view. Returns true if the user selects - // 'OK' or false otherwise. - virtual bool runModalBeforeUnloadDialog( - WebFrame*, const WebString& message) { return true; } - // UI ------------------------------------------------------------------ @@ -261,16 +183,8 @@ public: // Called when keyboard focus switches to an anchor with the given URL. virtual void setKeyboardFocusURL(const WebURL&) { } - // Shows a context menu with commands relevant to a specific element on - // the given frame. Additional context data is supplied. - virtual void showContextMenu(WebFrame*, const WebContextMenuData&) { } - - // Called when the data attached to the currently displayed context menu is - // invalidated. The context menu may be closed if possible. - virtual void clearContextMenu() { } - // Called when a drag-n-drop operation should begin. - virtual void startDragging(WebFrame*, const WebDragData&, WebDragOperationsMask, const WebImage&, const WebPoint& dragImageOffset) { } + virtual void startDragging(WebLocalFrame*, const WebDragData&, WebDragOperationsMask, const WebImage&, const WebPoint& dragImageOffset) { } // Called to determine if drag-n-drop operations may initiate a page // navigation. @@ -284,8 +198,6 @@ public: // Called when a new node gets focused. virtual void focusedNodeChanged(const WebNode&) { } - virtual void numberOfWheelEventHandlersChanged(unsigned) { } - // Indicates two things: // 1) This view may have a new layout now. // 2) Calling layout() is a no-op. @@ -299,6 +211,7 @@ public: // Returns comma separated list of accept languages. virtual WebString acceptLanguages() { return WebString(); } + // Session history ----------------------------------------------------- // Tells the embedder to navigate back or forward in session history by @@ -317,6 +230,7 @@ public: // Notifies embedder about an accessibility event. virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { } + // Developer tools ----------------------------------------------------- // Called to notify the client that the inspector's settings were @@ -325,22 +239,13 @@ public: virtual void didUpdateInspectorSetting(const WebString& key, const WebString& value) { } - // Geolocation --------------------------------------------------------- - - // Access the embedder API for (client-based) geolocation client . - virtual WebGeolocationClient* geolocationClient() { return 0; } - // Access the embedder API for (non-client-based) geolocation services. - virtual WebGeolocationService* geolocationService() { return 0; } // Speech -------------------------------------------------------------- - // Access the embedder API for speech input services. - virtual WebSpeechInputController* speechInputController( - WebSpeechInputListener*) { return 0; } - // Access the embedder API for speech recognition services. virtual WebSpeechRecognizer* speechRecognizer() { return 0; } + // Zoom ---------------------------------------------------------------- // Informs the browser that the zoom levels for this frame have changed from @@ -351,11 +256,24 @@ public: // action that wasn't initiated by the client. virtual void zoomLevelChanged() { } + + // Navigator Content Utils -------------------------------------------- + // Registers a new URL handler for the given protocol. virtual void registerProtocolHandler(const WebString& scheme, - const WebString& baseUrl, - const WebString& url, - const WebString& title) { } + const WebURL& baseUrl, + const WebURL& url, + const WebString& title) { } + + // Unregisters a given URL handler for the given protocol. + virtual void unregisterProtocolHandler(const WebString& scheme, const WebURL& baseUrl, const WebURL& url) { } + + // Check if a given URL handler is registered for the given protocol. + virtual WebCustomHandlersState isProtocolHandlerRegistered(const WebString& scheme, const WebURL& baseUrl, const WebURL& url) + { + return WebCustomHandlersNew; + } + // Visibility ----------------------------------------------------------- @@ -365,13 +283,10 @@ public: return WebPageVisibilityStateVisible; } - // Media Streams ------------------------------------------------------- - - virtual WebUserMediaClient* userMediaClient() { return 0; } - // Web MIDI ------------------------------------------------------------- + // Push Messaging ------------------------------------------------------- - virtual WebMIDIClient* webMIDIClient() { return 0; } + virtual WebPushClient* webPushClient() { return 0; } // Content detection ---------------------------------------------------- @@ -387,6 +302,7 @@ public: // Cancels any previously scheduled content intents that have not yet launched. virtual void cancelScheduledContentIntents() { } + // Draggable regions ---------------------------------------------------- // Informs the browser that the draggable regions have been updated. diff --git a/chromium/third_party/WebKit/public/web/WebWidget.h b/chromium/third_party/WebKit/public/web/WebWidget.h index d0b35d3f96f..54b00f3506d 100644 --- a/chromium/third_party/WebKit/public/web/WebWidget.h +++ b/chromium/third_party/WebKit/public/web/WebWidget.h @@ -41,6 +41,7 @@ namespace blink { +class WebCompositeAndReadbackAsyncCallback; class WebInputEvent; class WebLayerTreeView; class WebMouseEvent; @@ -66,6 +67,13 @@ public: // Called to resize the WebWidget. virtual void resize(const WebSize&) { } + // Resizes the unscaled pinch viewport. Normally the unscaled pinch + // viewport is the same size as the main frame. The passed size becomes the + // size of the viewport when unscaled (i.e. scale = 1). This is used to + // shrink the visible viewport to allow things like the ChromeOS virtual + // keyboard to overlay over content but allow scrolling it into view. + virtual void resizePinchViewport(const WebSize&) { } + // Ends a group of resize events that was started with a call to // willStartLiveResize. virtual void willEndLiveResize() { } @@ -86,29 +94,6 @@ public: // and it may result in calls to WebWidgetClient::didInvalidateRect. virtual void layout() { } - // Called to toggle the WebWidget in or out of force compositing mode. This - // should be called before paint. - virtual void enterForceCompositingMode(bool enter) { } - - // Called to notify the WebWidget that the widget has exited compositing - // mode and cannot reenter. - virtual void didExitCompositingMode() { } - - enum PaintOptions { - // Attempt to fulfill the painting request by reading back from the - // compositor, assuming we're using a compositor to render. - ReadbackFromCompositorIfAvailable, - - // Force the widget to rerender onto the canvas using software. This - // mode ignores 3d transforms and ignores GPU-resident content, such - // as video, canvas, and WebGL. - // - // Note: This option exists on OS(ANDROID) and will hopefully be - // removed once the link disambiguation feature renders using - // the compositor. - ForceSoftwareRenderingAndIgnoreGPUResidentContent, - }; - // Called to paint the rectangular region within the WebWidget // onto the specified canvas at (viewPort.x,viewPort.y). You MUST call // Layout before calling this method. It is okay to call paint @@ -116,7 +101,14 @@ public: // changes are made to the WebWidget (e.g., once events are // processed, it should be assumed that another call to layout is // warranted before painting again). - virtual void paint(WebCanvas*, const WebRect& viewPort, PaintOptions = ReadbackFromCompositorIfAvailable) { } + virtual void paint(WebCanvas*, const WebRect& viewPort) { } + + virtual void paintCompositedDeprecated(WebCanvas*, const WebRect&) { } + + // The caller is responsible for keeping the WebCompositeAndReadbackAsyncCallback + // object alive until it is called. This should only be called when + // isAcceleratedCompositingActive() is true. + virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*) { } // Returns true if we've started tracking repaint rectangles. virtual bool isTrackingRepaints() const { return false; } @@ -226,8 +218,6 @@ public: virtual bool isPagePopup() const { return false; } // Returns true if the WebWidget created is of type WebPopupMenu. virtual bool isPopupMenu() const { return false; } - // Returns true if the WebWidget created is of type WebHelperPlugin. - virtual bool isHelperPlugin() const { return false; } // The WebLayerTreeView initialized on this WebWidgetClient will be going away and // is no longer safe to access. diff --git a/chromium/third_party/WebKit/public/web/WebWidgetClient.h b/chromium/third_party/WebKit/public/web/WebWidgetClient.h index cbc98b8a3f3..277e84a14c4 100644 --- a/chromium/third_party/WebKit/public/web/WebWidgetClient.h +++ b/chromium/third_party/WebKit/public/web/WebWidgetClient.h @@ -58,12 +58,6 @@ public: // Called when the Widget has changed size as a result of an auto-resize. virtual void didAutoResize(const WebSize& newSize) { } - // Called when the compositor is enabled or disabled. The parameter to - // didActivateCompositor() is meaningless. - // FIXME: Remove parameter from didActivateCompositor(). - virtual void didActivateCompositor(int deprecated) { } - virtual void didDeactivateCompositor() { } - // Attempt to initialize compositing for this widget. If this is successful, // layerTreeView() will return a valid WebLayerTreeView. virtual void initializeLayerTreeView() { } @@ -71,6 +65,8 @@ public: // Return a compositing view used for this widget. This is owned by the // WebWidgetClient. virtual WebLayerTreeView* layerTreeView() { return 0; } + // FIXME: Remove all overrides of this and change layerTreeView() above to ASSERT_NOT_REACHED. + virtual bool allowsBrokenNullLayerTreeView() const { return false; } // Sometimes the WebWidget enters a state where it will generate a sequence // of invalidations that should not, by themselves, trigger the compositor @@ -101,11 +97,6 @@ public: // Called when a call to WebWidget::animate is required virtual void scheduleAnimation() { } - // Called to query the state of the rendering back-end. Should return true - // when scheduleAnimation (or possibly some other cause for another frame) - // was called, but before WebWidget::animate actually does a frame. - virtual bool isCompositorFramePending() const { return false; } - // Called when the widget acquires or loses focus, respectively. virtual void didFocus() { } virtual void didBlur() { } @@ -182,6 +173,10 @@ public: // of the touch actions that are permitted for this touch. virtual void setTouchAction(WebTouchAction touchAction) { } + // Called when value of focused text field gets dirty, e.g. value is + // modified by script, not by user input. + virtual void didUpdateTextOfFocusedElementByNonUserInput() { } + protected: ~WebWidgetClient() { } }; diff --git a/chromium/third_party/WebKit/public/web/WebWorkerPermissionClientProxy.h b/chromium/third_party/WebKit/public/web/WebWorkerPermissionClientProxy.h index cbb68242d08..eb420128a7b 100644 --- a/chromium/third_party/WebKit/public/web/WebWorkerPermissionClientProxy.h +++ b/chromium/third_party/WebKit/public/web/WebWorkerPermissionClientProxy.h @@ -31,8 +31,11 @@ #ifndef WebWorkerPermissionClientProxy_h #define WebWorkerPermissionClientProxy_h +#include "public/platform/WebPermissionCallbacks.h" + namespace blink { +class WebPermissionCallbacks; class WebString; // Proxy interface to talk to the document's PermissionClient implementation. @@ -48,7 +51,7 @@ public: return true; } - virtual bool allowFileSystem() + virtual bool requestFileSystemAccessSync() { return true; } diff --git a/chromium/third_party/WebKit/public/web/android/DEPS b/chromium/third_party/WebKit/public/web/android/DEPS new file mode 100644 index 00000000000..6a8ad02cebf --- /dev/null +++ b/chromium/third_party/WebKit/public/web/android/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+..", +] diff --git a/chromium/third_party/WebKit/public/web/android/WebInputEventFactory.h b/chromium/third_party/WebKit/public/web/android/WebInputEventFactory.h deleted file mode 100644 index 22b0affbeeb..00000000000 --- a/chromium/third_party/WebKit/public/web/android/WebInputEventFactory.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2011 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. - */ - -#ifndef WebInputEventFactory_h -#define WebInputEventFactory_h - -#include "../../platform/WebCommon.h" -#include "../WebInputEvent.h" - -namespace blink { - -class WebKeyboardEvent; - -class WebInputEventFactory { -public: - enum MouseEventType { - MouseEventTypeDown = 0, - MouseEventTypeUp, - MouseEventTypeMove, - }; - - enum MouseWheelDirectionType { - MouseWheelDirectionTypeUp = 0, - MouseWheelDirectionTypeDown, - MouseWheelDirectionTypeLeft, - MouseWheelDirectionTypeRight, - }; - - BLINK_EXPORT static WebKeyboardEvent keyboardEvent(WebInputEvent::Type, - int modifiers, - double timeStampSeconds, - int keycode, - WebUChar unicodeCharacter, - bool isSystemKey); - - BLINK_EXPORT static WebMouseEvent mouseEvent(MouseEventType, - WebMouseEvent::Button, - double timeStampSeconds, - int windowX, - int windowY, - int modifiers, - int clickCount); - - BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(MouseWheelDirectionType, - double timeStampSeconds, - int windowX, - int windowY); - - BLINK_EXPORT static WebGestureEvent gestureEvent(WebInputEvent::Type, - double timeStampSeconds, - int x, - int y, - float deltaX, - float deltaY, - int modifiers); - - BLINK_EXPORT static WebGestureEvent gestureEvent(WebInputEvent::Type, - double timeStampSeconds, - int x, - int y, - int modifiers); - - BLINK_EXPORT static bool isSystemKeyEvent(const WebKeyboardEvent&); -}; - -} // namespace blink - -#endif diff --git a/chromium/third_party/WebKit/public/web/mac/WebInputEventFactory.h b/chromium/third_party/WebKit/public/web/mac/WebInputEventFactory.h index 5aad96d2280..93621bf6085 100644 --- a/chromium/third_party/WebKit/public/web/mac/WebInputEventFactory.h +++ b/chromium/third_party/WebKit/public/web/mac/WebInputEventFactory.h @@ -53,7 +53,7 @@ public: BLINK_EXPORT static WebKeyboardEvent keyboardEvent(NSEvent*); BLINK_EXPORT static WebKeyboardEvent keyboardEvent(wchar_t character, int modifiers, double timeStampSeconds); BLINK_EXPORT static WebMouseEvent mouseEvent(NSEvent*, NSView*); - BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(NSEvent*, NSView*); + BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(NSEvent*, NSView*, bool canRubberbandLeft, bool canRubberbandRight); BLINK_EXPORT static WebGestureEvent gestureEvent(NSEvent *, NSView *); BLINK_EXPORT static bool isSystemKeyEvent(const WebKeyboardEvent&); }; diff --git a/chromium/third_party/WebKit/public/web/mac/WebScrollbarTheme.h b/chromium/third_party/WebKit/public/web/mac/WebScrollbarTheme.h index 66cff89944e..50b543b54d8 100644 --- a/chromium/third_party/WebKit/public/web/mac/WebScrollbarTheme.h +++ b/chromium/third_party/WebKit/public/web/mac/WebScrollbarTheme.h @@ -35,16 +35,22 @@ namespace blink { +// This enum must match NSScrollerStyle in the 10.7 SDK. +enum ScrollerStyle { + ScrollerStyleLegacy = 0, + ScrollerStyleOverlay = 1 +}; + class WebScrollbarTheme { public: // Updates the scrollbar appearance and behavior. // |initialButtonDelay| is the current value of NSScrollerButtonDelay from NSUserDefaults. // |autoscrollButtonDelay| is the current value of NSScrollerButtonPeriod from NSUserDefaults. - // |jumpOnTrackClick| is the current value of AppleScrollerPagingBehavior from NSUserDefaults. + // |preferredScrollerStyle| is the current value of +[NSScroller preferredScrollerStyle]. // |redraw| is true if the update requires a redraw to include the change. BLINK_EXPORT static void updateScrollbars( float initialButtonDelay, float autoscrollButtonDelay, - bool jumpOnTrackClick, bool redraw); + ScrollerStyle preferredScrollerStyle, bool redraw); }; } // namespace blink diff --git a/chromium/third_party/WebKit/public/web/mac/WebSubstringUtil.h b/chromium/third_party/WebKit/public/web/mac/WebSubstringUtil.h index 3668cfb2ff9..730036d7481 100644 --- a/chromium/third_party/WebKit/public/web/mac/WebSubstringUtil.h +++ b/chromium/third_party/WebKit/public/web/mac/WebSubstringUtil.h @@ -32,9 +32,11 @@ #define WebSubstringUtil_h #include "../../platform/WebCommon.h" +#include "public/web/WebFrame.h" namespace blink { -class WebFrame; +class WebView; +struct WebPoint; } #if __OBJC__ @@ -47,9 +49,17 @@ namespace blink { class WebSubstringUtil { public: + // Returns an autoreleased NSAttributedString that is the word under + // the given point, or nil on error. + // Upon return, |baselinePoint| is set to the left baseline point in + // AppKit coordinates. + BLINK_EXPORT static NSAttributedString* attributedWordAtPoint(WebView*, + WebPoint, + WebPoint& baselinePoint); + // Returns an autoreleased NSAttributedString that is a substring of the // Frame at the given range, or nil on error. - BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebFrame*, + BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalFrame*, size_t location, size_t length); }; diff --git a/chromium/third_party/WebKit/public/web/win/WebFontRendering.h b/chromium/third_party/WebKit/public/web/win/WebFontRendering.h new file mode 100644 index 00000000000..45229845d6d --- /dev/null +++ b/chromium/third_party/WebKit/public/web/win/WebFontRendering.h @@ -0,0 +1,25 @@ +// Copyright 2014 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebFontRendering_h +#define WebFontRendering_h + +#include "public/platform/WebCommon.h" + +class SkTypeface; +struct IDWriteFactory; + +namespace blink { + +class WebFontRendering { +public: + BLINK_EXPORT static void setUseDirectWrite(bool); + BLINK_EXPORT static void setDirectWriteFactory(IDWriteFactory*); + BLINK_EXPORT static void setUseSubpixelPositioning(bool); + BLINK_EXPORT static void addSideloadedFontForTesting(SkTypeface*); +}; + +} // namespace blink + +#endif diff --git a/chromium/third_party/WebKit/public/web/win/WebInputEventFactory.h b/chromium/third_party/WebKit/public/web/win/WebInputEventFactory.h deleted file mode 100644 index 0dbebc43c03..00000000000 --- a/chromium/third_party/WebKit/public/web/win/WebInputEventFactory.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2009 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. - */ - -#ifndef WebInputEventFactory_h -#define WebInputEventFactory_h - -#include "../../platform/WebCommon.h" - -#include <windows.h> - -namespace blink { - -class WebKeyboardEvent; -class WebMouseEvent; -class WebMouseWheelEvent; - -class WebInputEventFactory { -public: - BLINK_EXPORT static WebKeyboardEvent keyboardEvent(HWND, UINT, WPARAM, LPARAM); - BLINK_EXPORT static WebMouseEvent mouseEvent(HWND, UINT, WPARAM, LPARAM); - BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(HWND, UINT, WPARAM, LPARAM); - - // Windows only provides information on whether a click was a single or - // double click, while we need to know the click count past two. The - // WebInputEventFactory keeps internal state to allow it to synthesize - // that information. In some cases, like fast-running tests, that - // information is known to be stale and needs to be reset; that is the - // function of resetLastClickState(). - BLINK_EXPORT static void resetLastClickState(); - BLINK_EXPORT static bool isSystemKeyEvent(const WebKeyboardEvent&); -}; - -} // namespace blink - -#endif |