| Index: sky/engine/core/script/dart_debugger.cc
|
| diff --git a/mojo/dart/embedder/dart_debugger.cc b/sky/engine/core/script/dart_debugger.cc
|
| similarity index 88%
|
| copy from mojo/dart/embedder/dart_debugger.cc
|
| copy to sky/engine/core/script/dart_debugger.cc
|
| index 31e9ee4b5fb9a6534eccf618e5a56dd98842cd8c..310428fb79719ea2c9d0a776ad1b47568d2205cd 100644
|
| --- a/mojo/dart/embedder/dart_debugger.cc
|
| +++ b/sky/engine/core/script/dart_debugger.cc
|
| @@ -7,10 +7,9 @@
|
| #include "dart/runtime/include/dart_api.h"
|
| #include "dart/runtime/include/dart_debugger_api.h"
|
| #include "dart/runtime/include/dart_native_api.h"
|
| -#include "mojo/dart/embedder/dart_debugger.h"
|
| +#include "dart_debugger.h"
|
|
|
| -namespace mojo {
|
| -namespace dart {
|
| +namespace blink {
|
|
|
| void DartDebuggerIsolate::MessageLoop() {
|
| MonitorLocker ml(&monitor_);
|
| @@ -98,6 +97,7 @@ void DartDebugger::InitDebugger() {
|
| Dart_SetBreakpointResolvedHandler(BptResolvedHandler);
|
| Dart_SetExceptionThrownHandler(ExceptionThrownHandler);
|
| lock_ = new base::Lock();
|
| + isolates_ = new std::vector<DartDebuggerIsolate*>();
|
| }
|
|
|
| DartDebuggerIsolate* DartDebugger::FindIsolateById(Dart_IsolateId id) {
|
| @@ -108,8 +108,8 @@ DartDebuggerIsolate* DartDebugger::FindIsolateById(Dart_IsolateId id) {
|
| DartDebuggerIsolate* DartDebugger::FindIsolateByIdLocked(
|
| Dart_IsolateId id) {
|
| lock_->AssertAcquired();
|
| - for (size_t i = 0; i < isolates_.size(); i++) {
|
| - DartDebuggerIsolate* isolate = isolates_[i];
|
| + for (size_t i = 0; i < isolates_->size(); i++) {
|
| + DartDebuggerIsolate* isolate = (*isolates_)[i];
|
| if (id == isolate->id()) {
|
| return isolate;
|
| }
|
| @@ -122,16 +122,17 @@ DartDebuggerIsolate* DartDebugger::AddIsolate(Dart_IsolateId id) {
|
| CHECK(FindIsolateByIdLocked(id) == nullptr);
|
| DartDebuggerIsolate* debugger_isolate =
|
| new DartDebuggerIsolate(id);
|
| - isolates_.push_back(debugger_isolate);
|
| + isolates_->push_back(debugger_isolate);
|
| return debugger_isolate;
|
| }
|
|
|
| void DartDebugger::RemoveIsolate(Dart_IsolateId id) {
|
| base::AutoLock al(*lock_);
|
| - for (size_t i = 0; i < isolates_.size(); i++) {
|
| - DartDebuggerIsolate* isolate = isolates_[i];
|
| + for (size_t i = 0; i < isolates_->size(); i++) {
|
| + DartDebuggerIsolate* isolate = (*isolates_)[i];
|
| if (id == isolate->id()) {
|
| - isolates_.erase(isolates_.begin() + i);
|
| + isolates_->erase(isolates_->begin() + i);
|
| + delete isolate;
|
| return;
|
| }
|
| }
|
| @@ -139,7 +140,6 @@ void DartDebugger::RemoveIsolate(Dart_IsolateId id) {
|
| }
|
|
|
| base::Lock* DartDebugger::lock_ = nullptr;
|
| -std::vector<DartDebuggerIsolate*> DartDebugger::isolates_;
|
| +std::vector<DartDebuggerIsolate*>* DartDebugger::isolates_ = nullptr;
|
|
|
| -} // namespace apps
|
| -} // namespace mojo
|
| +} // namespace blink
|
|
|