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

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

Issue 2144093002: Adding checks for V8 functions returning Maybe<bool> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding NOTREACHED if Delete result IsNothing for LazyFieldGetterInner Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ScriptPromisePropertyBase.h" 5 #include "bindings/core/v8/ScriptPromisePropertyBase.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/V8Binding.h" 9 #include "bindings/core/v8/V8Binding.h"
10 #include "bindings/core/v8/V8HiddenValue.h" 10 #include "bindings/core/v8/V8HiddenValue.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 void ScriptPromisePropertyBase::resolveOrRejectInternal(v8::Local<v8::Promise::R esolver> resolver) 108 void ScriptPromisePropertyBase::resolveOrRejectInternal(v8::Local<v8::Promise::R esolver> resolver)
109 { 109 {
110 v8::Local<v8::Context> context = resolver->CreationContext(); 110 v8::Local<v8::Context> context = resolver->CreationContext();
111 switch (m_state) { 111 switch (m_state) {
112 case Pending: 112 case Pending:
113 ASSERT_NOT_REACHED(); 113 ASSERT_NOT_REACHED();
114 break; 114 break;
115 case Resolved: 115 case Resolved:
116 resolver->Resolve(context, resolvedValue(m_isolate, context->Global())); 116 if (resolver->Resolve(context, resolvedValue(m_isolate, context->Global( ))).IsNothing()) {
117 // TODO: What action, if any, should be taken here?
118 }
117 break; 119 break;
118 case Rejected: 120 case Rejected:
119 resolver->Reject(context, rejectedValue(m_isolate, context->Global())); 121 if (resolver->Reject(context, rejectedValue(m_isolate, context->Global() )).IsNothing()) {
122 // TODO: What action, if any, should be taken here?
123 }
120 break; 124 break;
121 } 125 }
122 } 126 }
123 127
124 v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper(ScriptState * scriptState) 128 v8::Local<v8::Object> ScriptPromisePropertyBase::ensureHolderWrapper(ScriptState * scriptState)
125 { 129 {
126 v8::Local<v8::Context> context = scriptState->context(); 130 v8::Local<v8::Context> context = scriptState->context();
127 size_t i = 0; 131 size_t i = 0;
128 while (i < m_wrappers.size()) { 132 while (i < m_wrappers.size()) {
129 const std::unique_ptr<ScopedPersistent<v8::Object>>& persistent = m_wrap pers[i]; 133 const std::unique_ptr<ScopedPersistent<v8::Object>>& persistent = m_wrap pers[i];
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ASSERT_NOT_REACHED(); 209 ASSERT_NOT_REACHED();
206 return v8::Local<v8::String>(); 210 return v8::Local<v8::String>();
207 } 211 }
208 212
209 DEFINE_TRACE(ScriptPromisePropertyBase) 213 DEFINE_TRACE(ScriptPromisePropertyBase)
210 { 214 {
211 ContextLifecycleObserver::trace(visitor); 215 ContextLifecycleObserver::trace(visitor);
212 } 216 }
213 217
214 } // namespace blink 218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698