| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "bindings/v8/ScriptSourceCode.h" | 35 #include "bindings/v8/ScriptSourceCode.h" |
| 36 | 36 |
| 37 #include <dart_api.h> | 37 #include <dart_api.h> |
| 38 #include <dart_debugger_api.h> | 38 #include <dart_debugger_api.h> |
| 39 #include <dart_mirrors_api.h> | 39 #include <dart_mirrors_api.h> |
| 40 #include <v8.h> | 40 #include <v8.h> |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 class Node; | 44 class Node; |
| 45 class DartScriptValue; | 45 class DartPersistentValue; |
| 46 | 46 |
| 47 class DartHandleProxy { | 47 class DartHandleProxy { |
| 48 public: | 48 public: |
| 49 static v8::Handle<v8::Value> create(Dart_Handle value); | 49 static v8::Handle<v8::Value> create(Dart_Handle value); |
| 50 static v8::Handle<v8::Value> createTypeProxy(Dart_Handle value, bool showSta
tics); | 50 static v8::Handle<v8::Value> createTypeProxy(Dart_Handle value, bool showSta
tics); |
| 51 static v8::Handle<v8::Value> createLibraryProxy(Dart_Handle value, intptr_t
libraryId, Dart_Handle prefix, bool asGlobal); | 51 static v8::Handle<v8::Value> createLibraryProxy(Dart_Handle value, intptr_t
libraryId, Dart_Handle prefix, bool asGlobal); |
| 52 static v8::Handle<v8::Value> createLocalScopeProxy(Dart_Handle localVariable
s); | 52 static v8::Handle<v8::Value> createLocalScopeProxy(Dart_Handle localVariable
s); |
| 53 static v8::Handle<v8::Value> evaluate(Dart_Handle target, Dart_Handle expres
sion, Dart_Handle localVariables); | 53 static v8::Handle<v8::Value> evaluate(Dart_Handle target, Dart_Handle expres
sion, Dart_Handle localVariables); |
| 54 | 54 |
| 55 static bool isDartProxy(v8::Handle<v8::Value>); | 55 static bool isDartProxy(v8::Handle<v8::Value>); |
| 56 static const char* getJavaScriptType(v8::Handle<v8::Value>); | 56 static const char* getJavaScriptType(v8::Handle<v8::Value>); |
| 57 static Node* toNativeNode(v8::Handle<v8::Value>); | 57 static Node* toNativeNode(v8::Handle<v8::Value>); |
| 58 static Dart_Handle unwrapValue(v8::Handle<v8::Value>); | 58 static Dart_Handle unwrapValue(v8::Handle<v8::Value>); |
| 59 | 59 |
| 60 static DartScriptValue* readPointerFromProxy(v8::Handle<v8::Value>); | 60 static DartPersistentValue* readPointerFromProxy(v8::Handle<v8::Value>); |
| 61 static void writePointerToProxy(v8::Local<v8::Object> proxy, Dart_Handle); | 61 static void writePointerToProxy(v8::Local<v8::Object> proxy, Dart_Handle); |
| 62 | 62 |
| 63 struct CallbackData; | 63 struct CallbackData; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Helper class to manage all scopes that must be entered to safely invoke Dart | 67 * Helper class to manage all scopes that must be entered to safely invoke Dart |
| 68 * code. | 68 * code. |
| 69 */ | 69 */ |
| 70 class DartScopes { | 70 class DartScopes { |
| 71 private: | 71 private: |
| 72 DartScriptValue* scriptValue; | 72 DartPersistentValue* scriptValue; |
| 73 DartIsolateScope scope; | 73 DartIsolateScope scope; |
| 74 DartApiScope apiScope; | 74 DartApiScope apiScope; |
| 75 Dart_ExceptionPauseInfo previousPauseInfo; | 75 Dart_ExceptionPauseInfo previousPauseInfo; |
| 76 bool disableBreak; | 76 bool disableBreak; |
| 77 | 77 |
| 78 public: | 78 public: |
| 79 Dart_PersistentHandle handle; | 79 Dart_PersistentHandle handle; |
| 80 | 80 |
| 81 DartScopes(v8::Local<v8::Object> v8Handle, bool disableBreak = false); | 81 DartScopes(v8::Local<v8::Object> v8Handle, bool disableBreak = false); |
| 82 ~DartScopes(); | 82 ~DartScopes(); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } | 85 } |
| 86 | 86 |
| 87 #endif // DartHandleProxy_h | 87 #endif // DartHandleProxy_h |
| OLD | NEW |