[prev in list] [next in list] [prev in thread] [next in thread]
List: webkit-changes
Subject: [webkit-changes] [132934] branches/chromium/1312/Source
From: kareng () chromium ! org
Date: 2012-10-30 19:06:05
Message-ID: 20121030190606.280A2301227 () svn ! webkit ! org
[Download RAW message or body]
[Attachment #2 (text/html)]
<!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>[132934] branches/chromium/1312/Source</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/132934">132934</a></dd> \
<dt>Author</dt> <dd>kareng@chromium.org</dd> <dt>Date</dt> <dd>2012-10-30 12:06:04 \
-0700 (Tue, 30 Oct 2012)</dd> </dl>
<h3>Log Message</h3>
<pre>Merge 132922 - Remove ensureAuxiliaryContext
https://bugs.webkit.org/show_bug.cgi?id=99975
Patch by Dan Carney <dcarney@google.com> on 2012-10-30
Reviewed by Adam Barth.
Source/WebCore:
Removed auxilliaryContext as use if it is problematic in IDB.
No new tests. No change in functionality.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::setValueReady):
* Modules/indexeddb/IDBCursor.h:
(IDBCursor):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::generateIndexKeysForValue):
(WebCore::IDBObjectStore::put):
(WebCore):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::dispatchEvent):
* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromScriptValueAndKeyPath):
(WebCore::deserializeIDBValue):
(WebCore::injectIDBKeyIntoScriptValue):
* bindings/v8/IDBBindingUtilities.h:
(WebCore):
* bindings/v8/V8Binding.cpp:
(WebCore::toV8Context):
(WebCore):
* bindings/v8/V8Binding.h:
(WebCore):
* bindings/v8/V8PerIsolateData.cpp:
(WebCore):
* bindings/v8/V8PerIsolateData.h:
Source/WebKit/chromium:
Updated tests to use correct v8 context.
* tests/IDBBindingUtilitiesTest.cpp:
(WebKit::checkKeyFromValueAndKeyPathInternal):
(WebKit::checkKeyPathNullValue):
(WebKit::injectKey):
(WebKit::checkInjection):
(WebKit::checkInjectionFails):
(WebKit::checkKeyPathStringValue):
(WebKit::checkKeyPathNumberValue):
(WebKit::scriptExecutionContext):
(WebKit):
(WebKit::TEST):
TBR=commit-queue@webkit.org
Review URL: https://codereview.chromium.org/11337028</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#brancheschromium1312SourceWebCoreModulesindexeddbIDBRequestcpp">branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#brancheschromium1312SourceWebCoreModulesindexeddbIDBRequesth">branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#brancheschromium1312SourceWebCorebindingsv8IDBBindingUtilitiescpp">branches/chromium/1312/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp</a></li>
<li><a href="#brancheschromium1312SourceWebCorebindingsv8V8PerIsolateDatacpp">branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.cpp</a></li>
<li><a href="#brancheschromium1312SourceWebCorebindingsv8V8PerIsolateDatah">branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.h</a></li>
<li><a href="#brancheschromium1312SourceWebKitchromiumWebKitgyp">branches/chromium/1312/Source/WebKit/chromium/WebKit.gyp</a></li>
<li><a href="#brancheschromium1312SourceWebKitchromiumtestsIDBBindingUtilitiesTestcpp \
">branches/chromium/1312/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="brancheschromium1312SourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (132933 => \
132934)</h4> <pre class="diff"><span>
<span class="info">--- \
branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2012-10-30 \
19:01:10 UTC (rev 132933)
+++ branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2012-10-30 \
19:06:04 UTC (rev 132934) </span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx"> #include "IDBTracing.h"
</span><span class="cx"> #include "IDBTransaction.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><ins>+#if USE(V8)
+#include "V8Binding.h"
+#endif
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -76,6 +79,9 @@
</span><span class="cx"> , m_pendingCursor(0)
</span><span class="cx"> , m_didFireUpgradeNeededEvent(false)
</span><span class="cx"> , m_preventPropagation(false)
</span><ins>+#if USE(V8)
+ , m_worldContextHandle(UseCurrentWorld)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> if (m_transaction) {
</span><span class="cx"> m_transaction->registerRequest(this);
</span><span class="lines">@@ -284,6 +290,14 @@
</span><span class="cx"> if (!shouldEnqueueEvent())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+#if USE(V8)
+ v8::HandleScope handleScope;
+ v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), \
m_worldContextHandle); + if (context.IsEmpty())
+ CRASH();
+ v8::Context::Scope contextScope(context);
+#endif
+
</ins><span class="cx"> ScriptValue value = \
deserializeIDBValue(scriptExecutionContext(), serializedValue); </span><span \
class="cx"> ASSERT(m_cursorType != IDBCursorBackendInterface::InvalidCursorType); \
</span><span class="cx"> RefPtr<IDBCursor> cursor; </span><span \
class="lines">@@ -340,6 +354,14 @@ </span><span class="cx"> if \
(!shouldEnqueueEvent()) </span><span class="cx"> return;
</span><span class="cx">
</span><ins>+#if USE(V8)
+ v8::HandleScope handleScope;
+ v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), \
m_worldContextHandle); + if (context.IsEmpty())
+ CRASH();
+ v8::Context::Scope contextScope(context);
+#endif
+
</ins><span class="cx"> ScriptValue value = \
deserializeIDBValue(scriptExecutionContext(), serializedScriptValue); </span><span \
class="cx"> onSuccessInternal(value); </span><span class="cx"> }
</span><span class="lines">@@ -363,6 +385,14 @@
</span><span class="cx"> if (!shouldEnqueueEvent())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+#if USE(V8)
+ v8::HandleScope handleScope;
+ v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), \
m_worldContextHandle); + if (context.IsEmpty())
+ CRASH();
+ v8::Context::Scope contextScope(context);
+#endif
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> ASSERT(keyPath == \
effectiveObjectStore(m_source)->keyPath()); </span><span class="cx"> #endif
</span><span class="lines">@@ -404,6 +434,14 @@
</span><span class="cx"> if (!shouldEnqueueEvent())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+#if USE(V8)
+ v8::HandleScope handleScope;
+ v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), \
m_worldContextHandle); + if (context.IsEmpty())
+ CRASH();
+ v8::Context::Scope contextScope(context);
+#endif
+
</ins><span class="cx"> ScriptValue value = \
deserializeIDBValue(scriptExecutionContext(), serializedValue); </span><span \
class="cx"> ASSERT(m_pendingCursor); </span><span class="cx"> \
setResultCursor(m_pendingCursor.release(), key, primaryKey, value); </span><span \
class="lines">@@ -449,6 +487,15 @@ </span><span class="cx"> \
ASSERT(scriptExecutionContext()); </span><span class="cx"> \
ASSERT(event->target() == this); </span><span class="cx"> \
ASSERT_WITH_MESSAGE(m_readyState < DONE, "When dispatching event %s, \
m_readyState < DONE(%d), was %d", event->type().string().utf8().data(), \
DONE, m_readyState); </span><ins>+
+#if USE(V8)
+ v8::HandleScope handleScope;
+ v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), \
m_worldContextHandle); + if (context.IsEmpty())
+ CRASH();
+ v8::Context::Scope contextScope(context);
+#endif
+
</ins><span class="cx"> if (event->type() != eventNames().blockedEvent)
</span><span class="cx"> m_readyState = DONE;
</span><span class="cx">
</span></span></pre></div>
<a id="brancheschromium1312SourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.h (132933 => \
132934)</h4> <pre class="diff"><span>
<span class="info">--- \
branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.h 2012-10-30 \
19:01:10 UTC (rev 132933)
+++ branches/chromium/1312/Source/WebCore/Modules/indexeddb/IDBRequest.h 2012-10-30 \
19:06:04 UTC (rev 132934) </span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx"> #include "IDBCallbacks.h"
</span><span class="cx"> #include "IDBCursor.h"
</span><span class="cx"> #include "IDBCursorBackendInterface.h"
</span><ins>+#if USE(V8)
+#include "WorldContextHandle.h"
+#endif
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -155,6 +158,9 @@
</span><span class="cx"> bool m_preventPropagation;
</span><span class="cx">
</span><span class="cx"> EventTargetData m_eventTargetData;
</span><ins>+#if USE(V8)
+ WorldContextHandle m_worldContextHandle;
+#endif
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="brancheschromium1312SourceWebCorebindingsv8IDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp (132933 => \
132934)</h4> <pre class="diff"><span>
<span class="info">--- \
branches/chromium/1312/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp 2012-10-30 \
19:01:10 UTC (rev 132933)
+++ branches/chromium/1312/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp 2012-10-30 \
19:06:04 UTC (rev 132934) </span><span class="lines">@@ -179,10 +179,9 @@
</span><span class="cx"> IDBKeyPathParseError error;
</span><span class="cx"> IDBParseKeyPath(keyPath, keyPathElements, error);
</span><span class="cx"> ASSERT(error == IDBKeyPathParseErrorNone);
</span><ins>+ ASSERT(v8::Context::InContext());
</ins><span class="cx">
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext());
-
</del><span class="cx"> v8::Handle<v8::Value> v8Value(value.v8Value());
</span><span class="cx"> v8::Handle<v8::Value> \
v8Key(getNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size())); \
</span><span class="cx"> if (v8Key.IsEmpty()) </span><span class="lines">@@ \
-194,8 +193,10 @@ </span><span class="cx"> {
</span><span class="cx"> \
IDB_TRACE("createIDBKeyFromScriptValueAndKeyPath"); </span><span \
class="cx"> ASSERT(!keyPath.isNull()); </span><ins>+ \
ASSERT(v8::Context::InContext()); </ins><span class="cx">
</span><del>- v8::HandleScope scope;
</del><ins>+
+ v8::HandleScope handleScope;
</ins><span class="cx"> if (keyPath.type() == IDBKeyPath::ArrayType) {
</span><span class="cx"> IDBKey::KeyArray result;
</span><span class="cx"> const Vector<String>& array = \
keyPath.array(); </span><span class="lines">@@ -212,11 +213,10 @@
</span><span class="cx"> return createIDBKeyFromScriptValueAndKeyPath(value, \
keyPath.string()); </span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: The only reason this exists is because we need a v8::Context \
and scope inside a timer. Is there a better / more general way to do this? \
</del><span class="cx"> ScriptValue deserializeIDBValue(ScriptExecutionContext* \
scriptContext, PassRefPtr<SerializedScriptValue> prpValue) </span><span \
class="cx"> { </span><ins>+ ASSERT(v8::Context::InContext());
</ins><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope contextScope(toV8Context(scriptContext, \
UseCurrentWorld)); </del><span class="cx"> RefPtr<SerializedScriptValue> \
serializedValue = prpValue; </span><span class="cx"> if (serializedValue)
</span><span class="cx"> return \
ScriptValue(serializedValue->deserialize()); </span><span class="lines">@@ -226,6 \
+226,7 @@ </span><span class="cx"> bool \
injectIDBKeyIntoScriptValue(PassRefPtr<IDBKey> key, ScriptValue& value, \
const IDBKeyPath& keyPath) </span><span class="cx"> {
</span><span class="cx"> IDB_TRACE("injectIDBKeyIntoScriptValue");
</span><ins>+ ASSERT(v8::Context::InContext());
</ins><span class="cx">
</span><span class="cx"> ASSERT(keyPath.type() == IDBKeyPath::StringType);
</span><span class="cx"> Vector<String> keyPathElements;
</span><span class="lines">@@ -237,8 +238,6 @@
</span><span class="cx"> return 0;
</span><span class="cx">
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext());
-
</del><span class="cx"> v8::Handle<v8::Value> v8Value(value.v8Value());
</span><span class="cx"> v8::Handle<v8::Value> \
parent(ensureNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size() - \
1)); </span><span class="cx"> if (parent.IsEmpty())
</span><span class="lines">@@ -268,9 +267,8 @@
</span><span class="cx">
</span><span class="cx"> ScriptValue idbKeyToScriptValue(ScriptExecutionContext* \
scriptContext, PassRefPtr<IDBKey> key) </span><span class="cx"> {
</span><ins>+ ASSERT(v8::Context::InContext());
</ins><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope contextScope(toV8Context(scriptContext, \
UseCurrentWorld));
-
</del><span class="cx"> v8::Handle<v8::Value> v8Value(toV8(key.get()));
</span><span class="cx"> return ScriptValue(v8Value);
</span><span class="cx"> }
</span></span></pre></div>
<a id="brancheschromium1312SourceWebCorebindingsv8V8PerIsolateDatacpp"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.cpp (132933 => \
132934)</h4> <pre class="diff"><span>
<span class="info">--- \
branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.cpp 2012-10-30 \
19:01:10 UTC (rev 132933)
+++ branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.cpp 2012-10-30 \
19:06:04 UTC (rev 132934) </span><span class="lines">@@ -132,13 +132,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-v8::Handle<v8::Context> V8PerIsolateData::ensureAuxiliaryContext()
-{
- if (m_auxiliaryContext.isEmpty())
- m_auxiliaryContext.adopt(v8::Context::New());
- return m_auxiliaryContext.get();
-}
-
</del><span class="cx"> v8::Handle<v8::Value> \
V8PerIsolateData::constructorOfToString(const v8::Arguments& args) </span><span \
class="cx"> { </span><span class="cx"> // The DOM constructors' toString \
functions grab the current toString </span></span></pre></div>
<a id="brancheschromium1312SourceWebCorebindingsv8V8PerIsolateDatah"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.h (132933 => \
132934)</h4> <pre class="diff"><span>
<span class="info">--- \
branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.h 2012-10-30 \
19:01:10 UTC (rev 132933)
+++ branches/chromium/1312/Source/WebCore/bindings/v8/V8PerIsolateData.h 2012-10-30 \
19:06:04 UTC (rev 132934) </span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx"> DOMDataList& allStores() { return m_domDataList; }
</span><span class="cx">
</span><span class="cx"> V8HiddenPropertyName* hiddenPropertyName() { return \
m_hiddenPropertyName.get(); } </span><del>- v8::Handle<v8::Context> \
ensureAuxiliaryContext(); </del><span class="cx">
</span><span class="cx"> void registerDOMDataStore(DOMDataStore* domDataStore)
</span><span class="cx"> {
</span></span></pre></div>
<a id="brancheschromium1312SourceWebKitchromiumWebKitgyp"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebKit/chromium/WebKit.gyp (132933 => 132934)</h4> <pre \
class="diff"><span> <span class="info">--- \
branches/chromium/1312/Source/WebKit/chromium/WebKit.gyp 2012-10-30 19:01:10 UTC (rev \
132933)
+++ branches/chromium/1312/Source/WebKit/chromium/WebKit.gyp 2012-10-30 19:06:04 UTC \
(rev 132934) </span><span class="lines">@@ -710,6 +710,7 @@
</span><span class="cx"> \
'tests/AssociatedURLLoaderTest.cpp', </span><span class="cx"> \
'tests/EventListenerTest.cpp', </span><span class="cx"> \
'tests/FrameTestHelpers.cpp', </span><ins>+ \
'tests/IDBBindingUtilitiesTest.cpp', </ins><span class="cx"> \
'tests/LevelDBTest.cpp', </span><span class="cx"> \
'tests/ListenerLeakTest.cpp', </span><span class="cx"> \
'tests/LinkHighlightTest.cpp', </span></span></pre></div>
<a id="brancheschromium1312SourceWebKitchromiumtestsIDBBindingUtilitiesTestcpp"></a>
<div class="modfile"><h4>Modified: \
branches/chromium/1312/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp \
(132933 => 132934)</h4> <pre class="diff"><span>
<span class="info">--- \
branches/chromium/1312/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp 2012-10-30 \
19:01:10 UTC (rev 132933)
+++ branches/chromium/1312/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp 2012-10-30 \
19:06:04 UTC (rev 132934) </span><span class="lines">@@ -24,11 +24,19 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><ins>+#include "Document.h"
+#include "Frame.h"
+#include "FrameTestHelpers.h"
</ins><span class="cx"> #include "IDBBindingUtilities.h"
</span><span class="cx"> #include "IDBKey.h"
</span><span class="cx"> #include "IDBKeyPath.h"
</span><ins>+#include "V8Binding.h"
</ins><span class="cx"> #include "V8PerIsolateData.h"
</span><span class="cx"> #include "V8Utilities.h"
</span><ins>+#include "WebFrame.h"
+#include "WebFrameImpl.h"
+#include "WebView.h"
+#include "WorldContextHandle.h"
</ins><span class="cx">
</span><span class="cx"> #include <gtest/gtest.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -36,6 +44,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><ins>+using namespace WebKit;
</ins><span class="cx">
</span><span class="cx"> namespace {
</span><span class="cx">
</span><span class="lines">@@ -90,10 +99,21 @@
</span><span class="cx"> ASSERT_TRUE(expected == idbKey->number());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static v8::Handle<v8::Context> context()
+{
+ static WebView* webView;
+ if (!webView) {
+ webView = FrameTestHelpers::createWebViewAndLoad("about:blank");
+ webView->setFocus(true);
+ }
+ ScriptExecutionContext* context = \
static_cast<WebFrameImpl*>(webView->mainFrame())->frame()->document(); \
+ return toV8Context(context, WorldContextHandle(UseCurrentWorld)); +}
+
</ins><span class="cx"> TEST(IDBKeyFromValueAndKeyPathTest, \
TopLevelPropertyStringValue) </span><span class="cx"> {
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); </del><ins>+ \
v8::Context::Scope scope(context()); </ins><span class="cx">
</span><span class="cx"> v8::Local<v8::Object> object = v8::Object::New();
</span><span class="cx"> object->Set(v8::String::New("foo"), \
v8::String::New("zoo")); </span><span class="lines">@@ -107,7 +127,7 @@
</span><span class="cx"> TEST(IDBKeyFromValueAndKeyPathTest, \
TopLevelPropertyNumberValue) </span><span class="cx"> {
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); </del><ins>+ \
v8::Context::Scope scope(context()); </ins><span class="cx">
</span><span class="cx"> v8::Local<v8::Object> object = v8::Object::New();
</span><span class="cx"> object->Set(v8::String::New("foo"), \
v8::Number::New(456)); </span><span class="lines">@@ -121,7 +141,7 @@
</span><span class="cx"> TEST(IDBKeyFromValueAndKeyPathTest, SubProperty)
</span><span class="cx"> {
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); </del><ins>+ \
v8::Context::Scope scope(context()); </ins><span class="cx">
</span><span class="cx"> v8::Local<v8::Object> object = v8::Object::New();
</span><span class="cx"> v8::Local<v8::Object> subProperty = \
v8::Object::New(); </span><span class="lines">@@ -137,7 +157,7 @@
</span><span class="cx"> TEST(InjectIDBKeyTest, TopLevelPropertyStringValue)
</span><span class="cx"> {
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); </del><ins>+ \
v8::Context::Scope scope(context()); </ins><span class="cx">
</span><span class="cx"> v8::Local<v8::Object> object = v8::Object::New();
</span><span class="cx"> object->Set(v8::String::New("foo"), \
v8::String::New("zoo")); </span><span class="lines">@@ -152,7 +172,7 @@
</span><span class="cx"> TEST(InjectIDBKeyTest, SubProperty)
</span><span class="cx"> {
</span><span class="cx"> v8::HandleScope handleScope;
</span><del>- v8::Context::Scope \
scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); </del><ins>+ \
v8::Context::Scope scope(context()); </ins><span class="cx">
</span><span class="cx"> v8::Local<v8::Object> object = v8::Object::New();
</span><span class="cx"> v8::Local<v8::Object> subProperty = \
v8::Object::New(); </span></span></pre>
</div>
</div>
</body>
</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic