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

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

Issue 1663753002: Apply all blink changes between @202695 and tip of trunk (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 years, 11 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/bindings/core/dart/DartJsInterop.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 1114532c3bcb94beee9f9c13e2db9e75635de9ad..a4456555b829bd83e8b6d4050654c70991aa0616 100644
--- a/Source/bindings/core/dart/DartInjectedScript.cpp
+++ b/Source/bindings/core/dart/DartInjectedScript.cpp
@@ -40,6 +40,7 @@
#include "bindings/core/dart/DartUtilities.h"
#include "bindings/core/dart/V8Converter.h"
#include "bindings/core/v8/ScriptFunctionCall.h"
+#include "bindings/core/v8/V8InjectedScriptHost.h"
#include "core/inspector/InjectedScriptHost.h"
#include "core/inspector/JSONParser.h"
#include "platform/JSONValues.h"
@@ -269,21 +270,25 @@ DartInjectedScript::~DartInjectedScript()
Dart_DeletePersistentHandle(m_consoleApi);
}
+// Copied from V8injectedScriptManager.
+v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(PassRefPtrWillBeRawPtr<InjectedScriptHost> host, InjectedScriptManager* injectedScriptManager, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8DOMWrapper::createWrapper(creationContext, &V8InjectedScriptHost::wrapperTypeInfo,
+ host->toScriptWrappableBase(), isolate);
+}
+
Dart_Handle DartInjectedScript::consoleApi()
{
-/* TODO(terry): Need to re-enable when we figure out how to do:
- *
- * Dart_Handle host = DartInjectedScriptHost::toDart(m_host);
- */
-#if 0
if (!m_consoleApi) {
- Dart_Handle host = DartInjectedScriptHost::toDart(m_host);
+ V8Scope v8scope(DartDOMData::current());
+ v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(m_host, m_injectedScriptManager, m_scriptState->v8ScriptState()->context()->Global(), v8::Isolate::GetCurrent());
+
+ Dart_Handle host = JsInterop::toDart(scriptHostWrapper, false);
Dart_SetPeer(host, this);
Dart_Handle consoleApi = DartUtilities::invokeUtilsMethod("consoleApi", 1, &host);
ASSERT(!Dart_IsError(consoleApi));
m_consoleApi = Dart_NewPersistentHandle(consoleApi);
}
-#endif
return m_consoleApi;
}
@@ -1200,6 +1205,8 @@ void DartInjectedScript::getProperty(ErrorString* errorString, const String& obj
Node* DartInjectedScript::nodeForObjectId(const String& objectId)
{
DartIsolateScope scope(m_scriptState->isolate());
+ DartDOMData* domData = DartDOMData::current();
+ V8Scope v8scope(domData);
DartApiScope apiScope;
DartDebuggerObject* object = lookupObject(objectId);
« no previous file with comments | « Source/bindings/core/dart/DartHandleProxy.cpp ('k') | Source/bindings/core/dart/DartJsInterop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698