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

Unified Diff: Source/bindings/dart/custom/DartInjectedScriptHostCustom.cpp

Issue 300393002: Merge DevTools Refactor CL to Blink36 (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
Patch Set: PTAL Created 6 years, 6 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/dart/DartUtilities.cpp ('k') | Source/bindings/dart/gyp/overrides.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/custom/DartInjectedScriptHostCustom.cpp
diff --git a/Source/bindings/dart/custom/DartInjectedScriptHostCustom.cpp b/Source/bindings/dart/custom/DartInjectedScriptHostCustom.cpp
index fc6441ee8df5fbcf956db7a318a965f7148179f9..054d718db78b4e8043bb5b8add01d50db480b130 100644
--- a/Source/bindings/dart/custom/DartInjectedScriptHostCustom.cpp
+++ b/Source/bindings/dart/custom/DartInjectedScriptHostCustom.cpp
@@ -28,17 +28,62 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "config.h"
-
#include "DartInjectedScriptHost.h"
+#include "DartNode.h"
+
+#include "bindings/dart/DartDOMWrapper.h"
+#include "bindings/dart/DartHandleProxy.h"
+#include "bindings/dart/DartInjectedScript.h"
+#include "bindings/dart/V8Converter.h"
+#include "core/events/EventTarget.h"
+#include "core/frame/DOMWindow.h"
+#include "core/inspector/InjectedScript.h"
+#include "core/inspector/InjectedScriptHost.h"
+#include "core/inspector/InspectorDOMAgent.h"
+#include "modules/webdatabase/Database.h"
+#include "platform/JSONValues.h"
+
namespace WebCore {
namespace DartInjectedScriptHostInternal {
void inspectCallback(Dart_NativeArguments args)
{
- // FIXME: proper implementation.
- DART_UNIMPLEMENTED();
+ Dart_Handle exception = 0;
+ {
+ InjectedScriptHost* receiver = DartDOMWrapper::receiver< InjectedScriptHost >(args);
+ Dart_Handle receiverHandle = Dart_GetNativeArgument(args, 0);
+ ASSERT(!Dart_IsError(receiverHandle));
+ DartInjectedScript* injectedScript = 0;
+ // FIXME: this is a hack. For convenience we store the
+ // DartInjectedScript as the Dart_Peer of the InjectedScriptHost object
+ // and use it to generate JSON from the Dart_Handle. This differs from
+ // the behavior of V8InjectedScriptHost which assumes the argument
+ // passed as an argument is already JSON. To handle things in the same
+ // way as JavaScript we would need to generate a DartInjectedScript
+ // Dart class. I have put off implementing the correct solution as the
+ // way native binding classes are done for Dartium is in flux at the
+ // moment.
+ Dart_Handle ALLOW_UNUSED result = Dart_GetPeer(receiverHandle, reinterpret_cast<void**>(&injectedScript));
+ if (Dart_IsError(result)) {
+ exception = result;
+ goto fail;
+ }
+ ASSERT(injectedScript);
+ Dart_Handle object = Dart_GetNativeArgument(args, 1);
+ // FIXME: read in the hint argument as well.
+ ASSERT(!Dart_IsError(object));
+ receiver->inspectImpl(injectedScript->wrapDartObject(object, "", false),
+ JSONObject::create());
+
+ if (exception)
+ goto fail;
+ return;
+ }
+
+fail:
+ Dart_ThrowException(exception);
}
void inspectedObjectCallback(Dart_NativeArguments args)
@@ -127,4 +172,4 @@ void setFunctionVariableValueCallback(Dart_NativeArguments args)
}
-}
+} // namespace WebCore
« no previous file with comments | « Source/bindings/dart/DartUtilities.cpp ('k') | Source/bindings/dart/gyp/overrides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698