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

Unified Diff: src/isolate.cc

Issue 2628173005: [inspector] merged type and name of async task event (Closed)
Patch Set: addressed comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/inspector/v8-debugger.cc ('k') | src/js/macros.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
+ isolate_->debug()->OnAsyncTaskEvent(debug::kDebugDidHandle, id_);
}
}
private:
Isolate* isolate_;
int id_;
- PromiseDebugActionName name_;
- bool is_debug_active_;
};
} // 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);
« no previous file with comments | « src/inspector/v8-debugger.cc ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698