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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp

Issue 2170263002: [DevTools] Pass error object when reporting exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: worklets! Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/RejectedPromises.h" 5 #include "bindings/core/v8/RejectedPromises.h"
6 6
7 #include "bindings/core/v8/ScopedPersistent.h" 7 #include "bindings/core/v8/ScopedPersistent.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include "bindings/core/v8/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 PromiseRejectionEventInit init; 100 PromiseRejectionEventInit init;
101 init.setPromise(ScriptPromise(m_scriptState, value)); 101 init.setPromise(ScriptPromise(m_scriptState, value));
102 init.setReason(ScriptValue(m_scriptState, reason)); 102 init.setReason(ScriptValue(m_scriptState, reason));
103 PromiseRejectionEvent* event = PromiseRejectionEvent::create(m_scrip tState, EventTypeNames::rejectionhandled, init); 103 PromiseRejectionEvent* event = PromiseRejectionEvent::create(m_scrip tState, EventTypeNames::rejectionhandled, init);
104 target->dispatchEvent(event); 104 target->dispatchEvent(event);
105 } 105 }
106 106
107 if (m_shouldLogToConsole && m_promiseRejectionId) { 107 if (m_shouldLogToConsole && m_promiseRejectionId) {
108 V8PerIsolateData* data = V8PerIsolateData::from(m_scriptState->isola te()); 108 V8PerIsolateData* data = V8PerIsolateData::from(m_scriptState->isola te());
109 if (data->threadDebugger()) 109 if (data->threadDebugger())
110 data->threadDebugger()->debugger()->promiseRejectionRevoked(m_sc riptState->context(), m_promiseRejectionId); 110 data->threadDebugger()->promiseRejectionRevoked(m_scriptState->c ontext(), m_promiseRejectionId);
111 } 111 }
112 } 112 }
113 113
114 void makePromiseWeak() 114 void makePromiseWeak()
115 { 115 {
116 ASSERT(!m_promise.isEmpty() && !m_promise.isWeak()); 116 ASSERT(!m_promise.isEmpty() && !m_promise.isWeak());
117 m_promise.setWeak(this, &Message::didCollectPromise); 117 m_promise.setWeak(this, &Message::didCollectPromise);
118 m_exception.setWeak(this, &Message::didCollectException); 118 m_exception.setWeak(this, &Message::didCollectException);
119 } 119 }
120 120
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 } 255 }
256 } 256 }
257 257
258 void RejectedPromises::revokeNow(std::unique_ptr<Message> message) 258 void RejectedPromises::revokeNow(std::unique_ptr<Message> message)
259 { 259 {
260 message->revoke(); 260 message->revoke();
261 } 261 }
262 262
263 } // namespace blink 263 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698