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

Unified Diff: src/isolate.cc

Issue 2606093002: [promises] Refactor debug code (Closed)
Patch Set: fmt Created 4 years 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
« src/debug/debug.h ('K') | « src/isolate.h ('k') | src/js/async-await.js » ('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 4e5a7c8fd983d2dfb3c710024ff32c5b63e34baf..97d093efa6bd5a24281a5375e48cbc23853e8415 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -3258,31 +3258,28 @@ void Isolate::ReportPromiseReject(Handle<JSObject> promise,
namespace {
class PromiseDebugEventScope {
public:
- PromiseDebugEventScope(Isolate* isolate, Object* id, Object* name)
+ PromiseDebugEventScope(Isolate* isolate, int id, int name)
: isolate_(isolate),
- id_(id, isolate_),
- name_(name, isolate_),
- is_debug_active_(isolate_->debug()->is_active() && id_->IsNumber() &&
- name_->IsString()) {
+ id_(id),
+ name_(static_cast<PromiseDebugActionName>(name)),
+ is_debug_active_(isolate_->debug()->is_active() &&
+ id != DEBUG_PROMISE_DEFAULT_ID &&
+ name_ != DEBUG_NOT_ACTIVE) {
if (is_debug_active_) {
- isolate_->debug()->OnAsyncTaskEvent(
- isolate_->factory()->will_handle_string(), id_,
- Handle<String>::cast(name_));
+ isolate_->debug()->OnAsyncTaskEvent(DEBUG_WILL_HANDLE, id_, name_);
}
}
~PromiseDebugEventScope() {
if (is_debug_active_) {
- isolate_->debug()->OnAsyncTaskEvent(
- isolate_->factory()->did_handle_string(), id_,
- Handle<String>::cast(name_));
+ isolate_->debug()->OnAsyncTaskEvent(DEBUG_DID_HANDLE, id_, name_);
}
}
private:
Isolate* isolate_;
- Handle<Object> id_;
- Handle<Object> name_;
+ int id_;
+ PromiseDebugActionName name_;
bool is_debug_active_;
};
} // namespace
« src/debug/debug.h ('K') | « src/isolate.h ('k') | src/js/async-await.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698