Merge from Chromium at DEPS revision r212014

This commit was generated by merge_to_master.py.

Change-Id: Ib07d03553a1e81485ac4ffc92b91e977c4875409
diff --git a/public/platform/Platform.h b/public/platform/Platform.h
index bf6cc0a..4e84817 100644
--- a/public/platform/Platform.h
+++ b/public/platform/Platform.h
@@ -189,9 +189,7 @@
     // DOM Storage --------------------------------------------------
 
     // Return a LocalStorage namespace
-    virtual WebStorageNamespace* createLocalStorageNamespace() { return createLocalStorageNamespace(WebString(), 0); }
-    // FIXME: Remove the argument-taking version once its override is removed from Chromium; the arguments are unused.
-    virtual WebStorageNamespace* createLocalStorageNamespace(const WebString& path, unsigned quota) { return 0; }
+    virtual WebStorageNamespace* createLocalStorageNamespace() { return 0; }
 
 
     // FileSystem ----------------------------------------------------------
@@ -285,6 +283,14 @@
     // discardable.
     virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes) { return 0; }
 
+    // A wrapper for tcmalloc's HeapProfilerStart();
+    virtual void startHeapProfiling(const WebString& /*prefix*/) { }
+    // A wrapper for tcmalloc's HeapProfilerStop();
+    virtual void stopHeapProfiling() { }
+    // A wrapper for tcmalloc's HeapProfilerDump()
+    virtual void dumpHeapProfiling(const WebString& /*reason*/) { }
+    // A wrapper for tcmalloc's GetHeapProfile()
+    virtual WebString getHeapProfile() { return WebString(); }
 
     // Message Ports -------------------------------------------------------
 
diff --git a/public/platform/WebCString.h b/public/platform/WebCString.h
index 81e2065..c80fc59 100644
--- a/public/platform/WebCString.h
+++ b/public/platform/WebCString.h
@@ -36,7 +36,8 @@
 
 #if INSIDE_WEBKIT
 #include <wtf/Forward.h>
-#else
+#endif
+#if !INSIDE_WEBKIT || defined(UNIT_TEST)
 #include <string>
 #endif
 
@@ -105,7 +106,8 @@
         assign(s.data(), s.length());
         return *this;
     }
-
+#endif
+#if !INSIDE_WEBKIT || defined(UNIT_TEST)
     operator std::string() const
     {
         size_t len = length();
diff --git a/public/platform/WebCompositorSupport.h b/public/platform/WebCompositorSupport.h
index 27db83b..5f7d9b8 100644
--- a/public/platform/WebCompositorSupport.h
+++ b/public/platform/WebCompositorSupport.h
@@ -66,9 +66,7 @@
 
     virtual WebContentLayer* createContentLayer(WebContentLayerClient*) { return 0; }
 
-    virtual WebExternalTextureLayer* createExternalTextureLayer(WebExternalTextureLayerClient* = 0) { return 0; }
-
-    virtual WebExternalTextureLayer* createExternalTextureLayerForMailbox(WebExternalTextureLayerClient*) { return 0; }
+    virtual WebExternalTextureLayer* createExternalTextureLayer(WebExternalTextureLayerClient*) { return 0; }
 
     virtual WebImageLayer* createImageLayer() { return 0; }
 
diff --git a/public/platform/WebCryptoAlgorithm.h b/public/platform/WebCryptoAlgorithm.h
index 7703614..73f32b8 100644
--- a/public/platform/WebCryptoAlgorithm.h
+++ b/public/platform/WebCryptoAlgorithm.h
@@ -84,15 +84,15 @@
         return *this;
     }
 
-    WEBKIT_EXPORT WebCryptoAlgorithmId algorithmId() const;
-    WEBKIT_EXPORT const char* algorithmName() const;
+    WEBKIT_EXPORT WebCryptoAlgorithmId id() const;
+    WEBKIT_EXPORT const char* name() const;
 
     WEBKIT_EXPORT WebCryptoAlgorithmParamsType paramsType() const;
 
     // Retrieves the type-specific parameters. The algorithm contains at most 1
     // type of parameters. Retrieving an invalid parameter will return 0.
-    WebCryptoAesCbcParams* aesCbcParams() const;
-    WebCryptoAesKeyGenParams* aesKeyGenParams() const;
+    WEBKIT_EXPORT WebCryptoAesCbcParams* aesCbcParams() const;
+    WEBKIT_EXPORT WebCryptoAesKeyGenParams* aesKeyGenParams() const;
 
 private:
     WEBKIT_EXPORT void assign(const WebCryptoAlgorithm& other);
