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

Unified Diff: Source/bindings/core/v8/V8Initializer.cpp

Issue 1090583005: Revert of DevTools: [console] Logged promise rejections do not change state once handled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Encompass Oilpan fix Created 5 years, 8 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 | « Source/bindings/core/v8/RejectedPromises.cpp ('k') | Source/core/frame/ConsoleTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Initializer.cpp
diff --git a/Source/bindings/core/v8/V8Initializer.cpp b/Source/bindings/core/v8/V8Initializer.cpp
index 1f855ff7bbeab807055122aa96c39110c89ade78..85c6490a218cf15bbced8933c3c327681a7312d7 100644
--- a/Source/bindings/core/v8/V8Initializer.cpp
+++ b/Source/bindings/core/v8/V8Initializer.cpp
@@ -203,13 +203,8 @@ void V8Initializer::reportRejectedPromisesOnMainThread()
static void promiseRejectHandlerInMainThread(v8::PromiseRejectMessage data)
{
ASSERT(isMainThread());
- if (data.GetEvent() == v8::kPromiseHandlerAddedAfterReject) {
- rejectedPromisesOnMainThread().handlerAdded(data);
+ if (data.GetEvent() != v8::kPromiseRejectWithNoHandler)
return;
- }
-
- ASSERT(data.GetEvent() == v8::kPromiseRejectWithNoHandler);
-
v8::Handle<v8::Promise> promise = data.GetPromise();
v8::Isolate* isolate = promise->GetIsolate();
@@ -254,11 +249,14 @@ static void promiseRejectHandlerInMainThread(v8::PromiseRejectMessage data)
errorMessage = "Uncaught " + messageForConsole;
ScriptState* scriptState = ScriptState::current(isolate);
- rejectedPromisesOnMainThread().rejectedWithNoHandler(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, callStack);
+ rejectedPromisesOnMainThread().add(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, callStack);
}
static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data)
{
+ if (data.GetEvent() != v8::kPromiseRejectWithNoHandler)
+ return;
+
v8::Handle<v8::Promise> promise = data.GetPromise();
// Bail out if called during context initialization.
@@ -275,13 +273,6 @@ static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data)
WorkerScriptController* scriptController = toWorkerGlobalScope(executionContext)->script();
ASSERT(scriptController);
- if (data.GetEvent() == v8::kPromiseHandlerAddedAfterReject) {
- scriptController->rejectedPromises()->handlerAdded(data);
- return;
- }
-
- ASSERT(data.GetEvent() == v8::kPromiseRejectWithNoHandler);
-
int scriptId = 0;
int lineNumber = 0;
int columnNumber = 0;
@@ -298,7 +289,7 @@ static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data)
// message->Get() can be empty here. https://crbug.com/450330
errorMessage = toCoreStringWithNullCheck(message->Get());
}
- scriptController->rejectedPromises()->rejectedWithNoHandler(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, nullptr);
+ scriptController->rejectedPromises()->add(scriptState, data, errorMessage, resourceName, scriptId, lineNumber, columnNumber, nullptr);
}
static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8::AccessType type, v8::Local<v8::Value> data)
« no previous file with comments | « Source/bindings/core/v8/RejectedPromises.cpp ('k') | Source/core/frame/ConsoleTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698