| 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/isolate.h" | 5 #include "src/isolate.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3193 namespace { | 3193 namespace { |
| 3194 class PromiseDebugEventScope { | 3194 class PromiseDebugEventScope { |
| 3195 public: | 3195 public: |
| 3196 PromiseDebugEventScope(Isolate* isolate, Object* id, Object* name) | 3196 PromiseDebugEventScope(Isolate* isolate, Object* id, Object* name) |
| 3197 : isolate_(isolate), | 3197 : isolate_(isolate), |
| 3198 id_(id, isolate_), | 3198 id_(id, isolate_), |
| 3199 name_(name, isolate_), | 3199 name_(name, isolate_), |
| 3200 is_debug_active_(isolate_->debug()->is_active() && id_->IsNumber() && | 3200 is_debug_active_(isolate_->debug()->is_active() && id_->IsNumber() && |
| 3201 name_->IsString()) { | 3201 name_->IsString()) { |
| 3202 if (is_debug_active_) { | 3202 if (is_debug_active_) { |
| 3203 isolate_->debug()->OnAsyncTaskEvent( | 3203 isolate_->debug()->OnAsyncTaskEvent(debug::WillHandle, id_, |
| 3204 isolate_->factory()->will_handle_string(), id_, | 3204 Handle<String>::cast(name_)); |
| 3205 Handle<String>::cast(name_)); | |
| 3206 } | 3205 } |
| 3207 } | 3206 } |
| 3208 | 3207 |
| 3209 ~PromiseDebugEventScope() { | 3208 ~PromiseDebugEventScope() { |
| 3210 if (is_debug_active_) { | 3209 if (is_debug_active_) { |
| 3211 isolate_->debug()->OnAsyncTaskEvent( | 3210 isolate_->debug()->OnAsyncTaskEvent(debug::DidHandle, id_, |
| 3212 isolate_->factory()->did_handle_string(), id_, | 3211 Handle<String>::cast(name_)); |
| 3213 Handle<String>::cast(name_)); | |
| 3214 } | 3212 } |
| 3215 } | 3213 } |
| 3216 | 3214 |
| 3217 private: | 3215 private: |
| 3218 Isolate* isolate_; | 3216 Isolate* isolate_; |
| 3219 Handle<Object> id_; | 3217 Handle<Object> id_; |
| 3220 Handle<Object> name_; | 3218 Handle<Object> name_; |
| 3221 bool is_debug_active_; | 3219 bool is_debug_active_; |
| 3222 }; | 3220 }; |
| 3223 } // namespace | 3221 } // namespace |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3567 // Then check whether this scope intercepts. | 3565 // Then check whether this scope intercepts. |
| 3568 if ((flag & intercept_mask_)) { | 3566 if ((flag & intercept_mask_)) { |
| 3569 intercepted_flags_ |= flag; | 3567 intercepted_flags_ |= flag; |
| 3570 return true; | 3568 return true; |
| 3571 } | 3569 } |
| 3572 return false; | 3570 return false; |
| 3573 } | 3571 } |
| 3574 | 3572 |
| 3575 } // namespace internal | 3573 } // namespace internal |
| 3576 } // namespace v8 | 3574 } // namespace v8 |
| OLD | NEW |