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

Side by Side Diff: src/debug/debug.cc

Issue 2601503002: Add Object::IsNullOrUndefined(Isolate*) helper method (Closed)
Patch Set: fixing merge conflicts Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698