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

Unified Diff: src/isolate.cc

Issue 2606093002: [promises] Refactor debug code (Closed)
Patch Set: fix stuff Created 3 years, 12 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/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..422bf6843860e0b9200e3407ba955511ce0b55b7 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -3258,31 +3258,27 @@ 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 != kDebugPromiseNoID && name_ != kDebugNotActive) {
if (is_debug_active_) {
- isolate_->debug()->OnAsyncTaskEvent(
- isolate_->factory()->will_handle_string(), id_,
- Handle<String>::cast(name_));
+ isolate_->debug()->OnAsyncTaskEvent(kDebugWillHandle, id_, name_);
}
}
~PromiseDebugEventScope() {
if (is_debug_active_) {
- isolate_->debug()->OnAsyncTaskEvent(
- isolate_->factory()->did_handle_string(), id_,
- Handle<String>::cast(name_));
+ isolate_->debug()->OnAsyncTaskEvent(kDebugDidHandle, id_, name_);
}
}
private:
Isolate* isolate_;
- Handle<Object> id_;
- Handle<Object> name_;
+ int id_;
+ PromiseDebugActionName name_;
bool is_debug_active_;
};
} // namespace
« no previous file with comments | « src/isolate.h ('k') | src/js/async-await.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698