Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: Source/bindings/core/dart/DartInjectedScript.cpp

Issue 1689873002: Enable inspector tests disabled when dart:html was switched to JS interop. (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/dart/DartHandleProxy.cpp ('k') | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/dart/DartInjectedScript.cpp
diff --git a/Source/bindings/core/dart/DartInjectedScript.cpp b/Source/bindings/core/dart/DartInjectedScript.cpp
index 1bd0cf294146a7c75b9cf3213dc9c5c5e111adc3..b5a1648b301686c52394618f69439964d25f1752 100644
--- a/Source/bindings/core/dart/DartInjectedScript.cpp
+++ b/Source/bindings/core/dart/DartInjectedScript.cpp
@@ -271,30 +271,12 @@ DartInjectedScript::~DartInjectedScript()
Dart_DeletePersistentHandle(m_consoleApi);
}
-// Copied from V8injectedScriptManager.
-v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(PassRefPtrWillBeRawPtr<InjectedScriptHost> host, InjectedScriptManager* injectedScriptManager, v8::Handle<v8::Context> creationContext, v8::Isolate* isolate)
-{
- // TODO(jacobr): is this correct.
- v8::Local<v8::FunctionTemplate> wrapperTemplate = host->wrapperTemplate(isolate);
- ASSERT(!wrapperTemplate.IsEmpty());
- if (wrapperTemplate.IsEmpty()) {
- // Hopefully this isn't needed.
- wrapperTemplate = V8InjectedScriptHost::createWrapperTemplate(isolate);
- host->setWrapperTemplate(wrapperTemplate, isolate);
- }
-
- return V8InjectedScriptHost::wrap(wrapperTemplate, creationContext, host);
-}
-
Dart_Handle DartInjectedScript::consoleApi()
{
if (!m_consoleApi) {
V8Scope v8scope(DartDOMData::current());
- v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(m_host, m_injectedScriptManager, m_scriptState->v8ScriptState()->context(), v8::Isolate::GetCurrent());
-
- Dart_Handle host = JsInterop::toDart(scriptHostWrapper, false);
- Dart_SetPeer(host, this);
- Dart_Handle consoleApi = DartUtilities::invokeUtilsMethod("consoleApi", 1, &host);
+ Dart_Handle injecteScriptV8 = JsInterop::toDart(m_injectedScriptManager->injectedScriptFor(m_scriptState->v8ScriptState()).injectedScriptObject().v8Value(), false);
+ Dart_Handle consoleApi = DartUtilities::invokeUtilsMethod("consoleApi", 1, &injecteScriptV8);
ASSERT(!Dart_IsError(consoleApi));
m_consoleApi = Dart_NewPersistentHandle(consoleApi);
}
@@ -326,9 +308,9 @@ Dart_Handle DartInjectedScript::evaluateHelper(Dart_Handle target, const String&
v8::Handle<v8::Value> v8Value = value.v8Value();
if (v8Value.IsEmpty())
break;
- Dart_Handle dartValue = DartHandleProxy::unwrapValue(v8Value);
+ Dart_Handle dartValue = JsInterop::toDart(v8Value, true);
ASSERT(!Dart_IsError(dartValue));
- if (Dart_IsNull(dartValue))
+ if (Dart_IsError(dartValue) || Dart_IsNull(dartValue))
continue;
locals.append(DartUtilities::stringToDartString(String::format("$%d", i)));
locals.append(dartValue);
« no previous file with comments | « Source/bindings/core/dart/DartHandleProxy.cpp ('k') | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698