Chromium Code Reviews| Index: src/isolate.cc |
| diff --git a/src/isolate.cc b/src/isolate.cc |
| index a68cc397a2c81dd780b689864142a538710da512..0c0af8472a75f3067d63c17f662b2639d78edd85 100644 |
| --- a/src/isolate.cc |
| +++ b/src/isolate.cc |
| @@ -3264,35 +3264,29 @@ void Isolate::ReportPromiseReject(Handle<JSObject> promise, |
| namespace { |
| class PromiseDebugEventScope { |
| public: |
| - PromiseDebugEventScope(Isolate* isolate, int id, int name) |
| - : isolate_(isolate), |
| - id_(id), |
| - name_(static_cast<PromiseDebugActionName>(name)), |
| - is_debug_active_(isolate_->debug()->is_active() && |
| - id != kDebugPromiseNoID && name_ != kDebugNotActive) { |
| - if (is_debug_active_) { |
| - isolate_->debug()->OnAsyncTaskEvent(debug::kDebugWillHandle, id_, name_); |
| + PromiseDebugEventScope(Isolate* isolate, int id) |
| + : isolate_(isolate), id_(id) { |
| + if (isolate_->debug()->is_active() && id_ != kDebugPromiseNoID) { |
| + isolate_->debug()->OnAsyncTaskEvent(debug::kDebugWillHandle, id_); |
| } |
| } |
| ~PromiseDebugEventScope() { |
| - if (is_debug_active_) { |
| - isolate_->debug()->OnAsyncTaskEvent(debug::kDebugDidHandle, id_, name_); |
| + if (isolate_->debug()->is_active() && id_ != kDebugPromiseNoID) { |
|
jgruber
2017/01/13 17:29:06
Not 100% sure this change is valid. What if is_act
kozy
2017/01/13 17:42:13
Inspector is ready for "invalid" events. And we ca
|
| + isolate_->debug()->OnAsyncTaskEvent(debug::kDebugDidHandle, id_); |
| } |
| } |
| private: |
| Isolate* isolate_; |
| int id_; |
| - PromiseDebugActionName name_; |
| - bool is_debug_active_; |
|
gsathya
2017/01/13 17:23:40
This is going to cause a mismatch if debugger is o
kozy
2017/01/13 17:42:13
If debugger is opened after kDebugWillHandle then
gsathya
2017/01/13 18:20:35
sgtm if inspector will filter it out, i was mostly
|
| }; |
| } // namespace |
| void Isolate::PromiseReactionJob(Handle<PromiseReactionJobInfo> info, |
| MaybeHandle<Object>* result, |
| MaybeHandle<Object>* maybe_exception) { |
| - PromiseDebugEventScope helper(this, info->debug_id(), info->debug_name()); |
| + PromiseDebugEventScope helper(this, info->debug_id()); |
| Handle<Object> value(info->value(), this); |
| Handle<Object> tasks(info->tasks(), this); |
| @@ -3333,7 +3327,7 @@ void Isolate::PromiseReactionJob(Handle<PromiseReactionJobInfo> info, |
| void Isolate::PromiseResolveThenableJob( |
| Handle<PromiseResolveThenableJobInfo> info, MaybeHandle<Object>* result, |
| MaybeHandle<Object>* maybe_exception) { |
| - PromiseDebugEventScope helper(this, info->debug_id(), info->debug_name()); |
| + PromiseDebugEventScope helper(this, info->debug_id()); |
| Handle<JSReceiver> thenable(info->thenable(), this); |
| Handle<JSFunction> resolve(info->resolve(), this); |