OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 #include "src/debug/debug.h" | 5 #include "src/debug/debug.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 Handle<Object> data) { | 2038 Handle<Object> data) { |
2039 GlobalHandles* global_handles = isolate_->global_handles(); | 2039 GlobalHandles* global_handles = isolate_->global_handles(); |
2040 | 2040 |
2041 // Remove existing entry. | 2041 // Remove existing entry. |
2042 GlobalHandles::Destroy(event_listener_.location()); | 2042 GlobalHandles::Destroy(event_listener_.location()); |
2043 event_listener_ = Handle<Object>(); | 2043 event_listener_ = Handle<Object>(); |
2044 GlobalHandles::Destroy(event_listener_data_.location()); | 2044 GlobalHandles::Destroy(event_listener_data_.location()); |
2045 event_listener_data_ = Handle<Object>(); | 2045 event_listener_data_ = Handle<Object>(); |
2046 | 2046 |
2047 // Set new entry. | 2047 // Set new entry. |
2048 if (!callback->IsUndefined(isolate_) && !callback->IsNull(isolate_)) { | 2048 if (!callback->IsNullOrUndefined(isolate_)) { |
2049 event_listener_ = global_handles->Create(*callback); | 2049 event_listener_ = global_handles->Create(*callback); |
2050 if (data.is_null()) data = isolate_->factory()->undefined_value(); | 2050 if (data.is_null()) data = isolate_->factory()->undefined_value(); |
2051 event_listener_data_ = global_handles->Create(*data); | 2051 event_listener_data_ = global_handles->Create(*data); |
2052 } | 2052 } |
2053 | 2053 |
2054 UpdateState(); | 2054 UpdateState(); |
2055 } | 2055 } |
2056 | 2056 |
2057 void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { | 2057 void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { |
2058 message_handler_ = handler; | 2058 message_handler_ = handler; |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2496 logger_->DebugEvent("Put", message.text()); | 2496 logger_->DebugEvent("Put", message.text()); |
2497 } | 2497 } |
2498 | 2498 |
2499 void LockingCommandMessageQueue::Clear() { | 2499 void LockingCommandMessageQueue::Clear() { |
2500 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2500 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2501 queue_.Clear(); | 2501 queue_.Clear(); |
2502 } | 2502 } |
2503 | 2503 |
2504 } // namespace internal | 2504 } // namespace internal |
2505 } // namespace v8 | 2505 } // namespace v8 |
OLD | NEW |