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

Unified Diff: src/inspector/v8-debugger.cc

Issue 2592893003: [inspector] migrate AsycEvent to tupple (Closed)
Patch Set: 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
« no previous file with comments | « src/debug/debug-interface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index 88b609b127dfd8ff037ba7037f309d57db672200..0980cd7d1f0b2f46d1b88fd6f8710772cc0fc922 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -594,22 +594,18 @@ void V8Debugger::handleV8DebugEvent(
void V8Debugger::handleV8AsyncTaskEvent(v8::Local<v8::Object> eventData) {
if (!m_maxAsyncCallStackDepth) return;
- v8::debug::AsyncTaskEventType type =
- static_cast<v8::debug::AsyncTaskEventType>(
- callInternalGetterFunction(eventData, "type")
- ->ToInteger(m_isolate->GetCurrentContext())
- .ToLocalChecked()
- ->Value());
- String16 name = toProtocolStringWithTypeCheck(
- callInternalGetterFunction(eventData, "name"));
- int id = static_cast<int>(callInternalGetterFunction(eventData, "id")
- ->ToInteger(m_isolate->GetCurrentContext())
- .ToLocalChecked()
- ->Value());
+ v8::Local<v8::debug::AsyncTaskEventData> data(
+ v8::Local<v8::debug::AsyncTaskEventData>::Cast(eventData));
+
+ v8::debug::AsyncTaskEventType type = data->type();
+ String16 name;
+ v8::Local<v8::String> nameValue;
+ if (data->name().ToLocal(&nameValue))
+ name = toProtocolStringWithTypeCheck(nameValue);
// Async task events from Promises are given misaligned pointers to prevent
// from overlapping with other Blink task identifiers. There is a single
// namespace of such ids, managed by src/js/promise.js.
- void* ptr = reinterpret_cast<void*>(id * 2 + 1);
+ void* ptr = reinterpret_cast<void*>(data->id() * 2 + 1);
if (type == v8::debug::EnqueueRecurring)
asyncTaskScheduled(name, ptr, true);
else if (type == v8::debug::WillHandle)
« no previous file with comments | « src/debug/debug-interface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698