OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_DART_EMBEDDER_DART_DEBUGGER_H_ | 5 #ifndef SKY_ENGINE_CORE_SCRIPT_DART_DEBUGGER_H_ |
6 #define MOJO_DART_EMBEDDER_DART_DEBUGGER_H_ | 6 #define SKY_ENGINE_CORE_SCRIPT_DART_DEBUGGER_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <vector> |
7 | 10 |
8 #include "dart/runtime/include/dart_api.h" | 11 #include "dart/runtime/include/dart_api.h" |
9 #include "dart/runtime/include/dart_debugger_api.h" | 12 #include "dart/runtime/include/dart_debugger_api.h" |
10 #include "dart/runtime/include/dart_native_api.h" | 13 #include "dart/runtime/include/dart_native_api.h" |
11 #include "mojo/dart/embedder/monitor.h" | 14 #include "sky/engine/core/script/monitor.h" |
12 | 15 |
13 namespace base { | 16 namespace base { |
14 class Lock; | 17 class Lock; |
15 } | 18 } |
16 | 19 |
17 namespace mojo { | 20 namespace blink { |
18 namespace dart { | |
19 | 21 |
20 class DartDebuggerIsolate { | 22 class DartDebuggerIsolate { |
21 public: | 23 public: |
22 DartDebuggerIsolate(Dart_IsolateId id) | 24 DartDebuggerIsolate(Dart_IsolateId id) |
23 : id_(id) { | 25 : id_(id) { |
24 } | 26 } |
25 | 27 |
26 Dart_IsolateId id() const { | 28 Dart_IsolateId id() const { |
27 return id_; | 29 return id_; |
28 } | 30 } |
(...skipping 24 matching lines...) Expand all Loading... |
53 | 55 |
54 static void ExceptionThrownHandler(Dart_IsolateId isolate_id, | 56 static void ExceptionThrownHandler(Dart_IsolateId isolate_id, |
55 Dart_Handle exception, | 57 Dart_Handle exception, |
56 Dart_StackTrace stack_trace); | 58 Dart_StackTrace stack_trace); |
57 | 59 |
58 static void IsolateEventHandler(Dart_IsolateId isolate_id, | 60 static void IsolateEventHandler(Dart_IsolateId isolate_id, |
59 Dart_IsolateEvent kind); | 61 Dart_IsolateEvent kind); |
60 | 62 |
61 static void NotifyIsolate(Dart_Isolate isolate); | 63 static void NotifyIsolate(Dart_Isolate isolate); |
62 | 64 |
63 static DartDebuggerIsolate* FindIsolateById(Dart_IsolateId id); | 65 static intptr_t FindIsolateIndexById(Dart_IsolateId id); |
64 | 66 |
65 static DartDebuggerIsolate* FindIsolateByIdLocked(Dart_IsolateId id); | 67 static intptr_t FindIsolateIndexByIdLocked(Dart_IsolateId id); |
66 | 68 |
67 static DartDebuggerIsolate* AddIsolate(Dart_IsolateId id); | 69 static void AddIsolate(Dart_IsolateId id); |
68 | 70 |
69 static void RemoveIsolate(Dart_IsolateId id); | 71 static void RemoveIsolate(Dart_IsolateId id); |
70 | 72 |
71 static base::Lock* lock_; | 73 static base::Lock* lock_; |
72 static std::vector<DartDebuggerIsolate*> isolates_; | 74 static std::vector<std::unique_ptr<DartDebuggerIsolate>>* isolates_; |
73 | 75 |
74 friend class DartDebuggerIsolate; | 76 friend class DartDebuggerIsolate; |
75 }; | 77 }; |
76 | 78 |
77 } // namespace dart | 79 } // namespace blink |
78 } // namespace mojo | |
79 | 80 |
80 #endif // MOJO_DART_EMBEDDER_DART_DEBUGGER_H_ | 81 #endif // SKY_ENGINE_CORE_SCRIPT_DART_DEBUGGER_H_ |
OLD | NEW |