diff --git a/public/platform/WebCryptoKey.h b/public/platform/WebCryptoKey.h
new file mode 100644
index 0000000..94f437c
--- /dev/null
+++ b/public/platform/WebCryptoKey.h
@@ -0,0 +1,128 @@
+/*
+ * 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 WebCryptoKey_h
+#define WebCryptoKey_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+
+namespace WebKit {
+
+enum WebCryptoKeyType {
+    WebCryptoKeyTypeSecret,
+    WebCryptoKeyTypePublic,
+    WebCryptoKeyTypePrivate,
+};
+
+enum WebCryptoKeyUsage {
+    WebCryptoKeyUsageEncrypt = 1 << 0,
+    WebCryptoKeyUsageDecrypt = 1 << 1,
+    WebCryptoKeyUsageSign = 1 << 2,
+    WebCryptoKeyUsageVerify = 1 << 3,
+    WebCryptoKeyUsageDeriveKey = 1 << 4,
+    WebCryptoKeyUsageWrapKey = 1 << 5,
+    WebCryptoKeyUsageUnwrapKey = 1 << 6,
+#if WEBKIT_IMPLEMENTATION
+    EndOfWebCryptoKeyUsage,
+#endif
+};
+
+// A bitfield of WebCryptoKeyUsage
+typedef int WebCryptoKeyUsageMask;
+
+class WebCryptoAlgorithm;
+class WebCryptoKeyPrivate;
+class WebCryptoKeyHandle;
+
+// The WebCryptoKey represents a key from the Web Crypto API:
+//
+// https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#key-interface
+//
+// WebCryptoKey is just a reference-counted wrapper that manages the lifetime of
+// a "WebCryptoKeyHandle*".
+//
+// WebCryptoKey is:
+//   * Copiable (cheaply)
+//   * Threadsafe if the embedder's WebCryptoKeyHandle is also threadsafe.
+//
+// The embedder is responsible for creating all WebCryptoKeys, and therefore can
+// safely assume any details regarding the type of the wrapped
+// WebCryptoKeyHandle*.
+//
+// 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(); }
+
+    WebCryptoKey(const WebCryptoKey& other) { assign(other); }
+    WebCryptoKey& operator=(const WebCryptoKey& other)
+    {
+        assign(other);
+        return *this;
+    }
+
+    // For an explanation of these parameters see:
+    // 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*.
+    WEBKIT_EXPORT static WebCryptoKey create(WebCryptoKeyHandle*, WebCryptoKeyType, bool extractable, const WebCryptoAlgorithm&, WebCryptoKeyUsageMask);
+
+    // Returns the opaque key handle that was set by the embedder.
+    //   * Safe to downcast to known type (since embedder creates all the keys)
+    //   * Returned pointer's lifetime is bound to |this|
+    WEBKIT_EXPORT WebCryptoKeyHandle* handle() const;
+
+    WEBKIT_EXPORT WebCryptoKeyType type() const;
+    WEBKIT_EXPORT bool extractable() const;
+    WEBKIT_EXPORT const WebCryptoAlgorithm& algorithm() const;
+    WEBKIT_EXPORT WebCryptoKeyUsageMask usages() const;
+
+private:
+    WebCryptoKey() { }
+    WEBKIT_EXPORT void assign(const WebCryptoKey& other);
+    WEBKIT_EXPORT void reset();
+
+    WebPrivatePtr<WebCryptoKeyPrivate> m_private;
+};
+
+// Base class for the embedder to define its own opaque key handle. The lifetime
+// of this object is controlled by WebCryptoKey using reference counting.
+class WebCryptoKeyHandle {
+public:
+    virtual ~WebCryptoKeyHandle() { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/public/platform/WebExternalBitmap.h b/public/platform/WebExternalBitmap.h
new file mode 100644
index 0000000..1470815
--- /dev/null
+++ b/public/platform/WebExternalBitmap.h
@@ -0,0 +1,54 @@
+/*
+ * 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 WebExternalBitmap_h
+#define WebExternalBitmap_h
+
+#include "WebSize.h"
+
+namespace WebKit {
+
+class WebExternalBitmap {
+public:
+    virtual WebSize size() = 0;
+
+    // Sets the size of the bitmap. This may reallocate the bitmap and
+    // invalidate the pointer returned from pixels if the size changes.
+    virtual void setSize(WebSize) = 0;
+
+    // Returns the pixels for the bitmap. The buffer that's returned will
+    // contain size().width * size().height * 4 bytes and will use Skia's byte
+    // order.
+    virtual uint8* pixels() = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebExternalBitmap_h
diff --git a/public/platform/WebExternalTextureLayer.h b/public/platform/WebExternalTextureLayer.h
index 651ea0e..180b81f 100644
--- a/public/platform/WebExternalTextureLayer.h
+++ b/public/platform/WebExternalTextureLayer.h
@@ -49,27 +49,12 @@
     // Clears texture from the layer.
     virtual void clearTexture() = 0;
 
-    // Sets the texture id that represents the layer, in the namespace of the
-    // compositor context.
-    virtual void setTextureId(unsigned) = 0;
-
-    // Sets whether or not the texture should be flipped in the Y direction when
-    // rendered.
-    virtual void setFlipped(bool) = 0;
-
-    // Sets the rect in UV space of the texture that is mapped to the layer
-    // bounds.
-    virtual void setUVRect(const WebFloatRect&) = 0;
-
     // Sets whether every pixel in this layer is opaque. Defaults to false.
     virtual void setOpaque(bool) = 0;
 
     // Sets whether this layer's texture has premultiplied alpha or not. Defaults to true.
     virtual void setPremultipliedAlpha(bool) = 0;
 
-    // Indicates that the most recently provided texture ID is about to be modified externally.
-    virtual void willModifyTexture() = 0;
-
     // Sets whether this context should be rate limited by the compositor. Rate limiting works by blocking
     // invalidate() and invalidateRect() calls if the compositor is too many frames behind.
     virtual void setRateLimitContext(bool) = 0;
diff --git a/public/platform/WebExternalTextureLayerClient.h b/public/platform/WebExternalTextureLayerClient.h
index 4829600..0337a98 100644
--- a/public/platform/WebExternalTextureLayerClient.h
+++ b/public/platform/WebExternalTextureLayerClient.h
@@ -32,24 +32,17 @@
 namespace WebKit {
 
 class WebGraphicsContext3D;
+class WebExternalBitmap;
 struct WebExternalTextureMailbox;
 
-class WebTextureUpdater {
-public:
-    virtual void appendCopy(unsigned sourceTexture, unsigned destinationTexture, WebSize) = 0;
-
-protected:
-    virtual ~WebTextureUpdater() { }
-};
-
 class WebExternalTextureLayerClient {
 public:
-    virtual unsigned prepareTexture(WebTextureUpdater&) = 0;
     virtual WebGraphicsContext3D* context() = 0;
 
-    // Returns true and provides a mailbox if a new frame is available.
-    // Returns false if no new data is available and the old mailbox is to be reused.
-    virtual bool prepareMailbox(WebExternalTextureMailbox*) = 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.
+    virtual bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap* = 0) = 0;
 
     // Notifies the client when a mailbox is no longer in use by the compositor and provides
     // a sync point to wait on before the mailbox could be consumes again by the client.
diff --git a/public/platform/WebFileSystem.h b/public/platform/WebFileSystem.h
index 370bc6b..9693591 100644
--- a/public/platform/WebFileSystem.h
+++ b/public/platform/WebFileSystem.h
@@ -119,8 +119,15 @@
 
     // 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*) { WEBKIT_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.
+    // WebFileSystemCallbacks::didFail() must be called otherwise.
+    virtual void createFileWriter(const WebURL& path, WebFileWriterClient*, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
+
     // Creates a snapshot file for a given file specified by |path|. It returns the metadata of the created snapshot file.
     // The returned metadata should include a local platform path to the snapshot image.
     // In local filesystem cases the backend may simply return the metadata of the file itself (as well as readMetadata does), while in
diff --git a/public/platform/WebFileSystemCallbacks.h b/public/platform/WebFileSystemCallbacks.h
index 746621d..fafbe03 100644
--- a/public/platform/WebFileSystemCallbacks.h
+++ b/public/platform/WebFileSystemCallbacks.h
@@ -37,9 +37,10 @@
 
 namespace WebKit {
 
+struct WebFileInfo;
+class WebFileWriter;
 class WebString;
 class WebURL;
-struct WebFileInfo;
 
 class WebFileSystemCallbacks {
 public:
@@ -65,10 +66,19 @@
     // root URL for the FileSystem when the request is accepted.
     virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL) = 0;
 
+    // Callback for WebFrameClient::createFileWriter. Called with an instance
+    // of WebFileWriter and the target file length. The writer's ownership
+    // is transferred to the callback.
+    virtual void didCreateFileWriter(WebFileWriter* writer, long long length) { WEBKIT_ASSERT_NOT_REACHED(); }
+
     // Called with an error code when a requested operation hasn't been
     // completed.
     virtual void didFail(WebFileError) = 0;
 
+    // Returns true if the caller expects to be blocked until the request
+    // is fullfilled.
+    virtual bool shouldBlockUntilCompletion() const = 0;
+
 protected:
     virtual ~WebFileSystemCallbacks() { }
 };
diff --git a/public/platform/WebGraphicsContext3D.h b/public/platform/WebGraphicsContext3D.h
index a22853b..c866c2b 100644
--- a/public/platform/WebGraphicsContext3D.h
+++ b/public/platform/WebGraphicsContext3D.h
@@ -188,13 +188,6 @@
     // WebGraphicsContext3D implementation.
     virtual void signalSyncPoint(unsigned syncPoint, WebGraphicsSyncPointCallback* callback) { delete callback; }
 
-    // Helper for software compositing path. Reads back the frame buffer into
-    // the memory region pointed to by "pixels" with size "bufferSize". It is
-    // expected that the storage for "pixels" covers (4 * width * height) bytes.
-    // The RGBA channels are packed into "pixels" using SkBitmap's byte
-    // ordering. Returns true on success.
-    virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize, WebGLId framebuffer, int width, int height) = 0;
-
     // Copies the contents of the off-screen render target used by the WebGL
     // context to the corresponding texture used by the compositor.
     virtual void prepareTexture() = 0;
diff --git a/public/platform/WebIDBDatabaseException.h b/public/platform/WebIDBDatabaseException.h
index 5416a5e..c94178e 100644
--- a/public/platform/WebIDBDatabaseException.h
+++ b/public/platform/WebIDBDatabaseException.h
@@ -34,10 +34,10 @@
 namespace WebKit {
 
 enum WebIDBDatabaseException {
-    WebIDBDatabaseExceptionUnknownError = 24,
-    WebIDBDatabaseExceptionConstraintError = 25,
-    WebIDBDatabaseExceptionDataError = 26,
-    WebIDBDatabaseExceptionVersionError = 29,
+    WebIDBDatabaseExceptionUnknownError = 23,
+    WebIDBDatabaseExceptionConstraintError = 24,
+    WebIDBDatabaseExceptionDataError = 25,
+    WebIDBDatabaseExceptionVersionError = 28,
     WebIDBDatabaseExceptionAbortError = 17,
     WebIDBDatabaseExceptionQuotaError = 19,
 };
diff --git a/public/platform/WebIDBFactory.h b/public/platform/WebIDBFactory.h
index f6151f2..6ff3cc1 100644
--- a/public/platform/WebIDBFactory.h
+++ b/public/platform/WebIDBFactory.h
@@ -47,26 +47,9 @@
 public:
     virtual ~WebIDBFactory() { }
 
-    // FIXME: Remove the dataDir-taking version once its override is removed from Chromium; the argument is unused.
-    virtual void getDatabaseNames(WebIDBCallbacks* callbacks, const WebString& databaseIdentifier, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
-    virtual void getDatabaseNames(WebIDBCallbacks* callbacks, const WebString& databaseIdentifier)
-    {
-        getDatabaseNames(callbacks, databaseIdentifier, WebString());
-    }
-
-    // FIXME: Remove the dataDir-taking version once its override is removed from Chromium; the argument is unused.
-    virtual void open(const WebString& name, long long version, long long transactionId, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebString& databaseIdentifier, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
-    virtual void open(const WebString& name, long long version, long long transactionId, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebString& databaseIdentifier)
-    {
-        open(name, version, transactionId, callbacks, databaseCallbacks, databaseIdentifier, WebString());
-    }
-
-    // FIXME: Remove the dataDir-taking version once its override is removed from Chromium; the argument is unused.
-    virtual void deleteDatabase(const WebString& name, WebIDBCallbacks* callbacks, const WebString& databaseIdentifier, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
-    virtual void deleteDatabase(const WebString& name, WebIDBCallbacks* callbacks, const WebString& databaseIdentifier)
-    {
-        deleteDatabase(name, callbacks, databaseIdentifier, WebString());
-    }
+    virtual void getDatabaseNames(WebIDBCallbacks* callbacks, const WebString& databaseIdentifier) { WEBKIT_ASSERT_NOT_REACHED(); }
+    virtual void open(const WebString& name, long long version, long long transactionId, WebIDBCallbacks* callbacks, WebIDBDatabaseCallbacks* databaseCallbacks, const WebString& databaseIdentifier) { WEBKIT_ASSERT_NOT_REACHED(); }
+    virtual void deleteDatabase(const WebString& name, WebIDBCallbacks* callbacks, const WebString& databaseIdentifier) { WEBKIT_ASSERT_NOT_REACHED(); }
 };
 
 } // namespace WebKit
diff --git a/public/platform/WebLayerTreeView.h b/public/platform/WebLayerTreeView.h
index 582e525..0c67c2e 100644
--- a/public/platform/WebLayerTreeView.h
+++ b/public/platform/WebLayerTreeView.h
@@ -123,7 +123,7 @@
 
     // Identify key layers to the compositor when using the pinch virtual viewport.
     virtual void registerPinchViewportLayers(
-        const WebLayer* innerViewportClipLayer,
+        const WebLayer* innerViewportContainerLayer,
         const WebLayer* pageScaleLayerLayer,
         const WebLayer* innerViewportScrollLayer,
         const WebLayer* outerViewportScrollLayer,
diff --git a/public/platform/WebMIDIAccessor.h b/public/platform/WebMIDIAccessor.h
index 119f0b9..59eeb30 100644
--- a/public/platform/WebMIDIAccessor.h
+++ b/public/platform/WebMIDIAccessor.h
@@ -39,6 +39,9 @@
 public:
     virtual ~WebMIDIAccessor() { }
 
+    virtual void startSession() { }
+
+    // FIXME: Remove this obsoleted API. Now access permission is handled though the WebMIDIClient API.
     // |access| is set to true if MIDIOptions.sysex is true. Otherwise false.
     virtual void requestAccess(bool access) { }
     // |timeStamp| is measured in milliseconds as Web MIDI spec defines.
diff --git a/public/platform/WebMIDIAccessorClient.h b/public/platform/WebMIDIAccessorClient.h
index a4a590d..b23dd0e 100644
--- a/public/platform/WebMIDIAccessorClient.h
+++ b/public/platform/WebMIDIAccessorClient.h
@@ -40,6 +40,9 @@
     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() = 0;
+
+    // FIXME: Remove these obsoleted APIs.
     virtual void didAllowAccess() = 0;
     virtual void didBlockAccess() = 0;
 
diff --git a/public/platform/WebVibration.h b/public/platform/WebVibration.h
new file mode 100644
index 0000000..5c61bcd
--- /dev/null
+++ b/public/platform/WebVibration.h
@@ -0,0 +1,41 @@
+/*
+ * 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 WebVibration_h
+#define WebVibration_h
+
+namespace WebKit {
+
+// Maximum duration of a vibration is 10 seconds.
+const unsigned kVibrationDurationMax = 10000;
+
+} // namespace WebKit
+
+#endif // WebVibration_h
diff --git a/public/testing/WebTestInterfaces.h b/public/testing/WebTestInterfaces.h
index bf4496b..8949a75 100644
--- a/public/testing/WebTestInterfaces.h
+++ b/public/testing/WebTestInterfaces.h
@@ -35,6 +35,7 @@
 #include <memory>
 
 namespace WebKit {
+class WebAudioDevice;
 class WebFrame;
 class WebMediaStreamCenter;
 class WebMediaStreamCenterClient;
@@ -74,6 +75,8 @@
 
     WebKit::WebMIDIAccessor* createMIDIAccessor(WebKit::WebMIDIAccessorClient*);
 
+    WebKit::WebAudioDevice* createAudioDevice(double sampleRate);
+
 #if WEBTESTRUNNER_IMPLEMENTATION
     TestInterfaces* testInterfaces();
 #endif
diff --git a/public/testing/WebTestProxy.h b/public/testing/WebTestProxy.h
index e61e791..ae2af9f 100644
--- a/public/testing/WebTestProxy.h
+++ b/public/testing/WebTestProxy.h
@@ -52,6 +52,7 @@
 
 namespace WebKit {
 class WebAccessibilityObject;
+class WebAudioDevice;
 class WebCachedURLRequest;
 class WebColorChooser;
 class WebColorChooserClient;
@@ -188,8 +189,6 @@
     bool runModalPromptDialog(WebKit::WebFrame*, const WebKit::WebString& message, const WebKit::WebString& defaultValue, WebKit::WebString* actualValue);
     bool runModalBeforeUnloadDialog(WebKit::WebFrame*, const WebKit::WebString&);
 
-    void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time);
-    void didCancelClientRedirect(WebKit::WebFrame*);
     void didStartProvisionalLoad(WebKit::WebFrame*);
     void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*);
     bool didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
@@ -459,17 +458,6 @@
         WebTestProxyBase::resetInputMethod();
     }
 
-    // WebFrameClient implementation.
-    virtual void willPerformClientRedirect(WebKit::WebFrame* frame, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fireTime)
-    {
-        WebTestProxyBase::willPerformClientRedirect(frame, from, to, interval, fireTime);
-        Base::willPerformClientRedirect(frame, from, to, interval, fireTime);
-    }
-    virtual void didCancelClientRedirect(WebKit::WebFrame* frame)
-    {
-        WebTestProxyBase::didCancelClientRedirect(frame);
-        Base::didCancelClientRedirect(frame);
-    }
     virtual void didStartProvisionalLoad(WebKit::WebFrame* frame)
     {
         WebTestProxyBase::didStartProvisionalLoad(frame);
diff --git a/public/web/WebBindings.h b/public/web/WebBindings.h
index 9ed8577..2ae8f4d 100644
--- a/public/web/WebBindings.h
+++ b/public/web/WebBindings.h
@@ -129,10 +129,10 @@
     // _NPN_UnregisterObjectOwner
     WEBKIT_EXPORT static void unregisterObjectOwner(NPP);
 
-    // _NPN_GetObjectOwner
+    // Temporary dummy implementation of _NPN_GetObjectOwner.
     WEBKIT_EXPORT static NPP getObjectOwner(NPObject*);
 
-    // Remove this when the corresponding call has been removed from Chrome.
+    // _NPN_UnregisterObject
     WEBKIT_EXPORT static void unregisterObject(NPObject*);
 
     // NPN_UTF8FromIdentifier
@@ -180,7 +180,7 @@
     WEBKIT_EXPORT static void popExceptionHandler();
 
     // Conversion utilities to/from V8 native objects and NPVariant wrappers.
-    WEBKIT_EXPORT static void toNPVariant(v8::Local<v8::Value>, NPP owner, NPVariant* result);
+    WEBKIT_EXPORT static void toNPVariant(v8::Local<v8::Value>, NPObject* root, NPVariant* result);
     WEBKIT_EXPORT static v8::Handle<v8::Value> toV8Value(const NPVariant*);
 };
 
diff --git a/public/web/WebCache.h b/public/web/WebCache.h
index 0425f1e..3aecfa4 100644
--- a/public/web/WebCache.h
+++ b/public/web/WebCache.h
@@ -76,10 +76,6 @@
     // only removes resources from live list, w/o releasing cache memory.
     WEBKIT_EXPORT static void clear();
 
-    // Prunes resource cache. Destroys decoded images data and returns
-    // memory to the system.
-    WEBKIT_EXPORT static void prune();
-
     // Gets the usage statistics from the resource cache.
     WEBKIT_EXPORT static void getUsageStats(UsageStats*);
 
diff --git a/public/web/WebDevToolsAgent.h b/public/web/WebDevToolsAgent.h
index 7b07371..b239767 100644
--- a/public/web/WebDevToolsAgent.h
+++ b/public/web/WebDevToolsAgent.h
@@ -67,12 +67,13 @@
 
     virtual void inspectElementAt(const WebPoint&) = 0;
     virtual void setProcessId(long) = 0;
+    virtual void setLayerTreeId(int) = 0;
 
     virtual void didBeginFrame() = 0;
     virtual void didCancelFrame() = 0;
     virtual void willComposite() = 0;
     virtual void didComposite() = 0;
-    
+
     // Exposed for TestRunner.
     virtual void evaluateInWebInspector(long callId, const WebString& script) = 0;
 
diff --git a/public/web/WebFileChooserParams.h b/public/web/WebFileChooserParams.h
index b92e39f..c651a11 100644
--- a/public/web/WebFileChooserParams.h
+++ b/public/web/WebFileChooserParams.h
@@ -65,18 +65,18 @@
     // before opening a file chooser dialog.
     WebVector<WebString> selectedFiles;
     // See http://www.w3.org/TR/html-media-capture/ for the semantics of the
-    // capture attribute. This string will either be empty (meaning the feature
-    // is disabled) or one of the following values:
-    //  - filesystem (default)
-    //  - camera
-    //  - camcorder
-    //  - microphone
+    // capture attribute. If |useMediaCapture| is true, the media types
+    // indicated in |acceptTypes| should be obtained from the device's
+    // environment using a media capture mechanism. |capture| is deprecated and
+    // provided for compatibility reasons.
     WebString capture;
+    bool useMediaCapture;
 
     WebFileChooserParams()
         : multiSelect(false)
         , directory(false)
         , saveAs(false)
+        , useMediaCapture(false)
     {
     }
 };
diff --git a/public/web/WebFrame.h b/public/web/WebFrame.h
index 9db75ad..68b7440 100644
--- a/public/web/WebFrame.h
+++ b/public/web/WebFrame.h
@@ -42,7 +42,6 @@
 #include "WebURLLoaderOptions.h"
 
 struct NPObject;
-struct _NPP;
 
 namespace v8 {
 class Context;
@@ -218,6 +217,8 @@
 
     // Binds a NPObject as a property of this frame's DOMWindow.
     virtual void bindToWindowObject(const WebString& name, NPObject*) = 0;
+    virtual void bindToWindowObject(
+        const WebString& name, NPObject*, void*) = 0;
 
     // Executes script in the context of the current page.
     virtual void executeScript(const WebScriptSource&) = 0;
@@ -231,6 +232,7 @@
     // WebKit::registerExtension for the corresponding specifier.
     //
     // worldID must be > 0 (as 0 represents the main world).
+    // worldID must be < EmbedderWorldIdLimit, high number used internally.
     virtual void executeScriptInIsolatedWorld(
         int worldID, const WebScriptSource* sources, unsigned numSources,
         int extensionGroup) = 0;
@@ -267,6 +269,7 @@
         const WebScriptSource&) = 0;
 
     // worldID must be > 0 (as 0 represents the main world).
+    // worldID must be < EmbedderWorldIdLimit, high number used internally.
     virtual void executeScriptInIsolatedWorld(
         int worldID, const WebScriptSource* sourcesIn, unsigned numSources,
         int extensionGroup, WebVector<v8::Local<v8::Value> >* results) = 0;
diff --git a/public/web/WebFrameClient.h b/public/web/WebFrameClient.h
index 53607d9..e5a6da2 100644
--- a/public/web/WebFrameClient.h
+++ b/public/web/WebFrameClient.h
@@ -162,15 +162,6 @@
     // A form submission is about to occur.
     virtual void willSubmitForm(WebFrame*, const WebFormElement&) { }
 
-    // A client-side redirect will occur.  This may correspond to a <META
-    // refresh> or some script activity.
-    virtual void willPerformClientRedirect(
-        WebFrame*, const WebURL& from, const WebURL& to,
-        double interval, double fireTime) { }
-
-    // A client-side redirect was cancelled.
-    virtual void didCancelClientRedirect(WebFrame*) { }
-
     // A client-side redirect completed.
     virtual void didCompleteClientRedirect(WebFrame*, const WebURL& fromURL) { }
 
@@ -248,6 +239,9 @@
     // An element will request a resource.
     virtual void willRequestResource(WebFrame*, const WebCachedURLRequest&) { }
 
+    // The request is after preconnect is triggered.
+    virtual void willRequestAfterPreconnect(WebFrame*, 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
diff --git a/public/web/WebInputElement.h b/public/web/WebInputElement.h
index e509b84..f351090 100644
--- a/public/web/WebInputElement.h
+++ b/public/web/WebInputElement.h
@@ -40,7 +40,6 @@
 namespace WebKit {
 
     class WebNodeCollection;
-    class WebTextFieldDecoratorClient;
 
     // Provides readonly access to some properties of a DOM input element node.
     class WebInputElement : public WebFormControlElement {
@@ -113,8 +112,8 @@
         // Returns the direction of the text in this element.
         WEBKIT_EXPORT WebString directionForFormData() const;
 
-        // Return the decoration added by the specified decorator if one exists.
-        WEBKIT_EXPORT WebElement decorationElementFor(WebTextFieldDecoratorClient*);
+        WEBKIT_EXPORT WebElement decorationElementFor(void*);
+        WEBKIT_EXPORT WebElement passwordGeneratorButtonElement() const;
 
 #if WEBKIT_IMPLEMENTATION
         WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
diff --git a/public/web/WebKit.h b/public/web/WebKit.h
index 0d83122..8e54c1b 100644
--- a/public/web/WebKit.h
+++ b/public/web/WebKit.h
@@ -53,6 +53,15 @@
 // terminated by the time this function returns.
 WEBKIT_EXPORT void shutdown();
 
+// Once shutdown, the Platform passed to initializeWithoutV8 will no longer
+// be accessed. No other WebKit objects should be in use when this function is
+// called. Any background threads created by WebKit are promised to be
+// terminated by the time this function returns.
+//
+// If initializeWithoutV8() was used to initialize WebKit, shutdownWithoutV8
+// must be called to shut it down again.
+WEBKIT_EXPORT void shutdownWithoutV8();
+
 // Alters the rendering of content to conform to a fixed set of rules.
 WEBKIT_EXPORT void setLayoutTestMode(bool);
 WEBKIT_EXPORT bool layoutTestMode();
diff --git a/public/web/WebMIDIClient.h b/public/web/WebMIDIClient.h
new file mode 100644
index 0000000..0db27e4
--- /dev/null
+++ b/public/web/WebMIDIClient.h
@@ -0,0 +1,49 @@
+/*
+ * 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 WebMIDIClient_h
+#define WebMIDIClient_h
+
+namespace WebKit {
+class WebMIDIPermissionRequest;
+
+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;
+};
+
+} // namespace WebKit
+
+#endif // WebMIDIClient_h
diff --git a/public/web/WebMIDIPermissionRequest.h b/public/web/WebMIDIPermissionRequest.h
new file mode 100644
index 0000000..e451cd6
--- /dev/null
+++ b/public/web/WebMIDIPermissionRequest.h
@@ -0,0 +1,81 @@
+/*
+ * 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 WebMIDIPermissionRequest_h
+#define WebMIDIPermissionRequest_h
+
+#include "../platform/WebCommon.h"
+#include "../platform/WebPrivatePtr.h"
+
+namespace WebCore {
+class MIDIAccess;
+}
+
+namespace WebKit {
+
+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).
+class WebMIDIPermissionRequest {
+public:
+    WebMIDIPermissionRequest(const WebMIDIPermissionRequest& o) { assign(o); }
+
+    WEBKIT_EXPORT WebSecurityOrigin securityOrigin() const;
+    WEBKIT_EXPORT void setIsAllowed(bool);
+
+    WEBKIT_EXPORT void assign(const WebMIDIPermissionRequest&);
+    WEBKIT_EXPORT bool equals(const WebMIDIPermissionRequest&) const;
+
+#if WEBKIT_IMPLEMENTATION
+    explicit WebMIDIPermissionRequest(const PassRefPtr<WebCore::MIDIAccess>&);
+    explicit WebMIDIPermissionRequest(WebCore::MIDIAccess*);
+#endif
+
+private:
+    WebPrivatePtr<WebCore::MIDIAccess> m_private;
+};
+
+inline bool operator==(const WebMIDIPermissionRequest& a, const WebMIDIPermissionRequest& b)
+{
+    return a.equals(b);
+}
+
+inline bool operator!=(const WebMIDIPermissionRequest& a, const WebMIDIPermissionRequest& b)
+{
+    return !(a == b);
+}
+
+} // namespace WebKit
+
+#endif // WebMIDIPermissionRequest_h
diff --git a/public/web/WebMediaSourceClient.h b/public/web/WebMediaSourceClient.h
index 4492414..537116c 100644
--- a/public/web/WebMediaSourceClient.h
+++ b/public/web/WebMediaSourceClient.h
@@ -58,6 +58,9 @@
     virtual double duration() = 0;
     virtual void setDuration(double) = 0;
     virtual void endOfStream(EndOfStreamStatus) = 0;
+    // FIXME: Remove default implementation once Chromium changes land.
+    virtual void markEndOfStream(EndOfStreamStatus status) { endOfStream(status); }
+    virtual void unmarkEndOfStream() { };
 };
 
 } // namespace WebKit
diff --git a/public/web/WebNode.h b/public/web/WebNode.h
index 8028804..ccfed25 100644
--- a/public/web/WebNode.h
+++ b/public/web/WebNode.h
@@ -100,7 +100,6 @@
     WEBKIT_EXPORT WebNode nextSibling() const;
     WEBKIT_EXPORT bool hasChildNodes() const;
     WEBKIT_EXPORT WebNodeList childNodes();
-    WEBKIT_EXPORT bool appendChild(const WebNode& child);
     WEBKIT_EXPORT WebString createMarkup() const;
     WEBKIT_EXPORT bool isLink() const;
     WEBKIT_EXPORT bool isTextNode() const;
diff --git a/public/web/WebPasswordGeneratorClient.h b/public/web/WebPasswordGeneratorClient.h
new file mode 100644
index 0000000..50a4130
--- /dev/null
+++ b/public/web/WebPasswordGeneratorClient.h
@@ -0,0 +1,47 @@
+/*
+ * 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 WebPasswordGeneratorClient_h
+#define WebPasswordGeneratorClient_h
+
+namespace WebKit {
+
+class WebInputElement;
+
+class WebPasswordGeneratorClient {
+public:
+    virtual void openPasswordGenerator(WebInputElement&) = 0;
+
+    virtual ~WebPasswordGeneratorClient() { }
+};
+
+}
+
+#endif // WebPasswordGeneratorClient_h
diff --git a/public/web/WebPlugin.h b/public/web/WebPlugin.h
index 291bab3..daf962a 100644
--- a/public/web/WebPlugin.h
+++ b/public/web/WebPlugin.h
@@ -64,7 +64,7 @@
     virtual WebPluginContainer* container() const { return 0; }
 
     virtual NPObject* scriptableObject() = 0;
-    virtual struct _NPP* pluginNPP() = 0;
+    virtual struct _NPP* pluginNPP() { return 0; }
 
     // Returns true if the form submission value is successfully obtained
     // from the plugin. The value would be associated with the name attribute
diff --git a/public/web/WebRuntimeFeatures.h b/public/web/WebRuntimeFeatures.h
index c46aeb1..58f409f 100644
--- a/public/web/WebRuntimeFeatures.h
+++ b/public/web/WebRuntimeFeatures.h
@@ -45,34 +45,9 @@
     WEBKIT_EXPORT static void enableExperimentalFeatures(bool);
     WEBKIT_EXPORT static void enableTestOnlyFeatures(bool);
 
-    // FIXME: Delete after removing all callers in Content.
-    static void enableFullScreenAPI(bool enable) { enableFullscreen(enable); }
-    static void enableIndexedDatabase(bool enable) { enableIndexedDB(enable); }
-
     WEBKIT_EXPORT static void enableApplicationCache(bool);
     WEBKIT_EXPORT static bool isApplicationCacheEnabled();
 
-    WEBKIT_EXPORT static void enableCanvasPath(bool);
-    WEBKIT_EXPORT static bool isCanvasPathEnabled();
-
-    WEBKIT_EXPORT static void enableCSSCompositing(bool);
-    WEBKIT_EXPORT static bool isCSSCompositingEnabled();
-
-    WEBKIT_EXPORT static void enableCSSExclusions(bool);
-    WEBKIT_EXPORT static bool isCSSExclusionsEnabled();
-
-    WEBKIT_EXPORT static void enableCSSGridLayout(bool);
-    WEBKIT_EXPORT static bool isCSSGridLayoutEnabled();
-
-    WEBKIT_EXPORT static void enableCSSRegions(bool);
-    WEBKIT_EXPORT static bool isCSSRegionsEnabled();
-
-    WEBKIT_EXPORT static void enableCSSTouchAction(bool);
-    WEBKIT_EXPORT static bool isCSSTouchActionEnabled();
-
-    WEBKIT_EXPORT static void enableCustomDOMElements(bool);
-    WEBKIT_EXPORT static bool isCustomDOMElementsEnabled();
-
     WEBKIT_EXPORT static void enableDatabase(bool);
     WEBKIT_EXPORT static bool isDatabaseEnabled();
 
@@ -82,12 +57,6 @@
     WEBKIT_EXPORT static void enableDeviceOrientation(bool);
     WEBKIT_EXPORT static bool isDeviceOrientationEnabled();
 
-    WEBKIT_EXPORT static void enableDialogElement(bool);
-    WEBKIT_EXPORT static bool isDialogElementEnabled();
-
-    WEBKIT_EXPORT static void enableDirectoryUpload(bool);
-    WEBKIT_EXPORT static bool isDirectoryUploadEnabled();
-
     WEBKIT_EXPORT static void enableEncryptedMedia(bool);
     WEBKIT_EXPORT static bool isEncryptedMediaEnabled();
 
@@ -97,21 +66,9 @@
     WEBKIT_EXPORT static void enableExperimentalCanvasFeatures(bool);
     WEBKIT_EXPORT static bool isExperimentalCanvasFeaturesEnabled();
 
-    WEBKIT_EXPORT static void enableExperimentalContentSecurityPolicyFeatures(bool);
-    WEBKIT_EXPORT static bool isExperimentalContentSecurityPolicyFeaturesEnabled();
-
-    WEBKIT_EXPORT static void enableExperimentalShadowDOM(bool);
-    WEBKIT_EXPORT static bool isExperimentalShadowDOMEnabled();
-
-    WEBKIT_EXPORT static void enableExperimentalWebSocket(bool);
-    WEBKIT_EXPORT static bool isExperimentalWebSocketEnabled();
-
     WEBKIT_EXPORT static void enableFileSystem(bool);
     WEBKIT_EXPORT static bool isFileSystemEnabled();
 
-    WEBKIT_EXPORT static void enableFontLoadEvents(bool);
-    WEBKIT_EXPORT static bool isFontLoadEventsEnabled();
-
     WEBKIT_EXPORT static void enableFullscreen(bool);
     WEBKIT_EXPORT static bool isFullscreenEnabled();
 
@@ -121,18 +78,6 @@
     WEBKIT_EXPORT static void enableGeolocation(bool);
     WEBKIT_EXPORT static bool isGeolocationEnabled();
 
-    WEBKIT_EXPORT static void enableIMEAPI(bool);
-    WEBKIT_EXPORT static bool isIMEAPIEnabled();
-
-    WEBKIT_EXPORT static void enableIndexedDB(bool);
-    WEBKIT_EXPORT static bool isIndexedDBEnabled();
-
-    WEBKIT_EXPORT static void enableInputTypeWeek(bool);
-    WEBKIT_EXPORT static bool isInputTypeWeekEnabled();
-
-    WEBKIT_EXPORT static void enableJavaScriptI18NAPI(bool);
-    WEBKIT_EXPORT static bool isJavaScriptI18NAPIEnabled();
-
     WEBKIT_EXPORT static void enableLazyLayout(bool);
     WEBKIT_EXPORT static bool isLazyLayoutEnabled();
 
@@ -142,9 +87,6 @@
     WEBKIT_EXPORT static void enableMediaPlayer(bool);
     WEBKIT_EXPORT static bool isMediaPlayerEnabled();
 
-    WEBKIT_EXPORT static void enableMediaSource(bool);
-    WEBKIT_EXPORT static bool isMediaSourceEnabled();
-
     WEBKIT_EXPORT static void enableWebKitMediaSource(bool);
     WEBKIT_EXPORT static bool isWebKitMediaSourceEnabled();
 
@@ -157,24 +99,15 @@
     WEBKIT_EXPORT static void enablePagePopup(bool);
     WEBKIT_EXPORT static bool isPagePopupEnabled();
 
-    WEBKIT_EXPORT static void enableParseSVGAsHTML(bool);
-    WEBKIT_EXPORT static bool isParseSVGAsHTMLEnabled();
-
     WEBKIT_EXPORT static void enablePeerConnection(bool);
     WEBKIT_EXPORT static bool isPeerConnectionEnabled();
 
-    WEBKIT_EXPORT static void enableQuota(bool);
-    WEBKIT_EXPORT static bool isQuotaEnabled();
-
     WEBKIT_EXPORT static void enableRequestAutocomplete(bool);
     WEBKIT_EXPORT static bool isRequestAutocompleteEnabled();
 
     WEBKIT_EXPORT static void enableScriptedSpeech(bool);
     WEBKIT_EXPORT static bool isScriptedSpeechEnabled();
 
-    WEBKIT_EXPORT static void enableSeamlessIFrames(bool);
-    WEBKIT_EXPORT static bool isSeamlessIFramesEnabled();
-
     WEBKIT_EXPORT static void enableSessionStorage(bool);
     WEBKIT_EXPORT static bool isSessionStorageEnabled();
 
@@ -184,14 +117,11 @@
     WEBKIT_EXPORT static void enableSpeechSynthesis(bool);
     WEBKIT_EXPORT static bool isSpeechSynthesisEnabled();
 
-    WEBKIT_EXPORT static void enableStyleScoped(bool);
-    WEBKIT_EXPORT static bool isStyleScopedEnabled();
-
     WEBKIT_EXPORT static void enableTouch(bool);
     WEBKIT_EXPORT static bool isTouchEnabled();
 
-    WEBKIT_EXPORT static void enableVideoTrack(bool);
-    WEBKIT_EXPORT static bool isVideoTrackEnabled();
+    WEBKIT_EXPORT static void enableWebAnimationsCSS();
+    WEBKIT_EXPORT static void enableWebAnimationsSVG();
 
     WEBKIT_EXPORT static void enableWebAudio(bool);
     WEBKIT_EXPORT static bool isWebAudioEnabled();
@@ -205,9 +135,6 @@
     WEBKIT_EXPORT static void enableDataListElement(bool);
     WEBKIT_EXPORT static bool isDataListElementEnabled();
 
-    WEBKIT_EXPORT static void enableInputTypeColor(bool);
-    WEBKIT_EXPORT static bool isInputTypeColorEnabled();
-
 private:
     WebRuntimeFeatures();
 };
diff --git a/public/web/WebScriptBindings.h b/public/web/WebScriptBindings.h
new file mode 100644
index 0000000..64f98a6
--- /dev/null
+++ b/public/web/WebScriptBindings.h
@@ -0,0 +1,55 @@
+/*
+ * 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 WebScriptBindings_h
+#define WebScriptBindings_h
+
+#include "../platform/WebCommon.h"
+
+namespace v8 {
+class Isolate;
+class String;
+template <class T> class Local;
+}
+
+namespace WebKit {
+
+class WebString;
+
+class WebScriptBindings {
+public:
+    // Efficiently converts a WebString to a v8::String. The caller must have
+    // a HandleScope to guard the result's lifetime.
+    WEBKIT_EXPORT static v8::Local<v8::String> toV8String(const WebString&, v8::Isolate*);
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/public/web/WebSettings.h b/public/web/WebSettings.h
index 05e9bce..698c8f5 100644
--- a/public/web/WebSettings.h
+++ b/public/web/WebSettings.h
@@ -61,7 +61,8 @@
     virtual void setAcceleratedCompositingForAnimationEnabled(bool) = 0;
     virtual void setAcceleratedCompositingForCanvasEnabled(bool) = 0;
     virtual void setAcceleratedCompositingForFiltersEnabled(bool) = 0;
-    virtual void setAcceleratedCompositingForFixedPositionEnabled(bool)  = 0;
+    virtual void setAcceleratedCompositingForFixedPositionEnabled(bool) = 0;
+    virtual void setAcceleratedCompositingForFixedRootBackgroundEnabled(bool) = 0;
     virtual void setAcceleratedCompositingForOverflowScrollEnabled(bool) = 0;
     virtual void setAcceleratedCompositingForTransitionEnabled(bool)  = 0;
     virtual void setAcceleratedCompositingForPluginsEnabled(bool) = 0;
@@ -107,7 +108,6 @@
     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 setFontRenderingModeNormal() = 0;
     virtual void setForceCompositingMode(bool) = 0;
     virtual void setFullScreenEnabled(bool) = 0;
     virtual void setGestureTapHighlightEnabled(bool) = 0;
@@ -145,7 +145,6 @@
     virtual void setSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0;
     virtual void setShouldPrintBackgrounds(bool) = 0;
     virtual void setShouldRespectImageOrientation(bool) = 0;
-    virtual void setShowDebugBorders(bool) = 0;
     virtual void setShowFPSCounter(bool) = 0;
     virtual void setShowPaintRects(bool) = 0;
     virtual void setShrinksStandaloneImagesToFit(bool) = 0;
@@ -165,7 +164,6 @@
     virtual void setTextAreasAreResizable(bool) = 0;
     virtual void setTextAutosizingEnabled(bool) = 0;
     virtual void setTextAutosizingFontScaleFactor(float) = 0;
-    virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded() { } // FIXME: Remove once its caller is gone from Chromium
     virtual void setThreadedHTMLParser(bool) = 0;
     virtual void setTouchDragDropEnabled(bool) = 0;
     virtual void setTouchEditingEnabled(bool) = 0;
diff --git a/public/web/WebTextFieldDecoratorClient.h b/public/web/WebTextFieldDecoratorClient.h
index fd615c8..2a11daa 100644
--- a/public/web/WebTextFieldDecoratorClient.h
+++ b/public/web/WebTextFieldDecoratorClient.h
@@ -32,50 +32,28 @@
 #define WebTextFieldDecoratorClient_h
 
 #include "../platform/WebCString.h"
-
-#if WEBKIT_IMPLEMENTATION
-namespace WebCore { class TextFieldDecorator; }
-#endif
+#include "WebPasswordGeneratorClient.h"
 
 namespace WebKit {
 
-class WebInputElement;
-
-class WebTextFieldDecoratorClient {
+// FIXME: This is only here until the Chromium side change removes the usage in
+// favor of WebPasswordGeneratorClient.
+class WebTextFieldDecoratorClient : public WebPasswordGeneratorClient {
 public:
-    // The function should return true if the specified input element should
-    // have a decoration icon. This function is called whenever a text field is
-    // created, and should not take much time.
-    virtual bool shouldAddDecorationTo(const WebInputElement&) = 0;
-    // Returns true if the decoration should be visible when it's created.
-    virtual bool visibleByDefault() = 0;
-
-    // Image resource name for the normal state. The image is stretched to
-    // font-size x font-size square. The function must return an existing
-    // resource name.
-    virtual WebCString imageNameForNormalState() = 0;
-    // Image resource name for the disabled state. If this function returns an
-    // empty string, imageNameForNormalState() is used even for the disabled
-    // state.
-    virtual WebCString imageNameForDisabledState() = 0;
-    // Image resource name for the read only state. If this function returns an
-    // empty string, the image same as imageNameForDisabledState() is used.
-    virtual WebCString imageNameForReadOnlyState() = 0;
-    // Image resource name for when the imaged is being hovered over. If this
-    // function returns an empty string, imageNameForNormalState() is used
-    // instead.
-    virtual WebCString imageNameForHoverState() {return WebCString();}
+    // Delegate to the handleClick method until the Chrome side patch can land.
+    virtual void openPasswordGenerator(WebInputElement& input) { handleClick(input); }
 
     // This is called when the decoration icon is clicked.
     virtual void handleClick(WebInputElement&) = 0;
-    // This is called when the input element loses its renderer. An
-    // implementation of this function should not do something which updates
-    // state of WebKit objects.
-    virtual void willDetach(const WebInputElement&) = 0;
 
-#if WEBKIT_IMPLEMENTATION
-    bool isClientFor(WebCore::TextFieldDecorator*);
-#endif
+    // FIXME: These are never called.
+    virtual void willDetach(const WebInputElement&) = 0;
+    virtual bool visibleByDefault() = 0;
+    virtual WebCString imageNameForReadOnlyState() = 0;
+    virtual WebCString imageNameForDisabledState() = 0;
+    virtual bool shouldAddDecorationTo(const WebInputElement&) = 0;
+    virtual WebCString imageNameForNormalState() = 0;
+    virtual WebCString imageNameForHoverState() = 0;
 
     virtual ~WebTextFieldDecoratorClient() { }
 };
diff --git a/public/web/WebTextInputInfo.h b/public/web/WebTextInputInfo.h
index bde84ee..c1b7fce 100644
--- a/public/web/WebTextInputInfo.h
+++ b/public/web/WebTextInputInfo.h
@@ -51,6 +51,10 @@
     // The end position of the current composition, or -1 if there is none.
     int compositionEnd;
 
+    // The inputmode attribute value of the currently focused input field.
+    // This string is lower-case.
+    WebString inputMode;
+
     WEBKIT_EXPORT bool equals(const WebTextInputInfo&) const;
 
     WebTextInputInfo()
diff --git a/public/web/WebUserGestureToken.h b/public/web/WebUserGestureToken.h
index 9506ef9..8f001f7 100644
--- a/public/web/WebUserGestureToken.h
+++ b/public/web/WebUserGestureToken.h
@@ -54,6 +54,7 @@
     ~WebUserGestureToken() { reset(); }
 
     WEBKIT_EXPORT bool hasGestures() const;
+    WEBKIT_EXPORT void setOutOfProcess();
     bool isNull() const { return m_token.isNull(); }
 
 #if WEBKIT_IMPLEMENTATION
diff --git a/public/web/WebView.h b/public/web/WebView.h
index d6a0080..128aae1 100644
--- a/public/web/WebView.h
+++ b/public/web/WebView.h
@@ -56,7 +56,7 @@
 class WebSettings;
 class WebSpellCheckClient;
 class WebString;
-class WebTextFieldDecoratorClient;
+class WebPasswordGeneratorClient;
 class WebValidationMessageClient;
 class WebViewBenchmarkSupport;
 class WebViewClient;
@@ -108,8 +108,10 @@
     virtual void setPrerendererClient(WebPrerendererClient*) = 0;
     virtual void setSpellCheckClient(WebSpellCheckClient*) = 0;
     virtual void setValidationMessageClient(WebValidationMessageClient*) = 0;
-    virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) = 0;
 
+    // FIXME: Remove this once pasword_generator stops using it.
+    void addTextFieldDecoratorClient(WebPasswordGeneratorClient* client) { setPasswordGeneratorClient(client); };
+    virtual void setPasswordGeneratorClient(WebPasswordGeneratorClient*) = 0;
 
     // Options -------------------------------------------------------------
 
diff --git a/public/web/WebViewClient.h b/public/web/WebViewClient.h
index d26c424..7056dd6 100644
--- a/public/web/WebViewClient.h
+++ b/public/web/WebViewClient.h
@@ -69,6 +69,7 @@
 class WebImage;
 class WebInputElement;
 class WebKeyboardEvent;
+class WebMIDIClient;
 class WebNode;
 class WebNotificationPresenter;
 class WebRange;
@@ -120,9 +121,7 @@
         const WebPopupMenuInfo&, WebExternalPopupMenuClient*) { return 0; }
 
     // Create a session storage namespace object associated with this WebView.
-    virtual WebStorageNamespace* createSessionStorageNamespace() { return createSessionStorageNamespace(0); }
-    // FIXME: Remove the argument-taking version once its override is removed from Chromium; the argument is unused.
-    virtual WebStorageNamespace* createSessionStorageNamespace(unsigned quota) { return 0; }
+    virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; }
 
 
     // Misc ----------------------------------------------------------------
@@ -374,6 +373,10 @@
 
     virtual WebUserMediaClient* userMediaClient() { return 0; }
 
+    // Web MIDI -------------------------------------------------------------
+
+    virtual WebMIDIClient* webMIDIClient() { return 0; }
+
 
     // Content detection ----------------------------------------------------