<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199668] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199668">199668</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-04-18 08:33:30 -0700 (Mon, 18 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Get rid of IDBAny
https://bugs.webkit.org/show_bug.cgi?id=156681

Reviewed by Brady Eidson.

IDBAny is not part of the public interface of Indexed Database.
It was an implementation technique used to help create language bindings for
functions that have to deal with types that aren't easly expressed with the
normal IDL and C++ type system.

What was particularly dangerous about IDBAny is that it can be used to store
arbitrary JavaScript objects and it's not easy to handle garbage collection and
reference cycles when they are hidden behind this class's abstraction. It's also
a needless extra layer, a reference counted object just to carry the types from
the bindings to the C++ DOM implementation.

Ths patch also does many small style tweaks.

* CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* Modules/indexeddb/IDBAny.cpp: Removed.
* Modules/indexeddb/IDBAny.h: Removed.
* Modules/indexeddb/IDBAny.idl: Removed.

* Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
include as much.
(WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
(WebCore::IDBCursor::directionToString): Ditto.
(WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
(WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
(WebCore::IDBCursor::key): Moved this function to the header.
(WebCore::IDBCursor::primaryKey): Ditto.
(WebCore::IDBCursor::value): Ditto.
(WebCore::IDBCursor::source): Deleted this function; replaced with multiple
type-specific functions; all but one will return null.
(WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
Fell prey to the confusion because &quot;unsigned long&quot; in IDL means &quot;unsigned&quot; in C++.
(WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
(WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
ScriptExecutionContext here instead of inside the binding utilities functions.

* Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
Changed key, primaryKey, and value to no longer take an unneeded ExecState.
Made more functions private.

* Modules/indexeddb/IDBCursor.idl: Changed type of &quot;source&quot; to &quot;any&quot;, which matches
the IDB specification, rather than &quot;IDBAny&quot;. Added [CustomGetter] so we can write the
getter that understands the multiple possible values. Removed unneeded
[CallWith=ScriptState] from key and primaryKey attributes.

* Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
* Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
from the value attribute.

* Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
* Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!

* Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
(WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
(WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
(WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
(WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
Also removed unneeded typecast.

* Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
Removed the getDatabaseNames function. We still need a solution here, but there is
no reason to keep the placeholder function that returns nullptr here.

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::keyPathAny): Removed.
(WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::getKey): Ditto.

* Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
including itself. Marked class final. Updated for above changes.

* Modules/indexeddb/IDBIndex.idl: Changed type of &quot;keyPath&quot; to &quot;any&quot;, which matches
the IDB specification, rather than &quot;IDBAny&quot;. Specified [ImplementationReturnType=IDBKeyPath]
so the code generator creates the appropriate code to convert from an IDBKeyPath.
In the future, we may find a way to do this without an explicit attribute in the IDL
file but this is fine for now.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
of enums because all the call sites outside this class are using booleans.
(WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
(WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
(WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
(WebCore::IDBKeyRange::upperValue): Ditto.
(WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBKeyRange::lowerBound): Updated for above changes.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
(WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.

* Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.

* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::name): Changed return type to const String&amp; to cut down on
reference count churn.
(WebCore::IDBObjectStore::keyPathAny): Deleted.
(WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath&amp; to cut down on
unnecessary copies.
(WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
(WebCore::IDBObjectStore::count): Ditto.

* Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
above in the cpp file function descriptions.

* Modules/indexeddb/IDBObjectStore.idl: Changed type of &quot;keyPath&quot; to &quot;any&quot; and
specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.

* Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
that depend on how m_result is implemented, which changed.
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
instead of setting m_result directly.
(WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
m_readyState directly.
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
m_transaction instead of peculiar adoptRef/leakRef.
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
instead of setting m_result directly.

* Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
and made more things private.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
even when passed an IDBCursor.
(WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
if it's a cursor. The logic is now simply a null check.
(WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
(WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
(WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
instead of setting m_source.
(WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
m_indexSource instead of using m_source. To preserve current behavior, this this does not
use m_cursorSource since the old code did not handle IDBCursor.
(WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
current behavior.
(WebCore::IDBRequest::requestedIndexRecordType): Ditto.
(WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
have to repeat the code to clear result pointers. Also take a reference.
(WebCore::IDBRequest::setResultToStructuredClone): Ditto.
(WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
instead of m_result.
(WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
(WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
(WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
Also call setResultToUndefined instead of setting m_result.
(WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
instead of setting m_result.
(WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.

* Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
since that's now done with strings. Added cursorResult, databaseResult, scriptResult,
objectStoreSource, indexSource, and cursorSource function members and corresponding data members.
Later we might re-cast this as some sort of union, but for now these separate functions seem fine.
Removed unused modernResult function. Made more things private.

* Modules/indexeddb/IDBRequest.idl: Use &quot;any&quot; instead of &quot;IDBAny&quot; for &quot;result&quot; and &quot;source&quot;.

* Modules/indexeddb/IDBTransaction.cpp: Added now-needed includes.
(WebCore::IDBTransaction::didGetRecordOnServer): Updated to call the version of setResult that takes
a reference.
(WebCore::IDBTransaction::didPutOrAddOnServer): Ditto.
* Modules/indexeddb/IDBTransaction.h: Removed unneeded includes, derive privately from ActiveDOMObject.
Removed some unneeded WebCore prefixes.

* Modules/indexeddb/server/MemoryIndex.h: Added now-needed include.

* Modules/indexeddb/server/MemoryObjectStore.cpp: Added now-needed includes.
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Remove unneeded get() call.
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added now-needed includes.
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): Remove unneeded get() call.
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): Ditto.

* Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added now-needed include.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added now-needed includes.
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Updated to use JSValue.

* Modules/indexeddb/server/UniqueIDBDatabase.h: Added now-needed forward declaration of JSC::VM.

* bindings/js/IDBBindingUtilities.cpp: Added now-needed includes.
(WebCore::deserializeIDBValueToJSValue): Return JSValue instead of Strong&lt;Unknown&gt;.
(WebCore::deserializeIDBValueDataToJSValue): Ditto.
(WebCore::idbKeyDataToScriptValue): Ditto.
(WebCore::toJS): Added an overload of toJS for IDBKeyPath here. Moved here from JSIDBAnyCustom.cpp.

* bindings/js/IDBBindingUtilities.h: Removed unneeded include. Changed return types to JSValue.
Added the toJS function for IDBKeyPath.

* bindings/js/JSIDBAnyCustom.cpp: Removed.

* bindings/js/JSIDBCursorCustom.cpp: Added some now-needed includes.
(WebCore::JSIDBCursor::visitAdditionalChildren): Removed ann unneeded type cast.
(WebCore::JSIDBCursor::source): Added. Converts either the index source or the object source into
a JSValue.

* bindings/js/JSIDBRequestCustom.cpp: Added.
(WebCore::JSIDBRequest::result): Added. Throws an exception if isDone is false and then converts
cursor result, database result, or script result into a JSValue.
(WebCore::JSIDBRequest::source): Added. Converts the cursor source, index source, or object store
source into a JSValue.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Tweaked the code for array slightly. Added an ImplementationReturnType case
for IDBKeyPath. The code that's generated is pretty generic, just a call to toJS with the conventional
arguments, so at some point we may be able to do this with C++ overloading and not require a
special case in the code generator.

* inspector/InspectorIndexedDBAgent.cpp: Put #if 0 around the getDatabaseNames code, which was
dormant and not working.
(WebCore::OpenDatabaseCallback::handleEvent): Changed this to use IDBOpenDBRequest::databaseResult
instead of calling the result function checking for an exception and then doing type checking.
(WebCore::idbKeyRangeFromKeyRange): Updated to use booleans for key range bound open state.
(WebCore::OpenCursorCallback::handleEvent): Same kind of change as for OpenDatabaseCallback above.
Also use simpler interface to key, primaryKey, and value.
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Put #if 0 around the getDatabaseNames
code, which was dormant and not working. Needs to be re-implemented.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursoridl">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorWithValueh">trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorWithValueidl">trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactorycpp">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryh">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexcpp">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexh">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexidl">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeh">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeDatacpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBOpenDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestidl">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiesh">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBRequestCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBAnycpp">trunk/Source/WebCore/Modules/indexeddb/IDBAny.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBAnyh">trunk/Source/WebCore/Modules/indexeddb/IDBAny.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBAnyidl">trunk/Source/WebCore/Modules/indexeddb/IDBAny.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBAnyCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -182,7 +182,6 @@
</span><span class="cx">     Modules/geolocation/PositionErrorCallback.idl
</span><span class="cx"> 
</span><span class="cx">     Modules/indexeddb/DOMWindowIndexedDatabase.idl
</span><del>-    Modules/indexeddb/IDBAny.idl
</del><span class="cx">     Modules/indexeddb/IDBCursor.idl
</span><span class="cx">     Modules/indexeddb/IDBCursorWithValue.idl
</span><span class="cx">     Modules/indexeddb/IDBDatabase.idl
</span><span class="lines">@@ -833,7 +832,6 @@
</span><span class="cx">     Modules/geolocation/NavigatorGeolocation.cpp
</span><span class="cx"> 
</span><span class="cx">     Modules/indexeddb/DOMWindowIndexedDatabase.cpp
</span><del>-    Modules/indexeddb/IDBAny.cpp
</del><span class="cx">     Modules/indexeddb/IDBCursor.cpp
</span><span class="cx">     Modules/indexeddb/IDBCursorWithValue.cpp
</span><span class="cx">     Modules/indexeddb/IDBDatabase.cpp
</span><span class="lines">@@ -1166,12 +1164,12 @@
</span><span class="cx">     bindings/js/JSHTMLSelectElementCustom.cpp
</span><span class="cx">     bindings/js/JSHTMLTemplateElementCustom.cpp
</span><span class="cx">     bindings/js/JSHistoryCustom.cpp
</span><del>-    bindings/js/JSIDBAnyCustom.cpp
</del><span class="cx">     bindings/js/JSIDBCursorCustom.cpp
</span><span class="cx">     bindings/js/JSIDBCursorWithValueCustom.cpp
</span><span class="cx">     bindings/js/JSIDBDatabaseCustom.cpp
</span><span class="cx">     bindings/js/JSIDBIndexCustom.cpp
</span><span class="cx">     bindings/js/JSIDBObjectStoreCustom.cpp
</span><ins>+    bindings/js/JSIDBRequestCustom.cpp
</ins><span class="cx">     bindings/js/JSImageConstructor.cpp
</span><span class="cx">     bindings/js/JSImageDataCustom.cpp
</span><span class="cx">     bindings/js/JSInspectorFrontendHostCustom.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/ChangeLog        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -1,3 +1,252 @@
</span><ins>+2016-04-17  Darin Adler  &lt;darin@apple.com&gt;
+
+        Get rid of IDBAny
+        https://bugs.webkit.org/show_bug.cgi?id=156681
+
+        Reviewed by Brady Eidson.
+
+        IDBAny is not part of the public interface of Indexed Database.
+        It was an implementation technique used to help create language bindings for
+        functions that have to deal with types that aren't easly expressed with the
+        normal IDL and C++ type system.
+
+        What was particularly dangerous about IDBAny is that it can be used to store
+        arbitrary JavaScript objects and it's not easy to handle garbage collection and
+        reference cycles when they are hidden behind this class's abstraction. It's also
+        a needless extra layer, a reference counted object just to carry the types from
+        the bindings to the C++ DOM implementation.
+
+        Ths patch also does many small style tweaks.
+
+        * CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
+        * DerivedSources.cpp: Ditto.
+        * DerivedSources.make: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+        * Modules/indexeddb/IDBAny.cpp: Removed.
+        * Modules/indexeddb/IDBAny.h: Removed.
+        * Modules/indexeddb/IDBAny.idl: Removed.
+
+        * Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
+        include as much.
+        (WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
+        (WebCore::IDBCursor::directionToString): Ditto.
+        (WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
+        (WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
+        (WebCore::IDBCursor::key): Moved this function to the header.
+        (WebCore::IDBCursor::primaryKey): Ditto.
+        (WebCore::IDBCursor::value): Ditto.
+        (WebCore::IDBCursor::source): Deleted this function; replaced with multiple
+        type-specific functions; all but one will return null.
+        (WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
+        (WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
+        Fell prey to the confusion because &quot;unsigned long&quot; in IDL means &quot;unsigned&quot; in C++.
+        (WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
+        (WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
+        (WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
+        ScriptExecutionContext here instead of inside the binding utilities functions.
+
+        * Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
+        Changed key, primaryKey, and value to no longer take an unneeded ExecState.
+        Made more functions private.
+
+        * Modules/indexeddb/IDBCursor.idl: Changed type of &quot;source&quot; to &quot;any&quot;, which matches
+        the IDB specification, rather than &quot;IDBAny&quot;. Added [CustomGetter] so we can write the
+        getter that understands the multiple possible values. Removed unneeded
+        [CallWith=ScriptState] from key and primaryKey attributes.
+
+        * Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
+        * Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
+        from the value attribute.
+
+        * Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
+        * Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!
+
+        * Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
+        (WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
+        (WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
+        (WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
+        (WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
+        Also removed unneeded typecast.
+
+        * Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
+        Removed the getDatabaseNames function. We still need a solution here, but there is
+        no reason to keep the placeholder function that returns nullptr here.
+
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::keyPathAny): Removed.
+        (WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
+        (WebCore::IDBIndex::count): Ditto.
+        (WebCore::IDBIndex::openKeyCursor): Ditto.
+        (WebCore::IDBIndex::get): Ditto.
+        (WebCore::IDBIndex::getKey): Ditto.
+
+        * Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
+        including itself. Marked class final. Updated for above changes.
+
+        * Modules/indexeddb/IDBIndex.idl: Changed type of &quot;keyPath&quot; to &quot;any&quot;, which matches
+        the IDB specification, rather than &quot;IDBAny&quot;. Specified [ImplementationReturnType=IDBKeyPath]
+        so the code generator creates the appropriate code to convert from an IDBKeyPath.
+        In the future, we may find a way to do this without an explicit attribute in the IDL
+        file but this is fine for now.
+
+        * Modules/indexeddb/IDBKeyRange.cpp:
+        (WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
+        of enums because all the call sites outside this class are using booleans.
+        (WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
+        (WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
+        (WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
+        (WebCore::IDBKeyRange::upperValue): Ditto.
+        (WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
+        (WebCore::IDBKeyRange::lowerBound): Updated for above changes.
+        (WebCore::IDBKeyRange::upperBound): Ditto.
+        (WebCore::IDBKeyRange::bound): Ditto.
+        (WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
+        there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.
+
+        * Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
+        instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.
+
+        * Modules/indexeddb/IDBKeyRangeData.cpp:
+        (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::name): Changed return type to const String&amp; to cut down on
+        reference count churn.
+        (WebCore::IDBObjectStore::keyPathAny): Deleted.
+        (WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath&amp; to cut down on
+        unnecessary copies.
+        (WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
+        (WebCore::IDBObjectStore::get): Ditto.
+        (WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
+        (WebCore::IDBObjectStore::deleteFunction): Ditto.
+        (WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
+        (WebCore::IDBObjectStore::count): Ditto.
+
+        * Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
+        above in the cpp file function descriptions.
+
+        * Modules/indexeddb/IDBObjectStore.idl: Changed type of &quot;keyPath&quot; to &quot;any&quot; and
+        specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.
+
+        * Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
+        (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
+        that depend on how m_result is implemented, which changed.
+        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
+        instead of setting m_result directly.
+        (WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
+        m_readyState directly.
+        (WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
+        m_transaction instead of peculiar adoptRef/leakRef.
+        (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
+        instead of setting m_result directly.
+
+        * Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
+        and made more things private.
+
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
+        m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
+        even when passed an IDBCursor.
+        (WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
+        if it's a cursor. The logic is now simply a null check.
+        (WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
+        (WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
+        (WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
+        (WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
+        instead of setting m_source.
+        (WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
+        (WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
+        m_indexSource instead of using m_source. To preserve current behavior, this this does not
+        use m_cursorSource since the old code did not handle IDBCursor.
+        (WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
+        current behavior.
+        (WebCore::IDBRequest::requestedIndexRecordType): Ditto.
+        (WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
+        (WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
+        have to repeat the code to clear result pointers. Also take a reference.
+        (WebCore::IDBRequest::setResultToStructuredClone): Ditto.
+        (WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
+        instead of m_result.
+        (WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
+        (WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
+        (WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
+        Also call setResultToUndefined instead of setting m_result.
+        (WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
+        instead of setting m_result.
+        (WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
+        (WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.
+
+        * Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
+        since that's now done with strings. Added cursorResult, databaseResult, scriptResult,
+        objectStoreSource, indexSource, and cursorSource function members and corresponding data members.
+        Later we might re-cast this as some sort of union, but for now these separate functions seem fine.
+        Removed unused modernResult function. Made more things private.
+
+        * Modules/indexeddb/IDBRequest.idl: Use &quot;any&quot; instead of &quot;IDBAny&quot; for &quot;result&quot; and &quot;source&quot;.
+
+        * Modules/indexeddb/IDBTransaction.cpp: Added now-needed includes.
+        (WebCore::IDBTransaction::didGetRecordOnServer): Updated to call the version of setResult that takes
+        a reference.
+        (WebCore::IDBTransaction::didPutOrAddOnServer): Ditto.
+        * Modules/indexeddb/IDBTransaction.h: Removed unneeded includes, derive privately from ActiveDOMObject.
+        Removed some unneeded WebCore prefixes.
+
+        * Modules/indexeddb/server/MemoryIndex.h: Added now-needed include.
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp: Added now-needed includes.
+        (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Remove unneeded get() call.
+        (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto.
+
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added now-needed includes.
+        (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): Remove unneeded get() call.
+        (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): Ditto.
+
+        * Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added now-needed include.
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added now-needed includes.
+        (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Updated to use JSValue.
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.h: Added now-needed forward declaration of JSC::VM.
+
+        * bindings/js/IDBBindingUtilities.cpp: Added now-needed includes.
+        (WebCore::deserializeIDBValueToJSValue): Return JSValue instead of Strong&lt;Unknown&gt;.
+        (WebCore::deserializeIDBValueDataToJSValue): Ditto.
+        (WebCore::idbKeyDataToScriptValue): Ditto.
+        (WebCore::toJS): Added an overload of toJS for IDBKeyPath here. Moved here from JSIDBAnyCustom.cpp.
+
+        * bindings/js/IDBBindingUtilities.h: Removed unneeded include. Changed return types to JSValue.
+        Added the toJS function for IDBKeyPath.
+
+        * bindings/js/JSIDBAnyCustom.cpp: Removed.
+
+        * bindings/js/JSIDBCursorCustom.cpp: Added some now-needed includes.
+        (WebCore::JSIDBCursor::visitAdditionalChildren): Removed ann unneeded type cast.
+        (WebCore::JSIDBCursor::source): Added. Converts either the index source or the object source into
+        a JSValue.
+
+        * bindings/js/JSIDBRequestCustom.cpp: Added.
+        (WebCore::JSIDBRequest::result): Added. Throws an exception if isDone is false and then converts
+        cursor result, database result, or script result into a JSValue.
+        (WebCore::JSIDBRequest::source): Added. Converts the cursor source, index source, or object store
+        source into a JSValue.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NativeToJSValue): Tweaked the code for array slightly. Added an ImplementationReturnType case
+        for IDBKeyPath. The code that's generated is pretty generic, just a call to toJS with the conventional
+        arguments, so at some point we may be able to do this with C++ overloading and not require a
+        special case in the code generator.
+
+        * inspector/InspectorIndexedDBAgent.cpp: Put #if 0 around the getDatabaseNames code, which was
+        dormant and not working.
+        (WebCore::OpenDatabaseCallback::handleEvent): Changed this to use IDBOpenDBRequest::databaseResult
+        instead of calling the result function checking for an exception and then doing type checking.
+        (WebCore::idbKeyRangeFromKeyRange): Updated to use booleans for key range bound open state.
+        (WebCore::OpenCursorCallback::handleEvent): Same kind of change as for OpenDatabaseCallback above.
+        Also use simpler interface to key, primaryKey, and value.
+        (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Put #if 0 around the getDatabaseNames
+        code, which was dormant and not working. Needs to be re-implemented.
+
</ins><span class="cx"> 2016-04-18  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Media element &quot;user gesture for fullscreen&quot; restriction is never lifted
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -298,7 +298,6 @@
</span><span class="cx"> #include &quot;JSHTMLUListElement.cpp&quot;
</span><span class="cx"> #include &quot;JSHTMLVideoElement.cpp&quot;
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><del>-#include &quot;JSIDBAny.cpp&quot;
</del><span class="cx"> #include &quot;JSIDBCursor.cpp&quot;
</span><span class="cx"> #include &quot;JSIDBCursorWithValue.cpp&quot;
</span><span class="cx"> #include &quot;JSIDBDatabase.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/DerivedSources.make        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -98,7 +98,6 @@
</span><span class="cx">     $(WebCore)/Modules/geolocation/PositionError.idl \
</span><span class="cx">     $(WebCore)/Modules/geolocation/PositionErrorCallback.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
</span><del>-    $(WebCore)/Modules/indexeddb/IDBAny.idl \
</del><span class="cx">     $(WebCore)/Modules/indexeddb/IDBCursor.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/IDBCursorWithValue.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBAnycpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/indexeddb/IDBAny.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBAny.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBAny.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -1,158 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple 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. AND ITS 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 APPLE INC. OR ITS 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 &quot;config.h&quot;
-#include &quot;IDBAny.h&quot;
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include &quot;DOMStringList.h&quot;
-#include &quot;IDBCursorWithValue.h&quot;
-#include &quot;IDBDatabase.h&quot;
-#include &quot;IDBFactory.h&quot;
-#include &quot;IDBIndex.h&quot;
-#include &quot;IDBObjectStore.h&quot;
-#include &quot;IDBTransaction.h&quot;
-
-namespace WebCore {
-
-IDBAny::IDBAny(IDBAny::Type type)
-    : m_type(type)
-{
-}
-
-IDBAny::IDBAny(Ref&lt;IDBDatabase&gt;&amp;&amp; database)
-    : m_type(IDBAny::Type::IDBDatabase)
-    , m_database(WTFMove(database))
-{
-}
-
-IDBAny::IDBAny(Ref&lt;IDBObjectStore&gt;&amp;&amp; objectStore)
-    : m_type(IDBAny::Type::IDBObjectStore)
-    , m_objectStore(WTFMove(objectStore))
-{
-}
-
-IDBAny::IDBAny(Ref&lt;IDBIndex&gt;&amp;&amp; index)
-    : m_type(IDBAny::Type::IDBIndex)
-    , m_index(WTFMove(index))
-{
-}
-
-IDBAny::IDBAny(Ref&lt;IDBCursor&gt;&amp;&amp; cursor)
-{
-    if (cursor-&gt;isKeyCursor()) {
-        m_type = IDBAny::Type::IDBCursor;
-        m_cursor = WTFMove(cursor);
-    } else {
-        m_type = IDBAny::Type::IDBCursorWithValue;
-        m_cursorWithValue = static_cast&lt;IDBCursorWithValue*&gt;(&amp;cursor.get());
-    }
-}
-
-IDBAny::IDBAny(const IDBKeyPath&amp; keyPath)
-    : m_type(IDBAny::Type::KeyPath)
-    , m_idbKeyPath(keyPath)
-{
-}
-
-IDBAny::IDBAny(const JSC::Strong&lt;JSC::Unknown&gt;&amp; value)
-    : m_type(IDBAny::Type::ScriptValue)
-    , m_scriptValue(value)
-{
-}
-
-IDBAny::~IDBAny()
-{
-}
-
-RefPtr&lt;IDBDatabase&gt; IDBAny::idbDatabase()
-{
-    ASSERT(m_type == IDBAny::Type::IDBDatabase);
-    return m_database.get();
-}
-
-RefPtr&lt;DOMStringList&gt; IDBAny::domStringList()
-{
-    return nullptr;
-}
-
-RefPtr&lt;IDBCursor&gt; IDBAny::idbCursor()
-{
-    ASSERT(m_type == IDBAny::Type::IDBCursor || m_type == IDBAny::Type::IDBCursorWithValue);
-    return m_cursor ? m_cursor.get() : m_cursorWithValue.get();
-}
-
-RefPtr&lt;IDBCursorWithValue&gt; IDBAny::idbCursorWithValue()
-{
-    ASSERT(m_type == IDBAny::Type::IDBCursorWithValue);
-    return m_cursorWithValue.get();
-}
-
-RefPtr&lt;IDBFactory&gt; IDBAny::idbFactory()
-{
-    return nullptr;
-}
-
-RefPtr&lt;IDBIndex&gt; IDBAny::idbIndex()
-{
-    ASSERT(m_type == IDBAny::Type::IDBIndex);
-    return m_index.get();
-}
-
-RefPtr&lt;IDBObjectStore&gt; IDBAny::idbObjectStore()
-{
-    ASSERT(m_type == IDBAny::Type::IDBObjectStore);
-    return m_objectStore.get();
-}
-
-RefPtr&lt;IDBTransaction&gt; IDBAny::idbTransaction()
-{
-    return nullptr;
-}
-
-JSC::JSValue IDBAny::scriptValue()
-{
-    return m_scriptValue.get();
-}
-
-int64_t IDBAny::integer()
-{
-    return m_integer;
-}
-
-const String&amp; IDBAny::string()
-{
-    return m_string;
-}
-
-const IDBKeyPath&amp; IDBAny::keyPath()
-{
-    return m_idbKeyPath;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBAnyh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/indexeddb/IDBAny.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBAny.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBAny.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -1,141 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple 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. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-#pragma once
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include &quot;IDBKeyPath.h&quot;
-#include &quot;ScriptWrappable.h&quot;
-#include &lt;heap/Strong.h&gt;
-#include &lt;runtime/JSCJSValue.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-
-namespace WebCore {
-
-class DOMStringList;
-class IDBCursor;
-class IDBCursorWithValue;
-class IDBDatabase;
-class IDBFactory;
-class IDBIndex;
-class IDBObjectStore;
-class IDBTransaction;
-
-class IDBAny : public ScriptWrappable, public RefCounted&lt;IDBAny&gt; {
-public:
-    static RefPtr&lt;IDBAny&gt; create(Ref&lt;IDBDatabase&gt;&amp;&amp; database)
-    {
-        return adoptRef(new IDBAny(WTFMove(database)));
-    }
-
-    static Ref&lt;IDBAny&gt; create(Ref&lt;IDBObjectStore&gt;&amp;&amp; objectStore)
-    {
-        return adoptRef(*new IDBAny(WTFMove(objectStore)));
-    }
-
-    static Ref&lt;IDBAny&gt; create(Ref&lt;IDBIndex&gt;&amp;&amp; index)
-    {
-        return adoptRef(*new IDBAny(WTFMove(index)));
-    }
-
-    static RefPtr&lt;IDBAny&gt; create(Ref&lt;IDBCursor&gt;&amp;&amp; cursor)
-    {
-        return adoptRef(new IDBAny(WTFMove(cursor)));
-    }
-
-    static RefPtr&lt;IDBAny&gt; create(const IDBKeyPath&amp; keyPath)
-    {
-        return adoptRef(new IDBAny(keyPath));
-    }
-
-    static RefPtr&lt;IDBAny&gt; create(const JSC::Strong&lt;JSC::Unknown&gt;&amp; value)
-    {
-        return adoptRef(new IDBAny(value));
-    }
-
-    static RefPtr&lt;IDBAny&gt; createUndefined()
-    {
-        return adoptRef(new IDBAny(IDBAny::Type::Undefined));
-    }
-
-    virtual ~IDBAny();
-
-    enum class Type {
-        Undefined = 0,
-        Null,
-        DOMStringList,
-        IDBCursor,
-        IDBCursorWithValue,
-        IDBDatabase,
-        IDBFactory,
-        IDBIndex,
-        IDBObjectStore,
-        IDBTransaction,
-        ScriptValue,
-        Integer,
-        String,
-        KeyPath,
-    };
-
-    Type type() const { return m_type; }
-    RefPtr&lt;DOMStringList&gt; domStringList();
-    RefPtr&lt;IDBCursor&gt; idbCursor();
-    RefPtr&lt;IDBCursorWithValue&gt; idbCursorWithValue();
-    RefPtr&lt;IDBDatabase&gt; idbDatabase();
-    RefPtr&lt;IDBFactory&gt; idbFactory();
-    RefPtr&lt;IDBIndex&gt; idbIndex();
-    RefPtr&lt;IDBObjectStore&gt; idbObjectStore();
-    RefPtr&lt;IDBTransaction&gt; idbTransaction();
-    JSC::JSValue scriptValue();
-    int64_t integer();
-    const String&amp; string();
-    const IDBKeyPath&amp; keyPath();
-
-private:
-    explicit IDBAny(IDBAny::Type);
-    explicit IDBAny(Ref&lt;IDBDatabase&gt;&amp;&amp;);
-    explicit IDBAny(Ref&lt;IDBObjectStore&gt;&amp;&amp;);
-    explicit IDBAny(Ref&lt;IDBIndex&gt;&amp;&amp;);
-    explicit IDBAny(Ref&lt;IDBCursor&gt;&amp;&amp;);
-    explicit IDBAny(const IDBKeyPath&amp;);
-    explicit IDBAny(const JSC::Strong&lt;JSC::Unknown&gt;&amp;);
-
-    IDBAny::Type m_type { IDBAny::Type::Undefined };
-    RefPtr&lt;IDBDatabase&gt; m_database;
-    RefPtr&lt;IDBObjectStore&gt; m_objectStore;
-    RefPtr&lt;IDBIndex&gt; m_index;
-    RefPtr&lt;IDBCursor&gt; m_cursor;
-    RefPtr&lt;IDBCursorWithValue&gt; m_cursorWithValue;
-
-    const IDBKeyPath m_idbKeyPath;
-    JSC::Strong&lt;JSC::Unknown&gt; m_scriptValue;
-    const String m_string;
-    const int64_t m_integer { 0 };
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBAnyidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/indexeddb/IDBAny.idl (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBAny.idl        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBAny.idl        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * 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:
- *
- * 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 AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 OR ITS 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.
- */
-
-[
-    NoInterfaceObject,
-    Conditional=INDEXED_DATABASE,
-    CustomToJSObject,
-    EnabledAtRuntime=IndexedDB,
-] interface IDBAny {
-    // This space is intentionally left blank.
-};
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -32,11 +32,14 @@
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBGetResult.h&quot;
</span><ins>+#include &quot;IDBIndex.h&quot;
</ins><span class="cx"> #include &quot;IDBObjectStore.h&quot;
</span><span class="cx"> #include &quot;IDBRequest.h&quot;
</span><span class="cx"> #include &quot;IDBTransaction.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><ins>+#include &lt;heap/StrongInlines.h&gt;
+#include &lt;runtime/JSCJSValueInlines.h&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -69,13 +72,13 @@
</span><span class="cx"> 
</span><span class="cx"> IndexedDB::CursorDirection IDBCursor::stringToDirection(const String&amp; directionString, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (directionString == IDBCursor::directionNext())
</del><ins>+    if (directionString == directionNext())
</ins><span class="cx">         return IndexedDB::CursorDirection::Next;
</span><del>-    if (directionString == IDBCursor::directionNextUnique())
</del><ins>+    if (directionString == directionNextUnique())
</ins><span class="cx">         return IndexedDB::CursorDirection::NextNoDuplicate;
</span><del>-    if (directionString == IDBCursor::directionPrev())
</del><ins>+    if (directionString == directionPrev())
</ins><span class="cx">         return IndexedDB::CursorDirection::Prev;
</span><del>-    if (directionString == IDBCursor::directionPrevUnique())
</del><ins>+    if (directionString == directionPrevUnique())
</ins><span class="cx">         return IndexedDB::CursorDirection::PrevNoDuplicate;
</span><span class="cx"> 
</span><span class="cx">     ec = TypeError;
</span><span class="lines">@@ -86,20 +89,20 @@
</span><span class="cx"> {
</span><span class="cx">     switch (direction) {
</span><span class="cx">     case IndexedDB::CursorDirection::Next:
</span><del>-        return IDBCursor::directionNext();
</del><ins>+        return directionNext();
</ins><span class="cx"> 
</span><span class="cx">     case IndexedDB::CursorDirection::NextNoDuplicate:
</span><del>-        return IDBCursor::directionNextUnique();
</del><ins>+        return directionNextUnique();
</ins><span class="cx"> 
</span><span class="cx">     case IndexedDB::CursorDirection::Prev:
</span><del>-        return IDBCursor::directionPrev();
</del><ins>+        return directionPrev();
</ins><span class="cx"> 
</span><span class="cx">     case IndexedDB::CursorDirection::PrevNoDuplicate:
</span><del>-        return IDBCursor::directionPrevUnique();
</del><ins>+        return directionPrevUnique();
</ins><span class="cx"> 
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><del>-        return IDBCursor::directionNext();
</del><ins>+        return directionNext();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -111,7 +114,6 @@
</span><span class="cx"> IDBCursor::IDBCursor(IDBTransaction&amp; transaction, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
</span><span class="cx">     : ActiveDOMObject(transaction.scriptExecutionContext())
</span><span class="cx">     , m_info(info)
</span><del>-    , m_source(IDBAny::create(objectStore).leakRef())
</del><span class="cx">     , m_objectStore(&amp;objectStore)
</span><span class="cx"> {
</span><span class="cx">     suspendIfNeeded();
</span><span class="lines">@@ -120,7 +122,6 @@
</span><span class="cx"> IDBCursor::IDBCursor(IDBTransaction&amp; transaction, IDBIndex&amp; index, const IDBCursorInfo&amp; info)
</span><span class="cx">     : ActiveDOMObject(transaction.scriptExecutionContext())
</span><span class="cx">     , m_info(info)
</span><del>-    , m_source(IDBAny::create(index).leakRef())
</del><span class="cx">     , m_index(&amp;index)
</span><span class="cx"> {
</span><span class="cx">     suspendIfNeeded();
</span><span class="lines">@@ -155,31 +156,11 @@
</span><span class="cx"> 
</span><span class="cx"> const String&amp; IDBCursor::direction() const
</span><span class="cx"> {
</span><del>-    return IDBCursor::directionToString(m_info.cursorDirection());
</del><ins>+    return directionToString(m_info.cursorDirection());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue IDBCursor::key(ExecState&amp;) const
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBCursor::update(ExecState&amp; exec, JSValue value, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><del>-    return m_currentKey.get();
-}
-
-JSValue IDBCursor::primaryKey(ExecState&amp;) const
-{
-    return m_currentPrimaryKey.get();
-}
-
-JSValue IDBCursor::value(ExecState&amp;) const
-{
-    return m_currentValue.get();
-}
-
-IDBAny* IDBCursor::source()
-{
-    return &amp;m_source.get();
-}
-
-RefPtr&lt;WebCore::IDBRequest&gt; IDBCursor::update(JSC::ExecState&amp; exec, Deprecated::ScriptValue&amp; value, ExceptionCodeWithMessage&amp; ec)
-{
</del><span class="cx">     LOG(IndexedDB, &quot;IDBCursor::update&quot;);
</span><span class="cx"> 
</span><span class="cx">     if (sourcesDeleted()) {
</span><span class="lines">@@ -225,7 +206,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto request = effectiveObjectStore().putForCursorUpdate(exec, value.jsValue(), m_currentPrimaryKey.get(), ec);
</del><ins>+    auto request = effectiveObjectStore().putForCursorUpdate(exec, value, m_currentPrimaryKey.get(), ec);
</ins><span class="cx">     if (ec.code)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -236,7 +217,7 @@
</span><span class="cx">     return request;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::advance(unsigned long count, ExceptionCodeWithMessage&amp; ec)
</del><ins>+void IDBCursor::advance(unsigned count, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBCursor::advance&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -279,10 +260,10 @@
</span><span class="cx">     continueFunction(IDBKeyData(), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::continueFunction(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; keyValue, ExceptionCodeWithMessage&amp; ec)
</del><ins>+void IDBCursor::continueFunction(ScriptExecutionContext&amp; context, JSValue keyValue, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; key;
</span><del>-    if (!keyValue.jsValue().isUndefined())
</del><ins>+    if (!keyValue.isUndefined())
</ins><span class="cx">         key = scriptValueToIDBKey(context, keyValue);
</span><span class="cx"> 
</span><span class="cx">     continueFunction(key.get(), ec);
</span><span class="lines">@@ -338,7 +319,7 @@
</span><span class="cx">     uncheckedIterateCursor(key, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::uncheckedIterateCursor(const IDBKeyData&amp; key, unsigned long count)
</del><ins>+void IDBCursor::uncheckedIterateCursor(const IDBKeyData&amp; key, unsigned count)
</ins><span class="cx"> {
</span><span class="cx">     ++m_outstandingRequestCount;
</span><span class="cx"> 
</span><span class="lines">@@ -410,15 +391,17 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_currentKey = idbKeyDataToScriptValue(*context, getResult.keyData());
</del><ins>+    auto&amp; vm = context-&gt;vm();
+
+    m_currentKey = { vm, idbKeyDataToScriptValue(*context, getResult.keyData()) };
</ins><span class="cx">     m_currentKeyData = getResult.keyData();
</span><del>-    m_currentPrimaryKey = idbKeyDataToScriptValue(*context, getResult.primaryKeyData());
</del><ins>+    m_currentPrimaryKey = { vm, idbKeyDataToScriptValue(*context, getResult.primaryKeyData()) };
</ins><span class="cx">     m_currentPrimaryKeyData = getResult.primaryKeyData();
</span><span class="cx"> 
</span><span class="cx">     if (isKeyCursor())
</span><span class="cx">         m_currentValue = { };
</span><span class="cx">     else
</span><del>-        m_currentValue = deserializeIDBValueToJSValue(*context, getResult.value());
</del><ins>+        m_currentValue = { vm, deserializeIDBValueToJSValue(*context, getResult.value()) };
</ins><span class="cx"> 
</span><span class="cx">     m_gotValue = true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,19 +28,18 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><del>-#include &quot;ExceptionCode.h&quot;
-#include &quot;IDBAny.h&quot;
</del><span class="cx"> #include &quot;IDBCursorInfo.h&quot;
</span><del>-#include &lt;runtime/JSCJSValue.h&gt;
</del><ins>+#include &lt;heap/Strong.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class IDBAny;
</del><span class="cx"> class IDBGetResult;
</span><span class="cx"> class IDBIndex;
</span><span class="cx"> class IDBObjectStore;
</span><span class="cx"> class IDBTransaction;
</span><span class="cx"> 
</span><ins>+struct ExceptionCodeWithMessage;
+
</ins><span class="cx"> class IDBCursor : public ScriptWrappable, public RefCounted&lt;IDBCursor&gt;, public ActiveDOMObject {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBCursor&gt; create(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
</span><span class="lines">@@ -55,18 +54,18 @@
</span><span class="cx">     
</span><span class="cx">     virtual ~IDBCursor();
</span><span class="cx"> 
</span><del>-    // Implement the IDL
</del><span class="cx">     const String&amp; direction() const;
</span><del>-    JSC::JSValue key(JSC::ExecState&amp;) const;
-    JSC::JSValue primaryKey(JSC::ExecState&amp;) const;
-    JSC::JSValue value(JSC::ExecState&amp;) const;
-    IDBAny* source();
</del><ins>+    JSC::JSValue key() const;
+    JSC::JSValue primaryKey() const;
+    JSC::JSValue value() const;
+    IDBObjectStore* objectStore() const { return m_objectStore.get(); }
+    IDBIndex* index() const { return m_index.get(); }
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;WebCore::IDBRequest&gt; update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCodeWithMessage&amp;);
-    void advance(unsigned long, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; update(JSC::ExecState&amp;, JSC::JSValue, ExceptionCodeWithMessage&amp;);
+    void advance(unsigned, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     void continueFunction(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</span><del>-    void continueFunction(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;WebCore::IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</del><ins>+    void continueFunction(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
+    RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void continueFunction(const IDBKeyData&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -82,31 +81,30 @@
</span><span class="cx"> 
</span><span class="cx">     void decrementOutstandingRequestCount();
</span><span class="cx"> 
</span><del>-    // ActiveDOMObject.
-    const char* activeDOMObjectName() const;
-    bool canSuspendForDocumentSuspension() const;
-    bool hasPendingActivity() const;
</del><ins>+    bool hasPendingActivity() const final;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     IDBCursor(IDBTransaction&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
</span><span class="cx">     IDBCursor(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    // Cursors are created with an outstanding iteration request.
-    unsigned m_outstandingRequestCount { 1 };
</del><ins>+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
</ins><span class="cx"> 
</span><del>-    IDBCursorInfo m_info;
-    Ref&lt;IDBAny&gt; m_source;
-    IDBObjectStore* m_objectStore { nullptr };
-    IDBIndex* m_index { nullptr };
-    IDBRequest* m_request;
-
</del><span class="cx">     bool sourcesDeleted() const;
</span><span class="cx">     IDBObjectStore&amp; effectiveObjectStore() const;
</span><span class="cx">     IDBTransaction&amp; transaction() const;
</span><span class="cx"> 
</span><del>-    void uncheckedIterateCursor(const IDBKeyData&amp;, unsigned long count);
</del><ins>+    void uncheckedIterateCursor(const IDBKeyData&amp;, unsigned count);
</ins><span class="cx"> 
</span><ins>+    // Cursors are created with an outstanding iteration request.
+    unsigned m_outstandingRequestCount { 1 };
+
+    IDBCursorInfo m_info;
+    RefPtr&lt;IDBObjectStore&gt; m_objectStore;
+    RefPtr&lt;IDBIndex&gt; m_index;
+    IDBRequest* m_request { nullptr };
+
</ins><span class="cx">     bool m_gotValue { false };
</span><span class="cx"> 
</span><span class="cx">     IDBKeyData m_currentKeyData;
</span><span class="lines">@@ -117,6 +115,21 @@
</span><span class="cx">     JSC::Strong&lt;JSC::Unknown&gt; m_currentValue;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline JSC::JSValue IDBCursor::key() const
+{
+    return m_currentKey.get();
+}
+
+inline JSC::JSValue IDBCursor::primaryKey() const
+{
+    return m_currentPrimaryKey.get();
+}
+
+inline JSC::JSValue IDBCursor::value() const
+{
+    return m_currentValue.get();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -25,15 +25,16 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=INDEXED_DATABASE,
</span><ins>+    CustomToJSObject,
</ins><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><span class="cx">     ActiveDOMObject,
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx">     JSCustomMarkFunction,
</span><span class="cx"> ] interface IDBCursor {
</span><del>-    readonly attribute IDBAny source;
</del><ins>+    [CustomGetter] readonly attribute any source;
</ins><span class="cx">     readonly attribute DOMString direction;
</span><del>-    [CallWith=ScriptState, ImplementationReturnType=JSValue] readonly attribute any key;
-    [CallWith=ScriptState, ImplementationReturnType=JSValue] readonly attribute any primaryKey;
</del><ins>+    [ImplementationReturnType=JSValue] readonly attribute any key;
+    [ImplementationReturnType=JSValue] readonly attribute any primaryKey;
</ins><span class="cx"> 
</span><span class="cx">     [CallWith=ScriptState, RaisesExceptionWithMessage] IDBRequest update(any value);
</span><span class="cx">     [RaisesExceptionWithMessage] void advance([EnforceRange] unsigned long count);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorWithValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class IDBCursorWithValue : public IDBCursor {
</del><ins>+class IDBCursorWithValue final : public IDBCursor {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBCursorWithValue&gt; create(IDBTransaction&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
</span><span class="cx">     static Ref&lt;IDBCursorWithValue&gt; create(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorWithValueidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -30,5 +30,5 @@
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx">     JSCustomMarkFunction,
</span><span class="cx"> ] interface IDBCursorWithValue : IDBCursor {
</span><del>-    [CallWith=ScriptState, ImplementationReturnType=JSValue] readonly attribute any value;
</del><ins>+    [ImplementationReturnType=JSValue] readonly attribute any value;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;EventQueue.h&quot;
</span><span class="cx"> #include &quot;IDBConnectionToServer.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><ins>+#include &quot;IDBObjectStore.h&quot;
</ins><span class="cx"> #include &quot;IDBOpenDBRequest.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="cx"> #include &quot;IDBTransaction.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;IDBConnectionToServer.h&quot;
</span><del>-#include &quot;IDBDatabase.h&quot;
</del><span class="cx"> #include &quot;IDBDatabaseInfo.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><ins>+#include &quot;IDBConnectionToServer.h&quot;
</ins><span class="cx"> #include &quot;IDBDatabaseIdentifier.h&quot;
</span><ins>+#include &quot;IDBKey.h&quot;
</ins><span class="cx"> #include &quot;IDBOpenDBRequest.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="lines">@@ -39,6 +41,8 @@
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> 
</span><ins>+using namespace JSC;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static bool shouldThrowSecurityException(ScriptExecutionContext&amp; context)
</span><span class="lines">@@ -68,16 +72,15 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBFactory::getDatabaseNames(ScriptExecutionContext&amp;, ExceptionCode&amp;)
</del><ins>+IDBFactory::~IDBFactory()
</ins><span class="cx"> {
</span><del>-    return nullptr;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::open&quot;);
</span><span class="cx">     
</span><del>-    return openInternal(context, name, 0, ec).release();
</del><ins>+    return openInternal(context, name, 0, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCode&amp; ec)
</span><span class="lines">@@ -89,7 +92,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return openInternal(context, name, version, ec).release();
</del><ins>+    return openInternal(context, name, version, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::openInternal(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCode&amp; ec)
</span><span class="lines">@@ -146,7 +149,7 @@
</span><span class="cx">     return adoptRef(&amp;request.leakRef());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-short IDBFactory::cmp(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; firstValue, const Deprecated::ScriptValue&amp; secondValue, ExceptionCodeWithMessage&amp; ec)
</del><ins>+short IDBFactory::cmp(ScriptExecutionContext&amp; context, JSValue firstValue, JSValue secondValue, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; first = scriptValueToIDBKey(context, firstValue);
</span><span class="cx">     RefPtr&lt;IDBKey&gt; second = scriptValueToIDBKey(context, secondValue);
</span><span class="lines">@@ -160,7 +163,7 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return static_cast&lt;short&gt;(first-&gt;compare(second.get()));
</del><ins>+    return first-&gt;compare(second.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -27,32 +27,43 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;IDBConnectionToServer.h&quot;
-#include &quot;IDBFactory.h&quot;
-#include &quot;IDBOpenDBRequest.h&quot;
</del><ins>+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/Ref.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
</ins><span class="cx"> 
</span><ins>+namespace JSC {
+class JSValue;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBOpenDBRequest;
+class ScriptExecutionContext;
+
+struct ExceptionCodeWithMessage;
+
+namespace IDBClient {
+class IDBConnectionToServer;
+}
+
+typedef int ExceptionCode;
+
</ins><span class="cx"> class IDBFactory : public RefCounted&lt;IDBFactory&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBFactory&gt; create(IDBClient::IDBConnectionToServer&amp;);
</span><ins>+    ~IDBFactory();
</ins><span class="cx"> 
</span><del>-    // FIXME: getDatabaseNames is no longer a web-facing API, and should be removed from IDBFactory.
-    // The Web Inspector currently uses this to enumerate the list of databases, but is more complicated as a result.
-    // We should provide a simpler API to the Web Inspector then remove getDatabaseNames.
-    RefPtr&lt;IDBRequest&gt; getDatabaseNames(ScriptExecutionContext&amp;, ExceptionCode&amp;);
-
</del><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCode&amp;);
</span><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCode&amp;);
</span><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCode&amp;);
</span><span class="cx"> 
</span><del>-    short cmp(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; first, const Deprecated::ScriptValue&amp; second, ExceptionCodeWithMessage&amp;);
</del><ins>+    short cmp(ScriptExecutionContext&amp;, JSC::JSValue first, JSC::JSValue second, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    IDBFactory(IDBClient::IDBConnectionToServer&amp;);
-    
</del><ins>+    explicit IDBFactory(IDBClient::IDBConnectionToServer&amp;);
+
</ins><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; openInternal(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCode&amp;);
</span><del>-    
</del><ins>+
</ins><span class="cx">     Ref&lt;IDBClient::IDBConnectionToServer&gt; m_connectionToServer;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;IDBAny.h&quot;
</del><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="cx"> #include &quot;IDBCursor.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="lines">@@ -38,6 +37,8 @@
</span><span class="cx"> #include &quot;IDBTransaction.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> 
</span><ins>+using namespace JSC;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> IDBIndex::IDBIndex(ScriptExecutionContext&amp; context, const IDBIndexInfo&amp; info, IDBObjectStore&amp; objectStore)
</span><span class="lines">@@ -77,11 +78,6 @@
</span><span class="cx">     return &amp;m_objectStore;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBAny&gt; IDBIndex::keyPathAny() const
-{
-    return IDBAny::create(m_info.keyPath());
-}
-
</del><span class="cx"> const IDBKeyPath&amp; IDBIndex::keyPath() const
</span><span class="cx"> {
</span><span class="cx">     return m_info.keyPath();
</span><span class="lines">@@ -129,7 +125,7 @@
</span><span class="cx">     return m_objectStore.modernTransaction().requestOpenCursor(context, *this, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext&amp; context, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openCursor&quot;);
</span><span class="cx">     RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(context, key, ec.code);
</span><span class="lines">@@ -155,7 +151,7 @@
</span><span class="cx">     return doCount(context, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::count(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBIndex::count(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::count&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -218,7 +214,7 @@
</span><span class="cx">     return m_objectStore.modernTransaction().requestOpenCursor(context, *this, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext&amp; context, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openKeyCursor&quot;);
</span><span class="cx">     RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(context, key, ec.code);
</span><span class="lines">@@ -236,7 +232,7 @@
</span><span class="cx">     return doGet(context, IDBKeyRangeData(range), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::get(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBIndex::get(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::get&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -280,7 +276,7 @@
</span><span class="cx">     return doGetKey(context, IDBKeyRangeData(range), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::getKey(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBIndex::getKey(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::getKey&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -25,58 +25,50 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include &quot;IDBIndex.h&quot;
-
</del><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;ActiveDOMObject.h&quot;
-#include &quot;ExceptionCode.h&quot;
</del><span class="cx"> #include &quot;IDBCursor.h&quot;
</span><span class="cx"> #include &quot;IDBIndexInfo.h&quot;
</span><span class="cx"> #include &quot;IDBRequest.h&quot;
</span><del>-#include &lt;bindings/ScriptValue.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class IDBAny;
</del><span class="cx"> class IDBKeyRange;
</span><del>-class IDBObjectStore;
</del><ins>+
</ins><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><del>-class IDBIndex : public ActiveDOMObject {
</del><ins>+class IDBIndex final : private ActiveDOMObject {
</ins><span class="cx"> public:
</span><span class="cx">     IDBIndex(ScriptExecutionContext&amp;, const IDBIndexInfo&amp;, IDBObjectStore&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual ~IDBIndex();
</span><span class="cx"> 
</span><del>-    // Implement the IDL
</del><span class="cx">     const String&amp; name() const;
</span><span class="cx">     RefPtr&lt;IDBObjectStore&gt; objectStore();
</span><del>-    RefPtr&lt;IDBAny&gt; keyPathAny() const;
</del><span class="cx">     const IDBKeyPath&amp; keyPath() const;
</span><span class="cx">     bool unique() const;
</span><span class="cx">     bool multiEntry() const;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp; context, ExceptionCodeWithMessage&amp; ec) { return openCursor(context, static_cast&lt;IDBKeyRange*&gt;(nullptr), ec); }
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp; context, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
</span><del>-    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); }
</del><ins>+    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp; context, JSC::JSValue key, ExceptionCodeWithMessage&amp; ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); }
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp; context, ExceptionCodeWithMessage&amp; ec) { return openKeyCursor(context, static_cast&lt;IDBKeyRange*&gt;(nullptr), ec); }
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp; context, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec) { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
</span><del>-    RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec) { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
</del><ins>+    RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp; context, JSC::JSValue key, ExceptionCodeWithMessage&amp; ec) { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; getKey(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; getKey(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; getKey(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const IDBIndexInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><span class="lines">@@ -93,10 +85,9 @@
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; doGet(ScriptExecutionContext&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; doGetKey(ScriptExecutionContext&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx"> 
</span><del>-    // ActiveDOMObject
-    const char* activeDOMObjectName() const;
-    bool canSuspendForDocumentSuspension() const;
-    bool hasPendingActivity() const;
</del><ins>+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+    bool hasPendingActivity() const final;
</ins><span class="cx"> 
</span><span class="cx">     IDBIndexInfo m_info;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> ] interface IDBIndex {
</span><span class="cx">     readonly attribute DOMString name;
</span><span class="cx">     readonly attribute IDBObjectStore objectStore;
</span><del>-    [ImplementedAs=keyPathAny] readonly attribute IDBAny keyPath;
</del><ins>+    [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;
</ins><span class="cx">     readonly attribute boolean multiEntry;
</span><span class="cx">     readonly attribute boolean unique;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -26,39 +26,49 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRange.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+
</ins><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBKey.h&quot;
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><ins>+#include &lt;runtime/JSCJSValue.h&gt;
</ins><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBKeyRange&gt; IDBKeyRange::create(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, bool isLowerOpen, bool isUpperOpen)
+{
+    return adoptRef(*new IDBKeyRange(WTFMove(lower), WTFMove(upper), isLowerOpen, isUpperOpen));
+}
+
</ins><span class="cx"> Ref&lt;IDBKeyRange&gt; IDBKeyRange::create(RefPtr&lt;IDBKey&gt;&amp;&amp; key)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; upperBound = key;
-    return adoptRef(*new IDBKeyRange(WTFMove(key), WTFMove(upperBound), LowerBoundClosed, UpperBoundClosed));
</del><ins>+    auto upper = key;
+    return create(WTFMove(key), WTFMove(upper), false, false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBKeyRange::IDBKeyRange(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, LowerBoundType lowerType, UpperBoundType upperType)
</del><ins>+IDBKeyRange::IDBKeyRange(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, bool isLowerOpen, bool isUpperOpen)
</ins><span class="cx">     : m_lower(WTFMove(lower))
</span><span class="cx">     , m_upper(WTFMove(upper))
</span><del>-    , m_lowerType(lowerType)
-    , m_upperType(upperType)
</del><ins>+    , m_isLowerOpen(isLowerOpen)
+    , m_isUpperOpen(isUpperOpen)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBKeyRange::~IDBKeyRange()
+{
+}
+
</ins><span class="cx"> JSValue IDBKeyRange::lowerValue(ScriptExecutionContext&amp; context) const
</span><span class="cx"> {
</span><del>-    return idbKeyDataToScriptValue(context, IDBKeyData(m_lower.get())).get();
</del><ins>+    return idbKeyDataToScriptValue(context, IDBKeyData(m_lower.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue IDBKeyRange::upperValue(ScriptExecutionContext&amp; context) const
</span><span class="cx"> {
</span><del>-    return idbKeyDataToScriptValue(context, IDBKeyData(m_upper.get())).get();
</del><ins>+    return idbKeyDataToScriptValue(context, IDBKeyData(m_upper.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::only(RefPtr&lt;IDBKey&gt;&amp;&amp; key, ExceptionCode&amp; ec)
</span><span class="lines">@@ -71,9 +81,9 @@
</span><span class="cx">     return create(WTFMove(key));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::only(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; keyValue, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::only(ScriptExecutionContext&amp; context, JSValue keyValue, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; key = scriptValueToIDBKey(context, keyValue);
</del><ins>+    auto key = scriptValueToIDBKey(context, keyValue);
</ins><span class="cx">     if (!key || !key-&gt;isValid()) {
</span><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -82,32 +92,32 @@
</span><span class="cx">     return create(WTFMove(key));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::lowerBound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; boundValue, bool open, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::lowerBound(ScriptExecutionContext&amp; context, JSValue boundValue, bool open, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; bound = scriptValueToIDBKey(context, boundValue);
</del><ins>+    auto bound = scriptValueToIDBKey(context, boundValue);
</ins><span class="cx">     if (!bound || !bound-&gt;isValid()) {
</span><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return IDBKeyRange::create(WTFMove(bound), nullptr, open ? LowerBoundOpen : LowerBoundClosed, UpperBoundOpen);
</del><ins>+    return create(WTFMove(bound), nullptr, open, true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::upperBound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; boundValue, bool open, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::upperBound(ScriptExecutionContext&amp; context, JSValue boundValue, bool open, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; bound = scriptValueToIDBKey(context, boundValue);
</del><ins>+    auto bound = scriptValueToIDBKey(context, boundValue);
</ins><span class="cx">     if (!bound || !bound-&gt;isValid()) {
</span><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return IDBKeyRange::create(nullptr, WTFMove(bound), LowerBoundOpen, open ? UpperBoundOpen : UpperBoundClosed);
</del><ins>+    return create(nullptr, WTFMove(bound), true, open);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::bound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; lowerValue, const Deprecated::ScriptValue&amp; upperValue, bool lowerOpen, bool upperOpen, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::bound(ScriptExecutionContext&amp; context, JSValue lowerValue, JSValue upperValue, bool lowerOpen, bool upperOpen, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; lower = scriptValueToIDBKey(context, lowerValue);
-    RefPtr&lt;IDBKey&gt; upper = scriptValueToIDBKey(context, upperValue);
</del><ins>+    auto lower = scriptValueToIDBKey(context, lowerValue);
+    auto upper = scriptValueToIDBKey(context, upperValue);
</ins><span class="cx"> 
</span><span class="cx">     if (!lower || !lower-&gt;isValid() || !upper || !upper-&gt;isValid()) {
</span><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="lines">@@ -122,19 +132,34 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return IDBKeyRange::create(WTFMove(lower), WTFMove(upper), lowerOpen ? LowerBoundOpen : LowerBoundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed);
</del><ins>+    return create(WTFMove(lower), WTFMove(upper), lowerOpen, upperOpen);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IDBKeyRange::isOnlyKey() const
</span><span class="cx"> {
</span><del>-    if (m_lowerType != LowerBoundClosed || m_upperType != UpperBoundClosed)
-        return false;
</del><ins>+    return m_lower &amp;&amp; m_upper &amp;&amp; !m_isLowerOpen &amp;&amp; !m_isUpperOpen &amp;&amp; m_lower-&gt;isEqual(m_upper.get());
+}
</ins><span class="cx"> 
</span><del>-    ASSERT(m_lower);
-    ASSERT(m_upper);
-    return m_lower-&gt;isEqual(m_upper.get());
</del><ins>+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::lowerBound(ScriptExecutionContext&amp; context, JSValue bound, ExceptionCode&amp; ec)
+{
+    return lowerBound(context, bound, false, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::upperBound(ScriptExecutionContext&amp; context, JSValue bound, ExceptionCode&amp; ec)
+{
+    return upperBound(context, bound, false, ec);
+}
+
+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::bound(ScriptExecutionContext&amp; context, JSValue lower, JSValue upper, ExceptionCode&amp; ec)
+{
+    return bound(context, lower, upper, false, false, ec);
+}
+
+RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::bound(ScriptExecutionContext&amp; context, JSValue lower, JSValue upper, bool lowerOpen, ExceptionCode&amp; ec)
+{
+    return bound(context, lower, upper, lowerOpen, false, ec);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -23,72 +23,63 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef IDBKeyRange_h
-#define IDBKeyRange_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;Dictionary.h&quot;
-#include &quot;IDBKey.h&quot;
</del><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><ins>+#include &lt;wtf/RefPtr.h&gt;
</ins><span class="cx"> 
</span><ins>+namespace JSC {
+class JSValue;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBKey;
+class ScriptExecutionContext;
+
</ins><span class="cx"> typedef int ExceptionCode;
</span><span class="cx"> 
</span><span class="cx"> class IDBKeyRange : public ScriptWrappable, public RefCounted&lt;IDBKeyRange&gt; {
</span><span class="cx"> public:
</span><del>-    enum LowerBoundType {
-        LowerBoundOpen,
-        LowerBoundClosed
-    };
-    enum UpperBoundType {
-        UpperBoundOpen,
-        UpperBoundClosed
-    };
-
-    static Ref&lt;IDBKeyRange&gt; create(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, LowerBoundType lowerType, UpperBoundType upperType)
-    {
-        return adoptRef(*new IDBKeyRange(WTFMove(lower), WTFMove(upper), lowerType, upperType));
-    }
</del><ins>+    static Ref&lt;IDBKeyRange&gt; create(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, bool isLowerOpen, bool isUpperOpen);
</ins><span class="cx">     static Ref&lt;IDBKeyRange&gt; create(RefPtr&lt;IDBKey&gt;&amp;&amp;);
</span><del>-    ~IDBKeyRange() { }
</del><ins>+    ~IDBKeyRange();
</ins><span class="cx"> 
</span><span class="cx">     IDBKey* lower() const { return m_lower.get(); }
</span><span class="cx">     IDBKey* upper() const { return m_upper.get(); }
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue lowerValue(ScriptExecutionContext&amp;) const;
</span><span class="cx">     JSC::JSValue upperValue(ScriptExecutionContext&amp;) const;
</span><del>-    bool lowerOpen() const { return m_lowerType == LowerBoundOpen; }
-    bool upperOpen() const { return m_upperType == UpperBoundOpen; }
</del><ins>+    bool lowerOpen() const { return m_isLowerOpen; }
+    bool upperOpen() const { return m_isUpperOpen; }
</ins><span class="cx"> 
</span><span class="cx">     static RefPtr&lt;IDBKeyRange&gt; only(RefPtr&lt;IDBKey&gt;&amp;&amp; value, ExceptionCode&amp;);
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; only(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;);
</del><ins>+    static RefPtr&lt;IDBKeyRange&gt; only(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; lowerBound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; bound, ExceptionCode&amp; ec) { return lowerBound(context, bound, false, ec); }
-    static RefPtr&lt;IDBKeyRange&gt; lowerBound(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; bound, bool open, ExceptionCode&amp;);
</del><ins>+    static RefPtr&lt;IDBKeyRange&gt; lowerBound(ScriptExecutionContext&amp;, JSC::JSValue bound, ExceptionCode&amp;);
+    static RefPtr&lt;IDBKeyRange&gt; lowerBound(ScriptExecutionContext&amp;, JSC::JSValue bound, bool open, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; upperBound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; bound, ExceptionCode&amp; ec) { return upperBound(context, bound, false, ec); }
-    static RefPtr&lt;IDBKeyRange&gt; upperBound(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; bound, bool open, ExceptionCode&amp;);
</del><ins>+    static RefPtr&lt;IDBKeyRange&gt; upperBound(ScriptExecutionContext&amp;, JSC::JSValue bound, ExceptionCode&amp;);
+    static RefPtr&lt;IDBKeyRange&gt; upperBound(ScriptExecutionContext&amp;, JSC::JSValue bound, bool open, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; bound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; lower, const Deprecated::ScriptValue&amp; upper, ExceptionCode&amp; ec) { return bound(context, lower, upper, false, false, ec); }
-    static RefPtr&lt;IDBKeyRange&gt; bound(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; lower, const Deprecated::ScriptValue&amp; upper, bool lowerOpen, ExceptionCode&amp; ec) { return bound(context, lower, upper, lowerOpen, false, ec); }
-    static RefPtr&lt;IDBKeyRange&gt; bound(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; lower, const Deprecated::ScriptValue&amp; upper, bool lowerOpen, bool upperOpen, ExceptionCode&amp;);
</del><ins>+    static RefPtr&lt;IDBKeyRange&gt; bound(ScriptExecutionContext&amp;, JSC::JSValue lower, JSC::JSValue upper, ExceptionCode&amp;);
+    static RefPtr&lt;IDBKeyRange&gt; bound(ScriptExecutionContext&amp;, JSC::JSValue lower, JSC::JSValue upper, bool lowerOpen, ExceptionCode&amp;);
+    static RefPtr&lt;IDBKeyRange&gt; bound(ScriptExecutionContext&amp;, JSC::JSValue lower, JSC::JSValue upper, bool lowerOpen, bool upperOpen, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool isOnlyKey() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    IDBKeyRange(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, LowerBoundType lowerType, UpperBoundType upperType);
</del><ins>+    IDBKeyRange(RefPtr&lt;IDBKey&gt;&amp;&amp; lower, RefPtr&lt;IDBKey&gt;&amp;&amp; upper, bool isLowerOpen, bool isUpperOpen);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBKey&gt; m_lower;
</span><span class="cx">     RefPtr&lt;IDBKey&gt; m_upper;
</span><del>-    LowerBoundType m_lowerType;
-    UpperBoundType m_upperType;
</del><ins>+    bool m_isLowerOpen;
+    bool m_isUpperOpen;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-
-#endif // IDBKeyRange_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     if (isNull)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return IDBKeyRange::create(lowerKey.maybeCreateIDBKey(), upperKey.maybeCreateIDBKey(), lowerOpen ? IDBKeyRange::LowerBoundOpen : IDBKeyRange::LowerBoundClosed, upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed);
</del><ins>+    return IDBKeyRange::create(lowerKey.maybeCreateIDBKey(), upperKey.maybeCreateIDBKey(), lowerOpen, upperOpen);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IDBKeyRangeData::isExactlyOneKey() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="cx"> #include &lt;wtf/Locker.h&gt;
</span><span class="cx"> 
</span><ins>+using namespace JSC;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;IDBObjectStore&gt; IDBObjectStore::create(ScriptExecutionContext&amp; context, const IDBObjectStoreInfo&amp; info, IDBTransaction&amp; transaction)
</span><span class="lines">@@ -80,18 +82,13 @@
</span><span class="cx">     return !m_transaction-&gt;isFinished();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const String IDBObjectStore::name() const
</del><ins>+const String&amp; IDBObjectStore::name() const
</ins><span class="cx"> {
</span><span class="cx">     return m_info.name();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBAny&gt; IDBObjectStore::keyPathAny() const
</del><ins>+const IDBKeyPath&amp; IDBObjectStore::keyPath() const
</ins><span class="cx"> {
</span><del>-    return IDBAny::create(m_info.keyPath());
-}
-
-const IDBKeyPath IDBObjectStore::keyPath() const
-{
</del><span class="cx">     return m_info.keyPath();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -125,7 +122,7 @@
</span><span class="cx">     return openCursor(context, keyRange, IDBCursor::directionNext(), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     return openCursor(context, key, IDBCursor::directionNext(), ec);
</span><span class="cx"> }
</span><span class="lines">@@ -155,7 +152,7 @@
</span><span class="cx">     return WTFMove(request);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext&amp; context, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(context, key, ec.code);
</span><span class="cx">     if (ec.code) {
</span><span class="lines">@@ -166,7 +163,7 @@
</span><span class="cx">     return openCursor(context, keyRange.get(), direction, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::get(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::get(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::get&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -218,12 +215,12 @@
</span><span class="cx">     return WTFMove(request);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::add(JSC::ExecState&amp; state, JSC::JSValue value, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::add(ExecState&amp; state, JSValue value, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::add(JSC::ExecState&amp; execState, JSC::JSValue value, JSC::JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::add(ExecState&amp; execState, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; idbKey;
</span><span class="cx">     if (!key.isUndefined())
</span><span class="lines">@@ -231,7 +228,7 @@
</span><span class="cx">     return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::put(JSC::ExecState&amp; execState, JSC::JSValue value, JSC::JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::put(ExecState&amp; execState, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; idbKey;
</span><span class="cx">     if (!key.isUndefined())
</span><span class="lines">@@ -239,17 +236,17 @@
</span><span class="cx">     return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::put(JSC::ExecState&amp; state, JSC::JSValue value, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::put(ExecState&amp; state, JSValue value, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::putForCursorUpdate(JSC::ExecState&amp; state, JSC::JSValue value, JSC::JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::putForCursorUpdate(ExecState&amp; state, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     return putOrAdd(state, value, scriptValueToIDBKey(state, key), IndexedDB::ObjectStoreOverwriteMode::OverwriteForCursor, InlineKeyCheck::DoNotPerform, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::putOrAdd(JSC::ExecState&amp; state, JSC::JSValue value, RefPtr&lt;IDBKey&gt; key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::putOrAdd(ExecState&amp; state, JSValue value, RefPtr&lt;IDBKey&gt; key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::putOrAdd&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -344,8 +341,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestPutOrAdd(*context, *this, key.get(), *serializedValue, overwriteMode);
-    return adoptRef(request.leakRef());
</del><ins>+    return m_transaction-&gt;requestPutOrAdd(*context, *this, key.get(), *serializedValue, overwriteMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::deleteFunction(ScriptExecutionContext&amp; context, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -391,12 +387,12 @@
</span><span class="cx">     return WTFMove(request);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::deleteFunction(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::deleteFunction(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><del>-    return modernDelete(context, key.jsValue(), ec);
</del><ins>+    return modernDelete(context, key, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::modernDelete(ScriptExecutionContext&amp; context, JSC::JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::modernDelete(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
</span><span class="cx">     if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</span><span class="lines">@@ -405,7 +401,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return doDelete(context, &amp;IDBKeyRange::create(idbKey.get()).get(), ec);
</del><ins>+    return doDelete(context, &amp;IDBKeyRange::create(idbKey.releaseNonNull()).get(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::clear(ScriptExecutionContext&amp; context, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -588,7 +584,7 @@
</span><span class="cx">     return doCount(context, IDBKeyRangeData::allKeys(), ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::count(ScriptExecutionContext&amp; context, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBRequest&gt; IDBObjectStore::count(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::count&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -646,7 +642,7 @@
</span><span class="cx">     m_info = m_originalInfo;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBObjectStore::visitReferencedIndexes(JSC::SlotVisitor&amp; visitor) const
</del><ins>+void IDBObjectStore::visitReferencedIndexes(SlotVisitor&amp; visitor) const
</ins><span class="cx"> {
</span><span class="cx">     Locker&lt;Lock&gt; locker(m_referencedIndexLock);
</span><span class="cx">     for (auto&amp; index : m_referencedIndexes.values())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,20 +28,26 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><del>-#include &quot;IDBIndex.h&quot;
-#include &quot;IDBObjectStore.h&quot;
</del><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><span class="cx"> #include &quot;IndexedDB.h&quot;
</span><ins>+#include &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> 
</span><ins>+namespace JSC {
+class ExecState;
+class JSValue;
+class SlotVisitor;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class DOMStringList;
</span><del>-class IDBAny;
</del><span class="cx"> class IDBIndex;
</span><span class="cx"> class IDBKey;
</span><span class="cx"> class IDBKeyRange;
</span><span class="cx"> class IDBRequest;
</span><span class="cx"> class IDBTransaction;
</span><ins>+
+struct ExceptionCodeWithMessage;
</ins><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="cx"> class IDBObjectStore : public RefCounted&lt;IDBObjectStore&gt;, public ActiveDOMObject {
</span><span class="lines">@@ -50,10 +56,8 @@
</span><span class="cx"> 
</span><span class="cx">     ~IDBObjectStore();
</span><span class="cx"> 
</span><del>-    // Implement the IDBObjectStore IDL
-    const String name() const;
-    RefPtr&lt;IDBAny&gt; keyPathAny() const;
-    const IDBKeyPath keyPath() const;
</del><ins>+    const String&amp; name() const;
+    const IDBKeyPath&amp; keyPath() const;
</ins><span class="cx">     RefPtr&lt;DOMStringList&gt; indexNames() const;
</span><span class="cx">     RefPtr&lt;IDBTransaction&gt; transaction();
</span><span class="cx">     bool autoIncrement() const;
</span><span class="lines">@@ -62,22 +66,22 @@
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; put(JSC::ExecState&amp;, JSC::JSValue, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
+    RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; add(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; put(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; clear(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBIndex&gt; createIndex(ScriptExecutionContext&amp;, const String&amp; name, const IDBKeyPath&amp;, bool unique, bool multiEntry, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBIndex&gt; index(const String&amp; name, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     void deleteIndex(const String&amp; name, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, const Deprecated::ScriptValue&amp; key, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; putForCursorUpdate(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; modernDelete(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">     GenerateIsReachable=Impl,
</span><span class="cx"> ] interface IDBObjectStore {
</span><span class="cx">     readonly attribute DOMString? name;
</span><del>-    [ImplementedAs=keyPathAny] readonly attribute IDBAny keyPath;
</del><ins>+    [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;
</ins><span class="cx">     readonly attribute DOMStringList indexNames;
</span><span class="cx">     readonly attribute IDBTransaction transaction;
</span><span class="cx">     readonly attribute boolean autoIncrement;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;DOMError.h&quot;
</ins><span class="cx"> #include &quot;IDBDatabase.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBRequestCompletionEvent.h&quot;
</span><span class="lines">@@ -80,8 +81,6 @@
</span><span class="cx">     LOG(IndexedDB, &quot;IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit()&quot;);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(hasPendingActivity());
</span><del>-    ASSERT(m_result);
-    ASSERT(m_result-&gt;type() == IDBAny::Type::IDBDatabase);
</del><span class="cx">     m_transaction-&gt;addRequest(*this);
</span><span class="cx"> 
</span><span class="cx">     auto event = IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this);
</span><span class="lines">@@ -98,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx">     IDBError idbError(IDBDatabaseException::AbortError);
</span><span class="cx">     m_domError = DOMError::create(idbError.name(), idbError.message());
</span><del>-    m_result = IDBAny::createUndefined();
</del><ins>+    setResultToUndefined();
</ins><span class="cx"> 
</span><span class="cx">     m_transaction-&gt;addRequest(*this);
</span><span class="cx">     enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this));
</span><span class="lines">@@ -121,9 +120,8 @@
</span><span class="cx">     if (!scriptExecutionContext())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBDatabase&gt; database = IDBDatabase::create(*scriptExecutionContext(), connection(), resultData);
-    m_result = IDBAny::create(WTFMove(database));
-    m_readyState = IDBRequestReadyState::Done;
</del><ins>+    setResult(IDBDatabase::create(*scriptExecutionContext(), connection(), resultData));
+    m_isDone = true;
</ins><span class="cx"> 
</span><span class="cx">     enqueueEvent(IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this));
</span><span class="cx"> }
</span><span class="lines">@@ -141,9 +139,9 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(IndexedDB, &quot;IDBOpenDBRequest::onUpgradeNeeded() - current version is %&quot; PRIu64 &quot;, new is %&quot; PRIu64, oldVersion, newVersion);
</span><span class="cx"> 
</span><del>-    m_result = IDBAny::create(WTFMove(database));
-    m_readyState = IDBRequestReadyState::Done;
-    m_transaction = adoptRef(&amp;transaction.leakRef());
</del><ins>+    setResult(WTFMove(database));
+    m_isDone = true;
+    m_transaction = WTFMove(transaction);
</ins><span class="cx">     m_transaction-&gt;addRequest(*this);
</span><span class="cx"> 
</span><span class="cx">     enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, eventNames().upgradeneededEvent));
</span><span class="lines">@@ -155,8 +153,8 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(IndexedDB, &quot;IDBOpenDBRequest::onDeleteDatabaseSuccess() - current version is %&quot; PRIu64, oldVersion);
</span><span class="cx"> 
</span><del>-    m_readyState = IDBRequestReadyState::Done;
-    m_result = IDBAny::createUndefined();
</del><ins>+    m_isDone = true;
+    setResultToUndefined();
</ins><span class="cx"> 
</span><span class="cx">     enqueueEvent(IDBVersionChangeEvent::create(oldVersion, 0, eventNames().successEvent));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBOpenDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -27,27 +27,19 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;DOMError.h&quot;
</del><span class="cx"> #include &quot;IDBDatabaseIdentifier.h&quot;
</span><span class="cx"> #include &quot;IDBRequest.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class Event;
-class IDBDatabaseIdentifier;
</del><span class="cx"> class IDBResultData;
</span><del>-class ScriptExecutionContext;
</del><span class="cx"> 
</span><del>-namespace IDBClient {
-class IDBConnectionToServer;
-}
-
-class IDBOpenDBRequest : public IDBRequest {
</del><ins>+class IDBOpenDBRequest final : public IDBRequest {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBOpenDBRequest&gt; createDeleteRequest(IDBClient::IDBConnectionToServer&amp;, ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;);
</span><span class="cx">     static Ref&lt;IDBOpenDBRequest&gt; createOpenRequest(IDBClient::IDBConnectionToServer&amp;, ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;, uint64_t version);
</span><span class="cx"> 
</span><del>-    ~IDBOpenDBRequest() final;
</del><ins>+    virtual ~IDBOpenDBRequest();
</ins><span class="cx">     
</span><span class="cx">     const IDBDatabaseIdentifier&amp; databaseIdentifier() const { return m_databaseIdentifier; }
</span><span class="cx">     uint64_t version() const { return m_version; }
</span><span class="lines">@@ -59,17 +51,17 @@
</span><span class="cx">     void fireSuccessAfterVersionChangeCommit();
</span><span class="cx">     void fireErrorAfterVersionChangeCompletion();
</span><span class="cx"> 
</span><del>-    bool dispatchEvent(Event&amp;) final;
-
</del><span class="cx"> private:
</span><span class="cx">     IDBOpenDBRequest(IDBClient::IDBConnectionToServer&amp;, ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;, uint64_t version, IndexedDB::RequestType);
</span><span class="cx"> 
</span><ins>+    bool dispatchEvent(Event&amp;) final;
+
</ins><span class="cx">     void onError(const IDBResultData&amp;);
</span><span class="cx">     void onSuccess(const IDBResultData&amp;);
</span><span class="cx">     void onUpgradeNeeded(const IDBResultData&amp;);
</span><span class="cx">     void onDeleteDatabaseSuccess(const IDBResultData&amp;);
</span><span class="cx"> 
</span><del>-    bool isOpenDBRequest() const override { return true; }
</del><ins>+    bool isOpenDBRequest() const final { return true; }
</ins><span class="cx"> 
</span><span class="cx">     IDBDatabaseIdentifier m_databaseIdentifier;
</span><span class="cx">     uint64_t m_version { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -36,9 +36,12 @@
</span><span class="cx"> #include &quot;IDBDatabase.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBEventDispatcher.h&quot;
</span><ins>+#include &quot;IDBIndex.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><ins>+#include &quot;IDBObjectStore.h&quot;
</ins><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><ins>+#include &quot;ScopeGuard.h&quot;
</ins><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="lines">@@ -78,7 +81,7 @@
</span><span class="cx">     , m_transaction(&amp;transaction)
</span><span class="cx">     , m_connection(transaction.serverConnection())
</span><span class="cx">     , m_resourceIdentifier(transaction.serverConnection())
</span><del>-    , m_source(IDBAny::create(objectStore))
</del><ins>+    , m_objectStoreSource(&amp;objectStore)
</ins><span class="cx"> {
</span><span class="cx">     suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -88,7 +91,8 @@
</span><span class="cx">     , m_transaction(&amp;transaction)
</span><span class="cx">     , m_connection(transaction.serverConnection())
</span><span class="cx">     , m_resourceIdentifier(transaction.serverConnection())
</span><del>-    , m_source(cursor.source())
</del><ins>+    , m_objectStoreSource(cursor.objectStore())
+    , m_indexSource(cursor.index())
</ins><span class="cx">     , m_pendingCursor(&amp;cursor)
</span><span class="cx"> {
</span><span class="cx">     suspendIfNeeded();
</span><span class="lines">@@ -101,7 +105,7 @@
</span><span class="cx">     , m_transaction(&amp;transaction)
</span><span class="cx">     , m_connection(transaction.serverConnection())
</span><span class="cx">     , m_resourceIdentifier(transaction.serverConnection())
</span><del>-    , m_source(IDBAny::create(index))
</del><ins>+    , m_indexSource(&amp;index)
</ins><span class="cx"> {
</span><span class="cx">     suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -114,23 +118,10 @@
</span><span class="cx"> 
</span><span class="cx"> IDBRequest::~IDBRequest()
</span><span class="cx"> {
</span><del>-    if (m_result) {
-        auto type = m_result-&gt;type();
-        if (type == IDBAny::Type::IDBCursor || type == IDBAny::Type::IDBCursorWithValue)
-            m_result-&gt;idbCursor()-&gt;clearRequest();
-    }
</del><ins>+    if (m_cursorResult)
+        m_cursorResult-&gt;clearRequest();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBAny&gt; IDBRequest::result(ExceptionCodeWithMessage&amp; ec) const
-{
-    if (m_readyState == IDBRequestReadyState::Done)
-        return m_result;
-
-    ec.code = IDBDatabaseException::InvalidStateError;
-    ec.message = ASCIILiteral(&quot;Failed to read the 'result' property from 'IDBRequest': The request has not finished.&quot;);
-    return nullptr;
-}
-
</del><span class="cx"> unsigned short IDBRequest::errorCode(ExceptionCode&amp;) const
</span><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="lines">@@ -138,7 +129,7 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;DOMError&gt; IDBRequest::error(ExceptionCodeWithMessage&amp; ec) const
</span><span class="cx"> {
</span><del>-    if (m_readyState == IDBRequestReadyState::Done)
</del><ins>+    if (m_isDone)
</ins><span class="cx">         return m_domError;
</span><span class="cx"> 
</span><span class="cx">     ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -146,19 +137,16 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBAny&gt; IDBRequest::source() const
-{
-    return m_source;
-}
-
</del><span class="cx"> void IDBRequest::setSource(IDBCursor&amp; cursor)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_cursorRequestNotifier);
</span><span class="cx"> 
</span><del>-    m_source = IDBAny::create(cursor);
</del><ins>+    m_objectStoreSource = nullptr;
+    m_indexSource = nullptr;
+    m_cursorSource = &amp;cursor;
</ins><span class="cx">     m_cursorRequestNotifier = std::make_unique&lt;ScopeGuard&gt;([this]() {
</span><del>-        ASSERT(m_source-&gt;type() == IDBAny::Type::IDBCursor || m_source-&gt;type() == IDBAny::Type::IDBCursorWithValue);
-        m_source-&gt;idbCursor()-&gt;decrementOutstandingRequestCount();
</del><ins>+        ASSERT(m_cursorSource);
+        m_cursorSource-&gt;decrementOutstandingRequestCount();
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -178,57 +166,30 @@
</span><span class="cx"> 
</span><span class="cx"> const String&amp; IDBRequest::readyState() const
</span><span class="cx"> {
</span><del>-    static WTF::NeverDestroyed&lt;String&gt; pendingString(&quot;pending&quot;);
-    static WTF::NeverDestroyed&lt;String&gt; doneString(&quot;done&quot;);
-
-    switch (m_readyState) {
-    case IDBRequestReadyState::Pending:
-        return pendingString;
-    case IDBRequestReadyState::Done:
-        return doneString;
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
</del><ins>+    static NeverDestroyed&lt;String&gt; pendingString(ASCIILiteral(&quot;pending&quot;));
+    static NeverDestroyed&lt;String&gt; doneString(ASCIILiteral(&quot;done&quot;));
+    return m_isDone ? doneString : pendingString;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> uint64_t IDBRequest::sourceObjectStoreIdentifier() const
</span><span class="cx"> {
</span><del>-    if (!m_source)
-        return 0;
-
-    if (m_source-&gt;type() == IDBAny::Type::IDBObjectStore) {
-        auto* objectStore = m_source-&gt;idbObjectStore().get();
-        if (!objectStore)
-            return 0;
-        return objectStore-&gt;info().identifier();
-    }
-
-    if (m_source-&gt;type() == IDBAny::Type::IDBIndex) {
-        auto* index = m_source-&gt;idbIndex().get();
-        if (!index)
-            return 0;
-        return index-&gt;info().objectStoreIdentifier();
-    }
-
</del><ins>+    if (m_objectStoreSource)
+        return m_objectStoreSource-&gt;info().identifier();
+    if (m_indexSource)
+        return m_indexSource-&gt;info().objectStoreIdentifier();
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> uint64_t IDBRequest::sourceIndexIdentifier() const
</span><span class="cx"> {
</span><del>-    if (!m_source)
</del><ins>+    if (!m_indexSource)
</ins><span class="cx">         return 0;
</span><del>-    if (m_source-&gt;type() != IDBAny::Type::IDBIndex)
-        return 0;
-    if (!m_source-&gt;idbIndex())
-        return 0;
-
-    return m_source-&gt;idbIndex()-&gt;info().identifier();
</del><ins>+    return m_indexSource-&gt;info().identifier();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IndexedDB::IndexRecordType IDBRequest::requestedIndexRecordType() const
</span><span class="cx"> {
</span><del>-    ASSERT(m_source);
-    ASSERT(m_source-&gt;type() == IDBAny::Type::IDBIndex);
</del><ins>+    ASSERT(m_indexSource);
</ins><span class="cx"> 
</span><span class="cx">     return m_requestedIndexRecordType;
</span><span class="cx"> }
</span><span class="lines">@@ -276,7 +237,7 @@
</span><span class="cx">     ASSERT(!m_contextStopped);
</span><span class="cx"> 
</span><span class="cx">     if (event.type() != eventNames().blockedEvent)
</span><del>-        m_readyState = IDBRequestReadyState::Done;
</del><ins>+        m_isDone = true;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;EventTarget&gt;&gt; targets;
</span><span class="cx">     targets.append(this);
</span><span class="lines">@@ -323,51 +284,63 @@
</span><span class="cx">         m_transaction-&gt;abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError), ASCIILiteral(&quot;IDBTransaction will abort due to uncaught exception in an event handler&quot;)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBRequest::setResult(const IDBKeyData* keyData)
</del><ins>+void IDBRequest::setResult(const IDBKeyData&amp; keyData)
</ins><span class="cx"> {
</span><span class="cx">     auto* context = scriptExecutionContext();
</span><del>-    if (!context || !keyData) {
-        m_result = nullptr;
</del><ins>+    if (!context)
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx"> 
</span><del>-    m_result = IDBAny::create(idbKeyDataToScriptValue(*context, *keyData));
</del><ins>+    clearResult();
+    m_scriptResult = { context-&gt;vm(), idbKeyDataToScriptValue(*context, keyData) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBRequest::setResult(uint64_t number)
</span><span class="cx"> {
</span><del>-    ASSERT(scriptExecutionContext());
-    m_result = IDBAny::create(JSC::Strong&lt;JSC::Unknown&gt;(scriptExecutionContext()-&gt;vm(), JSC::JSValue(number)));
</del><ins>+    auto* context = scriptExecutionContext();
+    if (!context)
+        return;
+
+    clearResult();
+    m_scriptResult = { context-&gt;vm(), JSC::jsNumber(number) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBRequest::setResultToStructuredClone(const IDBValue&amp; value)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBRequest::setResultToStructuredClone&quot;);
</span><span class="cx"> 
</span><del>-    auto context = scriptExecutionContext();
</del><ins>+    auto* context = scriptExecutionContext();
</ins><span class="cx">     if (!context)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_result = IDBAny::create(deserializeIDBValueToJSValue(*context, value));
</del><ins>+    clearResult();
+    m_scriptResult = { context-&gt;vm(), deserializeIDBValueToJSValue(*context, value) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBRequest::clearResult()
+{
+    m_scriptResult = { };
+    m_cursorResult = nullptr;
+    m_databaseResult = nullptr;
+}
+
</ins><span class="cx"> void IDBRequest::setResultToUndefined()
</span><span class="cx"> {
</span><del>-    m_result = IDBAny::createUndefined();
</del><ins>+    auto* context = scriptExecutionContext();
+    if (!context)
+        return;
+
+    clearResult();
+    m_scriptResult = { context-&gt;vm(), JSC::jsUndefined() };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBCursor* IDBRequest::resultCursor()
</span><span class="cx"> {
</span><del>-    if (!m_result)
-        return nullptr;
-    if (m_result-&gt;type() == IDBAny::Type::IDBCursor || m_result-&gt;type() == IDBAny::Type::IDBCursorWithValue)
-        return m_result-&gt;idbCursor().get();
-    return nullptr;
</del><ins>+    return m_cursorResult.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBRequest::willIterateCursor(IDBCursor&amp; cursor)
</span><span class="cx"> {
</span><del>-    ASSERT(m_readyState == IDBRequestReadyState::Done);
</del><ins>+    ASSERT(m_isDone);
</ins><span class="cx">     ASSERT(scriptExecutionContext());
</span><span class="cx">     ASSERT(m_transaction);
</span><span class="cx">     ASSERT(!m_pendingCursor);
</span><span class="lines">@@ -376,8 +349,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_pendingCursor = &amp;cursor;
</span><span class="cx">     m_hasPendingActivity = true;
</span><del>-    m_result = nullptr;
-    m_readyState = IDBRequestReadyState::Pending;
</del><ins>+    clearResult();
+    m_isDone = false;
</ins><span class="cx">     m_domError = nullptr;
</span><span class="cx">     m_idbError = { };
</span><span class="cx"> 
</span><span class="lines">@@ -389,12 +362,13 @@
</span><span class="cx"> void IDBRequest::didOpenOrIterateCursor(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_pendingCursor);
</span><del>-    m_result = nullptr;
</del><span class="cx"> 
</span><ins>+    clearResult();
+
</ins><span class="cx">     if (resultData.type() == IDBResultType::IterateCursorSuccess || resultData.type() == IDBResultType::OpenCursorSuccess) {
</span><span class="cx">         m_pendingCursor-&gt;setGetResult(*this, resultData.getResult());
</span><span class="cx">         if (resultData.getResult().isDefined())
</span><del>-            m_result = IDBAny::create(*m_pendingCursor);
</del><ins>+            m_cursorResult = m_pendingCursor;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_cursorRequestNotifier = nullptr;
</span><span class="lines">@@ -405,7 +379,7 @@
</span><span class="cx"> 
</span><span class="cx"> void IDBRequest::requestCompleted(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><del>-    m_readyState = IDBRequestReadyState::Done;
</del><ins>+    m_isDone = true;
</ins><span class="cx"> 
</span><span class="cx">     m_idbError = resultData.error();
</span><span class="cx">     if (!m_idbError.isNull())
</span><span class="lines">@@ -430,6 +404,12 @@
</span><span class="cx">     enqueueEvent(Event::create(eventNames().successEvent, false, false));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBRequest::setResult(Ref&lt;IDBDatabase&gt;&amp;&amp; database)
+{
+    clearResult();
+    m_databaseResult = WTFMove(database);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -29,39 +29,29 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><del>-#include &quot;IDBAny.h&quot;
</del><ins>+#include &quot;IDBError.h&quot;
</ins><span class="cx"> #include &quot;IDBResourceIdentifier.h&quot;
</span><del>-#include &quot;IDBTransaction.h&quot;
-#include &quot;ScopeGuard.h&quot;
-#include &lt;wtf/RefCounted.h&gt;
</del><ins>+#include &quot;IndexedDB.h&quot;
+#include &lt;heap/Strong.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class DOMError;
</ins><span class="cx"> class Event;
</span><del>-class IDBAny;
</del><span class="cx"> class IDBCursor;
</span><span class="cx"> class IDBIndex;
</span><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStore;
</span><span class="cx"> class IDBResultData;
</span><span class="cx"> class IDBValue;
</span><ins>+class ScopeGuard;
</ins><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx"> 
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> class IDBConnectionToServer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-namespace IndexedDB {
-enum class IndexRecordType;
-}
-
-// Defined in the IDL
-enum class IDBRequestReadyState {
-    Pending = 1,
-    Done = 2,
-};
-
-class IDBRequest : public EventTargetWithInlineData, public ActiveDOMObject, public RefCounted&lt;IDBRequest&gt; {
</del><ins>+class IDBRequest : public EventTargetWithInlineData, private ActiveDOMObject, public RefCounted&lt;IDBRequest&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBRequest&gt; create(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBTransaction&amp;);
</span><span class="cx">     static Ref&lt;IDBRequest&gt; create(ScriptExecutionContext&amp;, IDBCursor&amp;, IDBTransaction&amp;);
</span><span class="lines">@@ -72,38 +62,35 @@
</span><span class="cx"> 
</span><span class="cx">     virtual ~IDBRequest();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBAny&gt; result(ExceptionCodeWithMessage&amp;) const;
</del><ins>+    IDBCursor* cursorResult() const { return m_cursorResult.get(); }
+    IDBDatabase* databaseResult() const { return m_databaseResult.get(); }
+    JSC::JSValue scriptResult() const { return m_scriptResult.get(); }
</ins><span class="cx">     unsigned short errorCode(ExceptionCode&amp;) const;
</span><span class="cx">     RefPtr&lt;DOMError&gt; error(ExceptionCodeWithMessage&amp;) const;
</span><del>-    RefPtr&lt;IDBAny&gt; source() const;
</del><ins>+    IDBObjectStore* objectStoreSource() const { return m_objectStoreSource.get(); }
+    IDBIndex* indexSource() const { return m_indexSource.get(); }
+    IDBCursor* cursorSource() const { return m_cursorSource.get(); }
</ins><span class="cx">     RefPtr&lt;IDBTransaction&gt; transaction() const;
</span><span class="cx">     const String&amp; readyState() const;
</span><span class="cx"> 
</span><ins>+    bool isDone() const { return m_isDone; }
+
</ins><span class="cx">     uint64_t sourceObjectStoreIdentifier() const;
</span><span class="cx">     uint64_t sourceIndexIdentifier() const;
</span><span class="cx">     IndexedDB::IndexRecordType requestedIndexRecordType() const;
</span><span class="cx"> 
</span><del>-    // EventTarget
-    EventTargetInterface eventTargetInterface() const override;
</del><span class="cx">     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
</span><span class="cx"> 
</span><del>-    using RefCounted&lt;IDBRequest&gt;::ref;
-    using RefCounted&lt;IDBRequest&gt;::deref;
</del><ins>+    using RefCounted::ref;
+    using RefCounted::deref;
</ins><span class="cx"> 
</span><del>-    void enqueueEvent(Ref&lt;Event&gt;&amp;&amp;);
-    bool dispatchEvent(Event&amp;) override;
-
-    IDBClient::IDBConnectionToServer&amp; connection() { return m_connection; }
-
</del><span class="cx">     void requestCompleted(const IDBResultData&amp;);
</span><span class="cx"> 
</span><del>-    void setResult(const IDBKeyData*);
</del><ins>+    void setResult(const IDBKeyData&amp;);
</ins><span class="cx">     void setResult(uint64_t);
</span><span class="cx">     void setResultToStructuredClone(const IDBValue&amp;);
</span><span class="cx">     void setResultToUndefined();
</span><span class="cx"> 
</span><del>-    IDBAny* modernResult() { return m_result.get(); }
-
</del><span class="cx">     void willIterateCursor(IDBCursor&amp;);
</span><span class="cx">     void didOpenOrIterateCursor(const IDBResultData&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -114,46 +101,67 @@
</span><span class="cx"> 
</span><span class="cx">     IndexedDB::RequestType requestType() const { return m_requestType; }
</span><span class="cx"> 
</span><del>-    // ActiveDOMObject.
-    const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
</del><span class="cx">     bool hasPendingActivity() const final;
</span><del>-    void stop() final;
</del><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     IDBRequest(IDBClient::IDBConnectionToServer&amp;, ScriptExecutionContext&amp;);
</span><del>-    IDBRequest(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBTransaction&amp;);
-    IDBRequest(ScriptExecutionContext&amp;, IDBCursor&amp;, IDBTransaction&amp;);
-    IDBRequest(ScriptExecutionContext&amp;, IDBIndex&amp;, IDBTransaction&amp;);
-    IDBRequest(ScriptExecutionContext&amp;, IDBIndex&amp;, IndexedDB::IndexRecordType, IDBTransaction&amp;);
</del><span class="cx"> 
</span><del>-    // EventTarget.
-    void refEventTarget() final { RefCounted&lt;IDBRequest&gt;::ref(); }
-    void derefEventTarget() final { RefCounted&lt;IDBRequest&gt;::deref(); }
-    void uncaughtExceptionInEventHandler() final;
</del><ins>+    void enqueueEvent(Ref&lt;Event&gt;&amp;&amp;);
+    bool dispatchEvent(Event&amp;) override;
</ins><span class="cx"> 
</span><del>-    virtual bool isOpenDBRequest() const { return false; }
</del><ins>+    IDBClient::IDBConnectionToServer&amp; connection() { return m_connection; }
</ins><span class="cx"> 
</span><del>-    IDBRequestReadyState m_readyState { IDBRequestReadyState::Pending };
-    RefPtr&lt;IDBAny&gt; m_result;
</del><ins>+    void setResult(Ref&lt;IDBDatabase&gt;&amp;&amp;);
+
+    // FIXME: Protected data members aren't great for maintainability.
+    // Consider adding protected helper functions and making these private.
+    bool m_isDone { false };
</ins><span class="cx">     RefPtr&lt;IDBTransaction&gt; m_transaction;
</span><span class="cx">     bool m_shouldExposeTransactionToDOM { true };
</span><span class="cx">     RefPtr&lt;DOMError&gt; m_domError;
</span><del>-    IDBError m_idbError;
-    IndexedDB::RequestType m_requestType = { IndexedDB::RequestType::Other };
</del><ins>+    IndexedDB::RequestType m_requestType { IndexedDB::RequestType::Other };
</ins><span class="cx">     bool m_contextStopped { false };
</span><del>-
</del><span class="cx">     Event* m_openDatabaseSuccessEvent { nullptr };
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    IDBRequest(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBTransaction&amp;);
+    IDBRequest(ScriptExecutionContext&amp;, IDBCursor&amp;, IDBTransaction&amp;);
+    IDBRequest(ScriptExecutionContext&amp;, IDBIndex&amp;, IDBTransaction&amp;);
+    IDBRequest(ScriptExecutionContext&amp;, IDBIndex&amp;, IndexedDB::IndexRecordType, IDBTransaction&amp;);
+
+    void clearResult();
+
+    EventTargetInterface eventTargetInterface() const override;
+
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+    void stop() final;
+
+    void refEventTarget() final { RefCounted::ref(); }
+    void derefEventTarget() final { RefCounted::deref(); }
+    void uncaughtExceptionInEventHandler() final;
+
+    virtual bool isOpenDBRequest() const { return false; }
+
</ins><span class="cx">     void onError();
</span><span class="cx">     void onSuccess();
</span><span class="cx"> 
</span><span class="cx">     IDBCursor* resultCursor();
</span><span class="cx"> 
</span><ins>+    // Could consider storing these three in a union or union-like class instead.
+    JSC::Strong&lt;JSC::Unknown&gt; m_scriptResult;
+    RefPtr&lt;IDBCursor&gt; m_cursorResult;
+    RefPtr&lt;IDBDatabase&gt; m_databaseResult;
+
+    IDBError m_idbError;
</ins><span class="cx">     IDBClient::IDBConnectionToServer&amp; m_connection;
</span><span class="cx">     IDBResourceIdentifier m_resourceIdentifier;
</span><del>-    RefPtr&lt;IDBAny&gt; m_source;
</del><ins>+
+    // Could consider storing these three in a union or union-like class instead.
+    RefPtr&lt;IDBObjectStore&gt; m_objectStoreSource;
+    RefPtr&lt;IDBIndex&gt; m_indexSource;
+    RefPtr&lt;IDBCursor&gt; m_cursorSource;
+
</ins><span class="cx">     bool m_hasPendingActivity { true };
</span><span class="cx">     IndexedDB::IndexRecordType m_requestedIndexRecordType;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,15 +28,15 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    ActiveDOMObject,
</ins><span class="cx">     Conditional=INDEXED_DATABASE,
</span><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><del>-    ActiveDOMObject,
</del><ins>+    GenerateIsReachable=Impl,
</ins><span class="cx">     SkipVTableValidation,
</span><del>-    GenerateIsReachable=Impl,
</del><span class="cx"> ] interface IDBRequest : EventTarget {
</span><del>-    [GetterRaisesExceptionWithMessage] readonly attribute IDBAny result;
</del><ins>+    [CustomGetter] readonly attribute any result;
</ins><span class="cx">     [GetterRaisesExceptionWithMessage] readonly attribute DOMError error;
</span><del>-    readonly attribute IDBAny source;
</del><ins>+    [CustomGetter] readonly attribute any source;
</ins><span class="cx">     readonly attribute IDBTransaction transaction;
</span><span class="cx">     readonly attribute DOMString readyState;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBEventDispatcher.h&quot;
</span><ins>+#include &quot;IDBIndex.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStore.h&quot;
</span><span class="lines">@@ -733,7 +734,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (request.sourceIndexIdentifier() &amp;&amp; request.requestedIndexRecordType() == IndexedDB::IndexRecordType::Key) {
</span><span class="cx">         if (!result.keyData().isNull())
</span><del>-            request.setResult(&amp;result.keyData());
</del><ins>+            request.setResult(result.keyData());
</ins><span class="cx">         else
</span><span class="cx">             request.setResultToUndefined();
</span><span class="cx">     } else {
</span><span class="lines">@@ -886,7 +887,10 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::didPutOrAddOnServer&quot;);
</span><span class="cx"> 
</span><del>-    request.setResult(resultData.resultKey());
</del><ins>+    if (auto* result = resultData.resultKey())
+        request.setResult(*result);
+    else
+        request.setResultToUndefined();
</ins><span class="cx">     request.requestCompleted(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -27,11 +27,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;IDBDatabaseInfo.h&quot;
</del><ins>+#include &quot;ActiveDOMObject.h&quot;
+#include &quot;EventTarget.h&quot;
</ins><span class="cx"> #include &quot;IDBError.h&quot;
</span><del>-#include &quot;IDBIndex.h&quot;
-#include &quot;IDBObjectStore.h&quot;
-#include &quot;IDBTransaction.h&quot;
</del><span class="cx"> #include &quot;IDBTransactionInfo.h&quot;
</span><span class="cx"> #include &quot;IndexedDB.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="lines">@@ -40,23 +38,27 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class DOMError;
</ins><span class="cx"> class IDBCursor;
</span><span class="cx"> class IDBCursorInfo;
</span><span class="cx"> class IDBDatabase;
</span><span class="cx"> class IDBIndex;
</span><span class="cx"> class IDBIndexInfo;
</span><ins>+class IDBKey;
</ins><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStore;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBOpenDBRequest;
</span><span class="cx"> class IDBResultData;
</span><ins>+class SerializedScriptValue;
+
</ins><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> class TransactionOperation;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class IDBTransaction : public RefCounted&lt;IDBTransaction&gt;, public EventTargetWithInlineData, public ActiveDOMObject {
</del><ins>+class IDBTransaction : public RefCounted&lt;IDBTransaction&gt;, public EventTargetWithInlineData, private ActiveDOMObject {
</ins><span class="cx"> public:
</span><span class="cx">     static const AtomicString&amp; modeReadOnly();
</span><span class="cx">     static const AtomicString&amp; modeReadWrite();
</span><span class="lines">@@ -74,15 +76,15 @@
</span><span class="cx"> 
</span><span class="cx">     // IDBTransaction IDL
</span><span class="cx">     const String&amp; mode() const;
</span><del>-    WebCore::IDBDatabase* db();
</del><ins>+    IDBDatabase* db();
</ins><span class="cx">     RefPtr&lt;DOMError&gt; error() const;
</span><del>-    RefPtr&lt;WebCore::IDBObjectStore&gt; objectStore(const String&amp; name, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBObjectStore&gt; objectStore(const String&amp; name, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     void abort(ExceptionCodeWithMessage&amp;);
</span><span class="cx"> 
</span><span class="cx">     EventTargetInterface eventTargetInterface() const final { return IDBTransactionEventTargetInterfaceType; }
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
</span><del>-    void refEventTarget() final { RefCounted&lt;IDBTransaction&gt;::ref(); }
-    void derefEventTarget() final { RefCounted&lt;IDBTransaction&gt;::deref(); }
</del><ins>+    void refEventTarget() final { RefCounted::ref(); }
+    void derefEventTarget() final { RefCounted::deref(); }
</ins><span class="cx">     using EventTarget::dispatchEvent;
</span><span class="cx">     bool dispatchEvent(Event&amp;) final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -29,9 +29,11 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBCursorInfo.h&quot;
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IDBIndexInfo.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><ins>+#include &quot;MemoryIndexCursor.h&quot;
</ins><span class="cx"> #include &quot;MemoryObjectStore.h&quot;
</span><span class="cx"> #include &quot;MemoryObjectStoreCursor.h&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;IndexKey.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryBackingStoreTransaction.h&quot;
</span><ins>+#include &quot;MemoryIndexCursor.h&quot;
</ins><span class="cx"> #include &quot;MemoryObjectStore.h&quot;
</span><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -23,23 +23,21 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef MemoryIndex_h
-#define MemoryIndex_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;IDBGetResult.h&quot;
</del><span class="cx"> #include &quot;IDBIndexInfo.h&quot;
</span><del>-#include &quot;IDBKeyData.h&quot;
-#include &quot;IndexValueStore.h&quot;
-#include &quot;MemoryIndexCursor.h&quot;
-#include &lt;set&gt;
</del><ins>+#include &quot;IDBResourceIdentifier.h&quot;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><ins>+#include &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBError;
</span><ins>+class IDBGetResult;
+class IDBKeyData;
</ins><span class="cx"> class IndexKey;
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx"> 
</span><span class="lines">@@ -51,7 +49,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace IDBServer {
</span><span class="cx"> 
</span><ins>+class IndexValueStore;
</ins><span class="cx"> class MemoryBackingStoreTransaction;
</span><ins>+class MemoryIndexCursor;
</ins><span class="cx"> class MemoryObjectStore;
</span><span class="cx"> 
</span><span class="cx"> class MemoryIndex : public RefCounted&lt;MemoryIndex&gt; {
</span><span class="lines">@@ -105,4 +105,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><del>-#endif // MemoryIndex_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBCursorInfo.h&quot;
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IndexValueStore.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryCursor.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -37,7 +37,9 @@
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryBackingStoreTransaction.h&quot;
</span><span class="cx"> #include &quot;UniqueIDBDatabase.h&quot;
</span><del>-
</del><ins>+#include &lt;runtime/JSCJSValue.h&gt;
+#include &lt;runtime/JSCJSValueInlines.h&gt;
+#include &lt;runtime/JSLock.h&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -310,7 +312,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; index : m_indexesByName.values()) {
</span><span class="cx">         IndexKey indexKey;
</span><del>-        generateIndexKeyForValue(UniqueIDBDatabase::databaseThreadExecState(), index-&gt;info(), jsValue.get(), indexKey);
</del><ins>+        generateIndexKeyForValue(UniqueIDBDatabase::databaseThreadExecState(), index-&gt;info(), jsValue, indexKey);
</ins><span class="cx"> 
</span><span class="cx">         if (indexKey.isNull())
</span><span class="cx">             continue;
</span><span class="lines">@@ -344,7 +346,7 @@
</span><span class="cx">             return { };
</span><span class="cx"> 
</span><span class="cx">         IndexKey indexKey;
</span><del>-        generateIndexKeyForValue(UniqueIDBDatabase::databaseThreadExecState(), index.info(), jsValue.get(), indexKey);
</del><ins>+        generateIndexKeyForValue(UniqueIDBDatabase::databaseThreadExecState(), index.info(), jsValue, indexKey);
</ins><span class="cx"> 
</span><span class="cx">         if (indexKey.isNull())
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> class IDBCursorInfo;
</span><span class="cx"> class IDBError;
</span><span class="cx"> class IDBKeyData;
</span><ins>+class IDBValue;
</ins><span class="cx"> 
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryObjectStore.h&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -45,6 +45,10 @@
</span><span class="cx"> #include &quot;SQLiteStatement.h&quot;
</span><span class="cx"> #include &quot;SQLiteTransaction.h&quot;
</span><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><ins>+#include &lt;heap/StrongInlines.h&gt;
+#include &lt;runtime/JSCJSValueInlines.h&gt;
+#include &lt;runtime/JSGlobalObject.h&gt;
+#include &lt;runtime/StructureInlines.h&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -1468,7 +1472,7 @@
</span><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="cx">     IndexKey indexKey;
</span><del>-    generateIndexKeyForValue(*m_globalObject-&gt;globalExec(), info, jsValue.get(), indexKey);
</del><ins>+    generateIndexKeyForValue(*m_globalObject-&gt;globalExec(), info, jsValue, indexKey);
</ins><span class="cx"> 
</span><span class="cx">     if (indexKey.isNull())
</span><span class="cx">         return { };
</span><span class="lines">@@ -1488,7 +1492,7 @@
</span><span class="cx">     bool anyRecordsSucceeded = false;
</span><span class="cx">     for (auto&amp; index : info.indexMap().values()) {
</span><span class="cx">         IndexKey indexKey;
</span><del>-        generateIndexKeyForValue(*m_globalObject-&gt;globalExec(), index, jsValue.get(), indexKey);
</del><ins>+        generateIndexKeyForValue(*m_globalObject-&gt;globalExec(), index, jsValue, indexKey);
</ins><span class="cx"> 
</span><span class="cx">         if (indexKey.isNull())
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx">  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><ins>+
</ins><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SQLiteIDBCursor.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -36,6 +37,7 @@
</span><span class="cx"> #include &quot;SQLiteStatement.h&quot;
</span><span class="cx"> #include &quot;SQLiteTransaction.h&quot;
</span><span class="cx"> #include &lt;sqlite3.h&gt;
</span><ins>+#include &lt;wtf/text/StringBuilder.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBServer {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -36,7 +36,9 @@
</span><span class="cx"> #include &quot;IDBValue.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;ScopeGuard.h&quot;
</span><ins>+#include &quot;SerializedScriptValue.h&quot;
</ins><span class="cx"> #include &quot;UniqueIDBDatabaseConnection.h&quot;
</span><ins>+#include &lt;runtime/StructureInlines.h&gt;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="lines">@@ -766,17 +768,17 @@
</span><span class="cx">         JSLockHolder locker(databaseThreadVM());
</span><span class="cx"> 
</span><span class="cx">         auto value = deserializeIDBValueDataToJSValue(databaseThreadExecState(), originalRecordValue.data());
</span><del>-        if (value.get().isUndefined()) {
</del><ins>+        if (value.isUndefined()) {
</ins><span class="cx">             m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Unable to deserialize record value for record key injection&quot;)), usedKey));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!injectIDBKeyIntoScriptValue(databaseThreadExecState(), usedKey, value.get(), objectStoreInfo-&gt;keyPath())) {
</del><ins>+        if (!injectIDBKeyIntoScriptValue(databaseThreadExecState(), usedKey, value, objectStoreInfo-&gt;keyPath())) {
</ins><span class="cx">             m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Unable to inject record key into record value&quot;)), usedKey));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        auto serializedValue = SerializedScriptValue::create(&amp;databaseThreadExecState(), value.get(), nullptr, nullptr);
</del><ins>+        auto serializedValue = SerializedScriptValue::create(&amp;databaseThreadExecState(), value, nullptr, nullptr);
</ins><span class="cx">         if (databaseThreadExecState().hadException()) {
</span><span class="cx">             m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Unable to serialize record value after injecting record key&quot;)), usedKey));
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef UniqueIDBDatabase_h
-#define UniqueIDBDatabase_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="lines">@@ -45,6 +44,10 @@
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> 
</span><ins>+namespace JSC {
+class VM;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IDBError;
</span><span class="lines">@@ -221,4 +224,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><del>-#endif // UniqueIDBDatabase_h
</del></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -1967,7 +1967,6 @@
</span><span class="cx">                 511EC12C1C50ABBF0032F983 /* SQLiteIDBTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC12A1C50ABBA0032F983 /* SQLiteIDBTransaction.h */; };
</span><span class="cx">                 511EC12F1C50ABF50032F983 /* SQLiteIDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC12D1C50ABEC0032F983 /* SQLiteIDBCursor.cpp */; };
</span><span class="cx">                 511EC1301C50ABF50032F983 /* SQLiteIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC12E1C50ABEC0032F983 /* SQLiteIDBCursor.h */; };
</span><del>-                511EF2C017F0FD3500E4FA16 /* JSIDBAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2A817F0FC4800E4FA16 /* JSIDBAny.cpp */; };
</del><span class="cx">                 511EF2C117F0FD3500E4FA16 /* JSIDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2A917F0FC4800E4FA16 /* JSIDBCursor.cpp */; };
</span><span class="cx">                 511EF2C217F0FD3500E4FA16 /* JSIDBCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2AA17F0FC4800E4FA16 /* JSIDBCursorWithValue.cpp */; };
</span><span class="cx">                 511EF2C317F0FD3500E4FA16 /* JSIDBDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2AC17F0FC4800E4FA16 /* JSIDBDatabase.cpp */; };
</span><span class="lines">@@ -1979,7 +1978,6 @@
</span><span class="cx">                 511EF2C917F0FD3500E4FA16 /* JSIDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2B317F0FC4800E4FA16 /* JSIDBRequest.cpp */; };
</span><span class="cx">                 511EF2CA17F0FD3500E4FA16 /* JSIDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2B417F0FC4800E4FA16 /* JSIDBTransaction.cpp */; };
</span><span class="cx">                 511EF2CB17F0FD3500E4FA16 /* JSIDBVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269239911505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp */; };
</span><del>-                511EF2CF17F0FDF100E4FA16 /* JSIDBAnyCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CC17F0FDF100E4FA16 /* JSIDBAnyCustom.cpp */; };
</del><span class="cx">                 511EF2D017F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */; };
</span><span class="cx">                 511EF2D117F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */; };
</span><span class="cx">                 5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; };
</span><span class="lines">@@ -2090,8 +2088,6 @@
</span><span class="cx">                 517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */; };
</span><span class="cx">                 5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */; };
</span><span class="cx">                 5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */; };
</span><del>-                5185FC771BB4C4E80012898F /* IDBAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7196F181106DF0016DC51 /* IDBAny.cpp */; };
-                5185FC781BB4C4E80012898F /* IDBAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71970181106DF0016DC51 /* IDBAny.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 5185FC7A1BB4C4E80012898F /* IDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B541B9F88E800F789CE /* IDBCursor.cpp */; };
</span><span class="cx">                 5185FC7B1BB4C4E80012898F /* IDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B411B9F889B00F789CE /* IDBCursor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5185FC7D1BB4C4E80012898F /* IDBCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */; };
</span><span class="lines">@@ -3621,6 +3617,7 @@
</span><span class="cx">                 934CC10A0EDB223900A658F2 /* ScriptSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */; };
</span><span class="cx">                 934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */; };
</span><span class="cx">                 934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                934F31B51CC0737200DB43DC /* JSIDBRequestCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */; };
</ins><span class="cx">                 934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */; };
</span><span class="cx">                 934F713A0D5A6F1000018D69 /* AuthenticationChallengeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5943,7 +5940,6 @@
</span><span class="cx">                 C58361AA1744523F00173511 /* FontServicesIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C58361A81744523F00173511 /* FontServicesIOS.mm */; };
</span><span class="cx">                 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */; };
</span><span class="cx">                 C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A66511D4FB07004C3E4B /* JSIDBAny.h */; };
</del><span class="cx">                 C585A68311D4FB08004C3E4B /* JSIDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A66B11D4FB07004C3E4B /* JSIDBDatabase.h */; };
</span><span class="cx">                 C585A68D11D4FB08004C3E4B /* JSIDBKeyRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A67511D4FB07004C3E4B /* JSIDBKeyRange.h */; };
</span><span class="cx">                 C585A68F11D4FB08004C3E4B /* JSIDBObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A67711D4FB07004C3E4B /* JSIDBObjectStore.h */; };
</span><span class="lines">@@ -9529,7 +9525,6 @@
</span><span class="cx">                 511EC12E1C50ABEC0032F983 /* SQLiteIDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteIDBCursor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EC1A5188DACA400BA3EB6 /* IDBKeyData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBKeyData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EC1A7188DAE7B00BA3EB6 /* IDBKeyData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBKeyData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                511EF2A817F0FC4800E4FA16 /* JSIDBAny.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBAny.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 511EF2A917F0FC4800E4FA16 /* JSIDBCursor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBCursor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EF2AA17F0FC4800E4FA16 /* JSIDBCursorWithValue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBCursorWithValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EF2AB17F0FC4800E4FA16 /* JSIDBCursorWithValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSIDBCursorWithValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9542,7 +9537,6 @@
</span><span class="cx">                 511EF2B217F0FC4800E4FA16 /* JSIDBOpenDBRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSIDBOpenDBRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EF2B317F0FC4800E4FA16 /* JSIDBRequest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EF2B417F0FC4800E4FA16 /* JSIDBTransaction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBTransaction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                511EF2CC17F0FDF100E4FA16 /* JSIDBAnyCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBAnyCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBDatabaseCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBObjectStoreCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511FAEA91BDC989A00B4AFE4 /* ThreadSafeDataBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadSafeDataBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9744,9 +9738,6 @@
</span><span class="cx">                 51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowIndexedDatabase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowIndexedDatabase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51D7196E181106DF0016DC51 /* DOMWindowIndexedDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowIndexedDatabase.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                51D7196F181106DF0016DC51 /* IDBAny.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBAny.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51D71970181106DF0016DC51 /* IDBAny.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBAny.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51D71971181106DF0016DC51 /* IDBAny.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBAny.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 51D71977181106DF0016DC51 /* IDBCursor.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBCursor.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51D7197B181106DF0016DC51 /* IDBCursorWithValue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBCursorWithValue.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51D7197E181106DF0016DC51 /* IDBDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBDatabase.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -11271,6 +11262,7 @@
</span><span class="cx">                 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceCode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSStringExtras.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreNSStringExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBRequestCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeBase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceErrorBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13905,7 +13897,6 @@
</span><span class="cx">                 C58361A81744523F00173511 /* FontServicesIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontServicesIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBBindingUtilities.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBBindingUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                C585A66511D4FB07004C3E4B /* JSIDBAny.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBAny.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 C585A66B11D4FB07004C3E4B /* JSIDBDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBDatabase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C585A67511D4FB07004C3E4B /* JSIDBKeyRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBKeyRange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C585A67711D4FB07004C3E4B /* JSIDBObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBObjectStore.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -19572,9 +19563,6 @@
</span><span class="cx">                                 51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */,
</span><span class="cx">                                 51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */,
</span><span class="cx">                                 51D7196E181106DF0016DC51 /* DOMWindowIndexedDatabase.idl */,
</span><del>-                                51D7196F181106DF0016DC51 /* IDBAny.cpp */,
-                                51D71970181106DF0016DC51 /* IDBAny.h */,
-                                51D71971181106DF0016DC51 /* IDBAny.idl */,
</del><span class="cx">                                 51645B541B9F88E800F789CE /* IDBCursor.cpp */,
</span><span class="cx">                                 51645B411B9F889B00F789CE /* IDBCursor.h */,
</span><span class="cx">                                 51D71977181106DF0016DC51 /* IDBCursor.idl */,
</span><span class="lines">@@ -20974,8 +20962,6 @@
</span><span class="cx">                                 1AE82F8E0CAAFA9D002237AE /* JSDatabase.h */,
</span><span class="cx">                                 B59DD698119029E5007E9684 /* JSDatabaseCallback.cpp */,
</span><span class="cx">                                 B59DD697119029E5007E9684 /* JSDatabaseCallback.h */,
</span><del>-                                511EF2A817F0FC4800E4FA16 /* JSIDBAny.cpp */,
-                                C585A66511D4FB07004C3E4B /* JSIDBAny.h */,
</del><span class="cx">                                 511EF2A917F0FC4800E4FA16 /* JSIDBCursor.cpp */,
</span><span class="cx">                                 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */,
</span><span class="cx">                                 511EF2AA17F0FC4800E4FA16 /* JSIDBCursorWithValue.cpp */,
</span><span class="lines">@@ -22480,12 +22466,12 @@
</span><span class="cx">                                 BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
</span><span class="cx">                                 AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
</span><span class="cx">                                 D6F7960C166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp */,
</span><del>-                                511EF2CC17F0FDF100E4FA16 /* JSIDBAnyCustom.cpp */,
</del><span class="cx">                                 512BDB4C1C46B0FF006494DF /* JSIDBCursorCustom.cpp */,
</span><span class="cx">                                 5141298D1C5FD7E90059E714 /* JSIDBCursorWithValueCustom.cpp */,
</span><span class="cx">                                 511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */,
</span><span class="cx">                                 5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */,
</span><span class="cx">                                 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */,
</span><ins>+                                934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */,
</ins><span class="cx">                                 A7D0318D0E93540300E24ACD /* JSImageDataCustom.cpp */,
</span><span class="cx">                                 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
</span><span class="cx">                                 BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
</span><span class="lines">@@ -26325,7 +26311,6 @@
</span><span class="cx">                                 513F14540AB634C400094DDF /* IconLoader.h in Headers */,
</span><span class="cx">                                 51E1ECC10C91C90400DC255B /* IconRecord.h in Headers */,
</span><span class="cx">                                 45BAC2B01360BBAB005DA258 /* IconURL.h in Headers */,
</span><del>-                                5185FC781BB4C4E80012898F /* IDBAny.h in Headers */,
</del><span class="cx">                                 51BA4ACC1BBC5BDD00DF3D6D /* IDBBackingStore.h in Headers */,
</span><span class="cx">                                 C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */,
</span><span class="cx">                                 5185FCB91BB4CBF80012898F /* IDBConnectionToClient.h in Headers */,
</span><span class="lines">@@ -26706,7 +26691,6 @@
</span><span class="cx">                                 1A85B2110A1B258700D8C87C /* JSHTMLUListElement.h in Headers */,
</span><span class="cx">                                 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */,
</span><span class="cx">                                 E44614170CD6826900FADA75 /* JSHTMLVideoElement.h in Headers */,
</span><del>-                                C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */,
</del><span class="cx">                                 81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */,
</span><span class="cx">                                 C585A68311D4FB08004C3E4B /* JSIDBDatabase.h in Headers */,
</span><span class="cx">                                 C585A69711D4FB13004C3E4B /* JSIDBFactory.h in Headers */,
</span><span class="lines">@@ -29090,6 +29074,7 @@
</span><span class="cx">                                 E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */,
</span><span class="cx">                                 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */,
</span><span class="cx">                                 7C1E97271A9F9834007BF0FB /* AutoFillButtonElement.cpp in Sources */,
</span><ins>+                                934F31B51CC0737200DB43DC /* JSIDBRequestCustom.cpp in Sources */,
</ins><span class="cx">                                 45830D4D1679B4F800ACF8C3 /* AutoscrollController.cpp in Sources */,
</span><span class="cx">                                 A8CFF0500A154F09000A4234 /* AutoTableLayout.cpp in Sources */,
</span><span class="cx">                                 070363E1181A1CDC00C074A5 /* AVAudioCaptureSource.mm in Sources */,
</span><span class="lines">@@ -30007,7 +29992,6 @@
</span><span class="cx">                                 513F14530AB634C400094DDF /* IconLoader.cpp in Sources */,
</span><span class="cx">                                 B275358E0B053A66002CE64F /* IconMac.mm in Sources */,
</span><span class="cx">                                 51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */,
</span><del>-                                5185FC771BB4C4E80012898F /* IDBAny.cpp in Sources */,
</del><span class="cx">                                 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
</span><span class="cx">                                 516D7D711BB5F0BD00AF7C77 /* IDBConnectionToClient.cpp in Sources */,
</span><span class="cx">                                 5198F7C01BC4856700E2CC5F /* IDBConnectionToServer.cpp in Sources */,
</span><span class="lines">@@ -30423,8 +30407,6 @@
</span><span class="cx">                                 1A85B2100A1B258700D8C87C /* JSHTMLUListElement.cpp in Sources */,
</span><span class="cx">                                 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */,
</span><span class="cx">                                 E44614160CD6826900FADA75 /* JSHTMLVideoElement.cpp in Sources */,
</span><del>-                                511EF2C017F0FD3500E4FA16 /* JSIDBAny.cpp in Sources */,
-                                511EF2CF17F0FDF100E4FA16 /* JSIDBAnyCustom.cpp in Sources */,
</del><span class="cx">                                 511EF2C117F0FD3500E4FA16 /* JSIDBCursor.cpp in Sources */,
</span><span class="cx">                                 512BDB4D1C46B153006494DF /* JSIDBCursorCustom.cpp in Sources */,
</span><span class="cx">                                 511EF2C217F0FD3500E4FA16 /* JSIDBCursorWithValue.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -37,11 +37,12 @@
</span><span class="cx"> #include &quot;IDBValue.h&quot;
</span><span class="cx"> #include &quot;IndexKey.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><ins>+#include &quot;JSDOMStringList.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><ins>+#include &quot;SerializedScriptValue.h&quot;
</ins><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><del>-
</del><span class="cx"> #include &lt;runtime/DateInstance.h&gt;
</span><span class="cx"> #include &lt;runtime/ObjectConstructor.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -305,27 +306,31 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-static Strong&lt;Unknown&gt; deserializeIDBValueToJSValue(ExecState&amp; exec, const IDBValue&amp; value)
</del><ins>+static JSValue deserializeIDBValueToJSValue(ExecState&amp; state, const IDBValue&amp; value)
</ins><span class="cx"> {
</span><ins>+    // FIXME: I think it's peculiar to use undefined to mean &quot;null data&quot; and null to mean &quot;empty data&quot;.
+    // But I am not changing this at the moment because at least some callers are specifically checking isUndefined.
+
</ins><span class="cx">     if (!value.data().data())
</span><del>-        return { exec.vm(), jsUndefined() };
</del><ins>+        return jsUndefined();
</ins><span class="cx"> 
</span><del>-    const Vector&lt;uint8_t&gt;&amp; data = *value.data().data();
-    JSValue result;
-    if (data.size()) {
-        RefPtr&lt;SerializedScriptValue&gt; serializedValue = SerializedScriptValue::createFromWireBytes(Vector&lt;uint8_t&gt;(data));
</del><ins>+    auto&amp; data = *value.data().data();
+    if (data.isEmpty())
+        return jsNull();
</ins><span class="cx"> 
</span><del>-        exec.vm().apiLock().lock();
-        result = serializedValue-&gt;deserialize(&amp;exec, exec.lexicalGlobalObject(), 0, NonThrowing, value.blobURLs(), value.blobFilePaths());
-        exec.vm().apiLock().unlock();
-    } else
-        result = jsNull();
</del><ins>+    auto serializedValue = SerializedScriptValue::createFromWireBytes(Vector&lt;uint8_t&gt;(data));
</ins><span class="cx"> 
</span><del>-    return { exec.vm(), result };
</del><ins>+    state.vm().apiLock().lock();
+    JSValue result = serializedValue-&gt;deserialize(&amp;state, state.lexicalGlobalObject(), 0, NonThrowing, value.blobURLs(), value.blobFilePaths());
+    state.vm().apiLock().unlock();
+
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Strong&lt;Unknown&gt; deserializeIDBValueToJSValue(ScriptExecutionContext&amp; context, const IDBValue&amp; value)
</del><ins>+JSValue deserializeIDBValueToJSValue(ScriptExecutionContext&amp; context, const IDBValue&amp; value)
</ins><span class="cx"> {
</span><ins>+    // FIXME: I think it's peculiar to return an empty JSValue, undefined, and null for three different error cases.
+
</ins><span class="cx">     auto* execState = context.execState();
</span><span class="cx">     if (!execState)
</span><span class="cx">         return { };
</span><span class="lines">@@ -333,7 +338,7 @@
</span><span class="cx">     return deserializeIDBValueToJSValue(*execState, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Strong&lt;Unknown&gt; deserializeIDBValueDataToJSValue(ExecState&amp; exec, const ThreadSafeDataBuffer&amp; valueData)
</del><ins>+JSValue deserializeIDBValueDataToJSValue(ExecState&amp; exec, const ThreadSafeDataBuffer&amp; valueData)
</ins><span class="cx"> {
</span><span class="cx">     return deserializeIDBValueToJSValue(exec, IDBValue(valueData));
</span><span class="cx"> }
</span><span class="lines">@@ -349,7 +354,7 @@
</span><span class="cx">     return execState ? scriptValueToIDBKey(*execState, scriptValue) : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Strong&lt;Unknown&gt; idbKeyDataToScriptValue(ScriptExecutionContext&amp; context, const IDBKeyData&amp; keyData)
</del><ins>+JSC::JSValue idbKeyDataToScriptValue(ScriptExecutionContext&amp; context, const IDBKeyData&amp; keyData)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; key = keyData.maybeCreateIDBKey();
</span><span class="cx"> 
</span><span class="lines">@@ -357,7 +362,7 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return { };
</span><span class="cx"> 
</span><del>-    return { exec-&gt;vm(), idbKeyToJSValue(exec, jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject()), key.get()) };
</del><ins>+    return idbKeyToJSValue(exec, jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject()), key.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Vector&lt;IDBKeyData&gt; createKeyPathArray(ExecState&amp; exec, JSValue value, const IDBIndexInfo&amp; info)
</span><span class="lines">@@ -403,6 +408,24 @@
</span><span class="cx">     outKey = IndexKey(WTFMove(keyDatas));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue toJS(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, const IDBKeyPath&amp; value)
+{
+    switch (value.type()) {
+    case IndexedDB::KeyPathType::Null:
+        return jsNull();
+    case IndexedDB::KeyPathType::String:
+        return jsStringWithCache(&amp;state, value.string());
+    case IndexedDB::KeyPathType::Array:
+        auto keyPaths = DOMStringList::create();
+        for (auto&amp; path : value.array())
+            keyPaths-&gt;append(path);
+        return toJS(&amp;state, &amp;globalObject, keyPaths);
+    }
+
+    ASSERT_NOT_REACHED();
+    return jsNull();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -24,14 +24,17 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef IDBBindingUtilities_h
-#define IDBBindingUtilities_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;Dictionary.h&quot;
</del><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><ins>+namespace JSC {
+class ExecState;
+class JSValue;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IDBIndexInfo;
</span><span class="lines">@@ -40,19 +43,22 @@
</span><span class="cx"> class IDBKeyPath;
</span><span class="cx"> class IDBValue;
</span><span class="cx"> class IndexKey;
</span><ins>+class JSDOMGlobalObject;
+class ScriptExecutionContext;
</ins><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx"> 
</span><span class="cx"> IDBKeyPath idbKeyPathFromValue(JSC::ExecState&amp;, JSC::JSValue);
</span><ins>+JSC::JSValue toJS(JSC::ExecState&amp;, JSDOMGlobalObject&amp;, const IDBKeyPath&amp;);
</ins><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBKey&gt; maybeCreateIDBKeyFromScriptValueAndKeyPath(JSC::ExecState&amp;, const JSC::JSValue&amp;, const IDBKeyPath&amp;);
</span><span class="cx"> bool canInjectIDBKeyIntoScriptValue(JSC::ExecState&amp;, const JSC::JSValue&amp;, const IDBKeyPath&amp;);
</span><span class="cx"> bool injectIDBKeyIntoScriptValue(JSC::ExecState&amp;, const IDBKeyData&amp;, JSC::JSValue, const IDBKeyPath&amp;);
</span><span class="cx"> 
</span><del>-JSC::Strong&lt;JSC::Unknown&gt; idbKeyDataToScriptValue(ScriptExecutionContext&amp;, const IDBKeyData&amp;);
</del><ins>+JSC::JSValue idbKeyDataToScriptValue(ScriptExecutionContext&amp;, const IDBKeyData&amp;);
</ins><span class="cx"> void generateIndexKeyForValue(JSC::ExecState&amp;, const IDBIndexInfo&amp;, JSC::JSValue, IndexKey&amp; outKey);
</span><span class="cx"> 
</span><del>-JSC::Strong&lt;JSC::Unknown&gt; deserializeIDBValueToJSValue(ScriptExecutionContext&amp;, const IDBValue&amp;);
-JSC::Strong&lt;JSC::Unknown&gt; deserializeIDBValueDataToJSValue(JSC::ExecState&amp;, const ThreadSafeDataBuffer&amp; valueData);
</del><ins>+JSC::JSValue deserializeIDBValueToJSValue(ScriptExecutionContext&amp;, const IDBValue&amp;);
+JSC::JSValue deserializeIDBValueDataToJSValue(JSC::ExecState&amp;, const ThreadSafeDataBuffer&amp; valueData);
</ins><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBKey&gt; scriptValueToIDBKey(ScriptExecutionContext&amp;, const JSC::JSValue&amp;);
</span><span class="cx"> RefPtr&lt;IDBKey&gt; scriptValueToIDBKey(JSC::ExecState&amp;, const JSC::JSValue&amp;);
</span><span class="lines">@@ -60,5 +66,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><del>-
-#endif // IDBBindingUtilities_h
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBAnyCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -1,116 +0,0 @@
</span><del>-/*
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * &quot;AS IS&quot; 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 &quot;config.h&quot;
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include &quot;JSIDBAny.h&quot;
-
-#include &quot;IDBAny.h&quot;
-#include &quot;IDBCursor.h&quot;
-#include &quot;IDBCursorWithValue.h&quot;
-#include &quot;IDBDatabase.h&quot;
-#include &quot;IDBFactory.h&quot;
-#include &quot;IDBIndex.h&quot;
-#include &quot;IDBObjectStore.h&quot;
-#include &quot;JSDOMBinding.h&quot;
-#include &quot;JSDOMStringList.h&quot;
-#include &quot;JSIDBCursor.h&quot;
-#include &quot;JSIDBCursorWithValue.h&quot;
-#include &quot;JSIDBDatabase.h&quot;
-#include &quot;JSIDBFactory.h&quot;
-#include &quot;JSIDBIndex.h&quot;
-#include &quot;JSIDBObjectStore.h&quot;
-#include &quot;JSIDBTransaction.h&quot;
-#include &quot;SerializedScriptValue.h&quot;
-
-using namespace JSC;
-
-namespace WebCore {
-
-static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const IDBKeyPath&amp; value)
-{
-    switch (value.type()) {
-    case IndexedDB::KeyPathType::Null:
-        return jsNull();
-    case IndexedDB::KeyPathType::String:
-        return jsStringWithCache(exec, value.string());
-    case IndexedDB::KeyPathType::Array:
-        RefPtr&lt;DOMStringList&gt; keyPaths = DOMStringList::create();
-        for (Vector&lt;String&gt;::const_iterator it = value.array().begin(); it != value.array().end(); ++it)
-            keyPaths-&gt;append(*it);
-        return toJS(exec, globalObject, keyPaths.release());
-    }
-
-    ASSERT_NOT_REACHED();
-    return jsUndefined();
-}
-
-JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, IDBAny* idbAny)
-{
-    if (!idbAny)
-        return jsNull();
-
-    switch (idbAny-&gt;type()) {
-    case IDBAny::Type::Undefined:
-        return jsUndefined();
-    case IDBAny::Type::Null:
-        return jsNull();
-    case IDBAny::Type::DOMStringList:
-        return toJS(exec, globalObject, idbAny-&gt;domStringList());
-    case IDBAny::Type::IDBCursor:
-        return toJS(exec, globalObject, idbAny-&gt;idbCursor());
-    case IDBAny::Type::IDBCursorWithValue:
-        return wrap&lt;JSIDBCursorWithValue&gt;(globalObject, idbAny-&gt;idbCursorWithValue().get());
-    case IDBAny::Type::IDBDatabase:
-        return toJS(exec, globalObject, idbAny-&gt;idbDatabase());
-    case IDBAny::Type::IDBFactory:
-        return toJS(exec, globalObject, idbAny-&gt;idbFactory());
-    case IDBAny::Type::IDBIndex:
-        return toJS(exec, globalObject, idbAny-&gt;idbIndex());
-    case IDBAny::Type::IDBObjectStore:
-        return toJS(exec, globalObject, idbAny-&gt;idbObjectStore());
-    case IDBAny::Type::IDBTransaction:
-        return toJS(exec, globalObject, idbAny-&gt;idbTransaction());
-    case IDBAny::Type::ScriptValue:
-        return idbAny-&gt;scriptValue();
-    case IDBAny::Type::String:
-        return jsStringWithCache(exec, idbAny-&gt;string());
-    case IDBAny::Type::Integer:
-        return jsNumber(idbAny-&gt;integer());
-    case IDBAny::Type::KeyPath:
-        return toJS(exec, globalObject, idbAny-&gt;keyPath());
-    }
-
-    ASSERT_NOT_REACHED();
-    return jsUndefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -28,7 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;IDBCursor.h&quot;
</del><ins>+#include &quot;JSDOMBinding.h&quot;
+#include &quot;JSIDBCursorWithValue.h&quot;
+#include &quot;JSIDBIndex.h&quot;
+#include &quot;JSIDBObjectStore.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="lines">@@ -36,11 +39,26 @@
</span><span class="cx"> 
</span><span class="cx"> void JSIDBCursor::visitAdditionalChildren(SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><del>-    auto&amp; cursor = static_cast&lt;IDBCursor&amp;&gt;(wrapped());
</del><ins>+    auto&amp; cursor = wrapped();
</ins><span class="cx">     if (auto* request = cursor.request())
</span><span class="cx">         visitor.addOpaqueRoot(request);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue JSIDBCursor::source(ExecState&amp; state) const
+{
+    auto&amp; cursor = wrapped();
+    if (auto* index = cursor.index())
+        return toJS(&amp;state, globalObject(), index);
+    return toJS(&amp;state, globalObject(), cursor.objectStore());
+}
+
+JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, IDBCursor* cursor)
+{
+    if (cursor-&gt;isKeyCursor())
+        return wrap&lt;JSIDBCursor&gt;(globalObject, cursor);
+    return wrap&lt;JSIDBCursorWithValue&gt;(globalObject, static_cast&lt;IDBCursorWithValue*&gt;(cursor));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBRequestCustomcppfromrev199667trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp (from rev 199667, trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp) (0 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple 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. AND ITS 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 APPLE INC. OR ITS 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 &quot;config.h&quot;
+#include &quot;JSIDBRequest.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;JSIDBCursor.h&quot;
+#include &quot;JSIDBDatabase.h&quot;
+#include &quot;JSIDBIndex.h&quot;
+#include &quot;JSIDBObjectStore.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSIDBRequest::result(ExecState&amp; state) const
+{
+    auto&amp; request = wrapped();
+
+    if (!request.isDone()) {
+        ExceptionCodeWithMessage ec;
+        ec.code = IDBDatabaseException::InvalidStateError;
+        ec.message = ASCIILiteral(&quot;Failed to read the 'result' property from 'IDBRequest': The request has not finished.&quot;);
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    if (auto* cursor = request.cursorResult())
+        return toJS(&amp;state, globalObject(), cursor);
+    if (auto* database = request.databaseResult())
+        return toJS(&amp;state, globalObject(), database);
+    if (auto result = request.scriptResult())
+        return result;
+    return jsNull();
+}
+
+JSValue JSIDBRequest::source(ExecState&amp; state) const
+{
+    auto&amp; request = wrapped();
+    if (auto* cursor = request.cursorSource())
+        return toJS(&amp;state, globalObject(), cursor);
+    if (auto* index = request.indexSource())
+        return toJS(&amp;state, globalObject(), index);
+    return toJS(&amp;state, globalObject(), request.objectStoreSource());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -4346,15 +4346,18 @@
</span><span class="cx">         }
</span><span class="cx">         AddToImplIncludes(&quot;&lt;runtime/JSArray.h&gt;&quot;, $conditional);
</span><span class="cx"> 
</span><del>-        return &quot;jsArray(state, $thisValue-&gt;globalObject(), $value)&quot;;
</del><ins>+        return &quot;jsArray(state, $globalObject, $value)&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    my $returnType = $signature-&gt;extendedAttributes-&gt;{&quot;ImplementationReturnType&quot;};
</del><span class="cx">     if ($type eq &quot;any&quot;) {
</span><ins>+        my $returnType = $signature-&gt;extendedAttributes-&gt;{&quot;ImplementationReturnType&quot;};
</ins><span class="cx">         if ($interfaceName eq &quot;Document&quot;) {
</span><span class="cx">             AddToImplIncludes(&quot;JSCanvasRenderingContext2D.h&quot;, $conditional);
</span><span class="cx">         } elsif (defined $returnType and $returnType eq &quot;JSValue&quot;) {
</span><span class="cx">             return &quot;$value&quot;;
</span><ins>+        } elsif (defined $returnType and $returnType eq &quot;IDBKeyPath&quot;) {
+            AddToImplIncludes(&quot;IDBBindingUtilities.h&quot;, $conditional);
+            return &quot;toJS(*state, *$globalObject, $value)&quot;;
</ins><span class="cx">         } else {
</span><span class="cx">             return &quot;($value.hasNoValue() ? jsNull() : $value.jsValue())&quot;;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (199667 => 199668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-04-18 15:24:47 UTC (rev 199667)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-04-18 15:33:30 UTC (rev 199668)
</span><span class="lines">@@ -90,6 +90,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace {
</span><span class="cx"> 
</span><ins>+#if 0 // IDBFactory::getDatabaseNames isn't implemented any more. Disable this for now.
+
</ins><span class="cx"> class GetDatabaseNamesCallback : public EventListener {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(GetDatabaseNamesCallback);
</span><span class="cx"> public:
</span><span class="lines">@@ -142,6 +144,8 @@
</span><span class="cx">     String m_securityOrigin;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#endif
+
</ins><span class="cx"> class ExecutableWithDatabase : public RefCounted&lt;ExecutableWithDatabase&gt; {
</span><span class="cx"> public:
</span><span class="cx">     ExecutableWithDatabase(ScriptExecutionContext* context)
</span><span class="lines">@@ -176,14 +180,13 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        IDBOpenDBRequest* idbOpenDBRequest = static_cast&lt;IDBOpenDBRequest*&gt;(event-&gt;target());
-        ExceptionCodeWithMessage ec;
-        RefPtr&lt;IDBAny&gt; requestResult = idbOpenDBRequest-&gt;result(ec);
-        if (ec.code) {
</del><ins>+        auto&amp; request = static_cast&lt;IDBOpenDBRequest&amp;&gt;(*event-&gt;target());
+        if (!request.isDone()) {
</ins><span class="cx">             m_executableWithDatabase-&gt;requestCallback().sendFailure(&quot;Could not get result in callback.&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (requestResult-&gt;type() != IDBAny::Type::IDBDatabase) {
</del><ins>+        auto databaseResult = request.databaseResult();
+        if (!databaseResult) {
</ins><span class="cx">             m_executableWithDatabase-&gt;requestCallback().sendFailure(&quot;Unexpected result type.&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -309,14 +312,12 @@
</span><span class="cx">     bool lowerOpen;
</span><span class="cx">     if (!keyRange-&gt;getBoolean(&quot;lowerOpen&quot;, lowerOpen))
</span><span class="cx">         return nullptr;
</span><del>-    IDBKeyRange::LowerBoundType lowerBoundType = lowerOpen ? IDBKeyRange::LowerBoundOpen : IDBKeyRange::LowerBoundClosed;
</del><span class="cx"> 
</span><span class="cx">     bool upperOpen;
</span><span class="cx">     if (!keyRange-&gt;getBoolean(&quot;upperOpen&quot;, upperOpen))
</span><span class="cx">         return nullptr;
</span><del>-    IDBKeyRange::UpperBoundType upperBoundType = upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed;
</del><span class="cx"> 
</span><del>-    return IDBKeyRange::create(WTFMove(idbLower), WTFMove(idbUpper), lowerBoundType, upperBoundType);
</del><ins>+    return IDBKeyRange::create(WTFMove(idbLower), WTFMove(idbUpper), lowerOpen, upperOpen);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class DataLoader;
</span><span class="lines">@@ -342,27 +343,26 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        IDBRequest* idbRequest = static_cast&lt;IDBRequest*&gt;(event-&gt;target());
-        ExceptionCodeWithMessage ecwm;
-        RefPtr&lt;IDBAny&gt; requestResult = idbRequest-&gt;result(ecwm);
-        if (ecwm.code) {
</del><ins>+        auto&amp; request = static_cast&lt;IDBRequest&amp;&gt;(*event-&gt;target());
+        if (!request.isDone()) {
</ins><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not get result in callback.&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (requestResult-&gt;type() == IDBAny::Type::ScriptValue) {
</del><ins>+        if (request.scriptResult()) {
</ins><span class="cx">             end(false);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (requestResult-&gt;type() != IDBAny::Type::IDBCursorWithValue) {
</del><ins>+        auto* cursorResult = request.cursorResult();
+        if (!cursorResult) {
</ins><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Unexpected result type.&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RefPtr&lt;IDBCursorWithValue&gt; idbCursor = requestResult-&gt;idbCursorWithValue();
</del><ins>+        auto&amp; cursor = *cursorResult;
</ins><span class="cx"> 
</span><span class="cx">         if (m_skipCount) {
</span><span class="cx">             ExceptionCodeWithMessage ec;
</span><del>-            idbCursor-&gt;advance(m_skipCount, ec);
</del><ins>+            cursor.advance(m_skipCount, ec);
</ins><span class="cx">             if (ec.code)
</span><span class="cx">                 m_requestCallback-&gt;sendFailure(&quot;Could not advance cursor.&quot;);
</span><span class="cx">             m_skipCount = 0;
</span><span class="lines">@@ -376,7 +376,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Continue cursor before making injected script calls, otherwise transaction might be finished.
</span><span class="cx">         ExceptionCodeWithMessage ec;
</span><del>-        idbCursor-&gt;continueFunction(nullptr, ec);
</del><ins>+        cursor.continueFunction(nullptr, ec);
</ins><span class="cx">         if (ec.code) {
</span><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not continue cursor.&quot;);
</span><span class="cx">             return;
</span><span class="lines">@@ -387,9 +387,9 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;DataEntry&gt; dataEntry = DataEntry::create()
</span><del>-            .setKey(m_injectedScript.wrapObject(idbCursor-&gt;key(*state), String(), true))
-            .setPrimaryKey(m_injectedScript.wrapObject(idbCursor-&gt;primaryKey(*state), String(), true))
-            .setValue(m_injectedScript.wrapObject(idbCursor-&gt;value(*state), String(), true))
</del><ins>+            .setKey(m_injectedScript.wrapObject(cursor.key(), String(), true))
+            .setPrimaryKey(m_injectedScript.wrapObject(cursor.primaryKey(), String(), true))
+            .setValue(m_injectedScript.wrapObject(cursor.value(), String(), true))
</ins><span class="cx">             .release();
</span><span class="cx">         m_result-&gt;addItem(WTFMove(dataEntry));
</span><span class="cx"> 
</span><span class="lines">@@ -512,6 +512,11 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorIndexedDBAgent::requestDatabaseNames(ErrorString&amp; errorString, const String&amp; securityOrigin, Ref&lt;RequestDatabaseNamesCallback&gt;&amp;&amp; requestCallback)
</span><span class="cx"> {
</span><ins>+    UNUSED_PARAM(errorString);
+    UNUSED_PARAM(securityOrigin);
+    requestCallback-&gt;sendFailure(&quot;Could not obtain database names.&quot;);
+
+#if 0 // IDBFactory::getDatabaseNames isn't implemented any more. Disable this for now.
</ins><span class="cx">     Frame* frame = m_pageAgent-&gt;findFrameWithSecurityOrigin(securityOrigin);
</span><span class="cx">     Document* document = assertDocument(errorString, frame);
</span><span class="cx">     if (!document)
</span><span class="lines">@@ -529,6 +534,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     idbRequest-&gt;addEventListener(eventNames().successEvent, GetDatabaseNamesCallback::create(WTFMove(requestCallback), document-&gt;securityOrigin()-&gt;toRawString()), false);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorIndexedDBAgent::requestDatabase(ErrorString&amp; errorString, const String&amp; securityOrigin, const String&amp; databaseName, Ref&lt;RequestDatabaseCallback&gt;&amp;&amp; requestCallback)
</span></span></pre>
</div>
</div>

</body>
</html>