Diff
Modified: trunk/Source/WebCore/ChangeLog (132178 => 132179)
--- trunk/Source/WebCore/ChangeLog 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/ChangeLog 2012-10-23 05:21:22 UTC (rev 132179)
@@ -1,3 +1,30 @@
+2012-10-22 Joshua Bell <jsb...@chromium.org>
+
+ IndexedDB: Remove custom binding code for IDBCursor.value
+ https://bugs.webkit.org/show_bug.cgi?id=100034
+
+ Reviewed by Kentaro Hara.
+
+ Now that we're using ScriptValue instead of SerializedScriptValue we can just expose
+ IDBCursor.value as an |any| (IDL) or |ScriptValue| (C++) to maintain the specified
+ semantics that the object identity is retained across accesses.
+
+ Test: storage/indexeddb/cursor-value.html
+
+ * Modules/indexeddb/IDBCursor.cpp: Remove "dirty" tracking.
+ (WebCore::IDBCursor::IDBCursor):
+ (WebCore::IDBCursor::value):
+ (WebCore::IDBCursor::setValueReady):
+ * Modules/indexeddb/IDBCursor.h: IDBAny -> ScriptValue
+ (IDBCursor):
+ * Modules/indexeddb/IDBCursorWithValue.idl: IDBAny -> any
+ * Modules/indexeddb/IDBObjectStore.cpp: No need to route through IDBAny to get ScriptValue.
+ (WebCore):
+ * UseV8.cmake: Remove references to IDBCustomBindings.cpp
+ * WebCore.gypi: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * bindings/v8/IDBCustomBindings.cpp: Removed.
+
2012-10-22 Dan Bernstein <m...@apple.com>
Font’s fast code path is used for partial runs with kerning and ligatures, but shouldn’t be
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (132178 => 132179)
--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp 2012-10-23 05:21:22 UTC (rev 132179)
@@ -81,7 +81,6 @@
, m_transaction(transaction)
, m_transactionNotifier(transaction, this)
, m_gotValue(false)
- , m_valueIsDirty(true)
{
ASSERT(m_backend);
ASSERT(m_request);
@@ -114,10 +113,9 @@
return m_currentPrimaryKey;
}
-PassRefPtr<IDBAny> IDBCursor::value()
+const ScriptValue& IDBCursor::value() const
{
IDB_TRACE("IDBCursor::value");
- m_valueIsDirty = false;
return m_currentValue;
}
@@ -277,10 +275,9 @@
ASSERT_UNUSED(injected, injected);
}
}
- m_currentValue = IDBAny::create(value);
+ m_currentValue = value;
m_gotValue = true;
- m_valueIsDirty = true;
}
PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore()
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (132178 => 132179)
--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h 2012-10-23 05:21:22 UTC (rev 132179)
@@ -72,7 +72,7 @@
const String& direction() const;
PassRefPtr<IDBKey> key() const;
PassRefPtr<IDBKey> primaryKey() const;
- PassRefPtr<IDBAny> value();
+ const ScriptValue& value() const;
IDBAny* source() const;
PassRefPtr<IDBRequest> update(ScriptExecutionContext*, ScriptValue&, ExceptionCode&);
@@ -85,11 +85,6 @@
void close();
void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, ScriptValue&);
- // The spec requires that the script object that wraps the value
- // be unchanged until the value changes as a result of the cursor
- // advancing.
- bool valueIsDirty() { return m_valueIsDirty; }
-
protected:
IDBCursor(PassRefPtr<IDBCursorBackendInterface>, Direction, IDBRequest*, IDBAny* source, IDBTransaction*);
virtual bool isKeyCursor() const { return true; }
@@ -108,8 +103,7 @@
// are still valid for the current success handlers.
RefPtr<IDBKey> m_currentKey;
RefPtr<IDBKey> m_currentPrimaryKey;
- RefPtr<IDBAny> m_currentValue;
- bool m_valueIsDirty;
+ ScriptValue m_currentValue;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl (132178 => 132179)
--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl 2012-10-23 05:21:22 UTC (rev 132179)
@@ -26,5 +26,5 @@
[
Conditional=INDEXED_DATABASE
] interface IDBCursorWithValue : IDBCursor {
- [V8CustomGetter] readonly attribute IDBAny value;
+ readonly attribute any value;
};
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (132178 => 132179)
--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp 2012-10-23 05:21:22 UTC (rev 132179)
@@ -326,11 +326,8 @@
ASSERT(!ec);
RefPtr<IDBKey> primaryKey = cursor->primaryKey();
- RefPtr<IDBAny> valueAny = cursor->value();
+ ScriptValue value = cursor->value();
- ASSERT(valueAny->type() == IDBAny::ScriptValueType);
- ScriptValue value = valueAny->scriptValue();
-
IDBObjectStore::IndexKeys indexKeys;
generateIndexKeysForValue(m_indexMetadata, value, &indexKeys);
Modified: trunk/Source/WebCore/UseV8.cmake (132178 => 132179)
--- trunk/Source/WebCore/UseV8.cmake 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/UseV8.cmake 2012-10-23 05:21:22 UTC (rev 132179)
@@ -24,7 +24,6 @@
bindings/v8/DOMWrapperWorld.cpp
bindings/v8/DateExtension.cpp
bindings/v8/IDBBindingUtilities.cpp
- bindings/v8/IDBCustomBindings.cpp
bindings/v8/Dictionary.cpp
bindings/v8/PageScriptDebugServer.cpp
bindings/v8/RetainedDOMInfo.cpp
Modified: trunk/Source/WebCore/WebCore.gypi (132178 => 132179)
--- trunk/Source/WebCore/WebCore.gypi 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/WebCore.gypi 2012-10-23 05:21:22 UTC (rev 132179)
@@ -2237,7 +2237,6 @@
'bindings/v8/DateExtension.h',
'bindings/v8/IDBBindingUtilities.cpp',
'bindings/v8/IDBBindingUtilities.h',
- 'bindings/v8/IDBCustomBindings.cpp',
'bindings/v8/IntrusiveDOMWrapperMap.h',
'bindings/v8/_javascript_CallFrame.cpp',
'bindings/v8/_javascript_CallFrame.h',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (132178 => 132179)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-10-23 05:21:22 UTC (rev 132179)
@@ -64958,58 +64958,6 @@
>
</File>
<File
- RelativePath="..\bindings\js\IDBCustomBindings.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo_CFLite|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo_CFLite|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Production|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
RelativePath="..\bindings\js\_javascript_CallFrame.cpp"
>
<FileConfiguration
Deleted: trunk/Source/WebCore/bindings/v8/IDBCustomBindings.cpp (132178 => 132179)
--- trunk/Source/WebCore/bindings/v8/IDBCustomBindings.cpp 2012-10-23 05:11:29 UTC (rev 132178)
+++ trunk/Source/WebCore/bindings/v8/IDBCustomBindings.cpp 2012-10-23 05:21:22 UTC (rev 132179)
@@ -1,60 +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.
- */
-
-#include "config.h"
-#include "V8IDBCursorWithValue.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "V8IDBAny.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8IDBCursorWithValue::valueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- INC_STATS("DOM.IDBCursorWithValue.value._get");
-
- IDBCursorWithValue* imp = V8IDBCursorWithValue::toNative(info.Holder());
- v8::Handle<v8::String> propertyName = v8::String::NewSymbol("value");
- if (!imp->valueIsDirty()) {
- v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName);
- if (!value.IsEmpty())
- return value;
- }
-
- RefPtr<IDBAny> result = imp->value();
- v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
- info.Holder()->SetHiddenValue(propertyName, wrapper);
- return wrapper;
-}
-
-}
-
-#endif