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

Side by Side Diff: third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp

Issue 2836093004: Remove V8Call and replace with v8::Maybe<T>::To and v8::MaybeLocal<T>::ToLocal. (Closed)
Patch Set: rebase Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return; 175 return;
176 176
177 ScriptState* script_state = resolver_->GetScriptState(); 177 ScriptState* script_state = resolver_->GetScriptState();
178 ScriptState::Scope scope(script_state); 178 ScriptState::Scope scope(script_state);
179 179
180 v8::Local<v8::String> json_string = 180 v8::Local<v8::String> json_string =
181 V8StringFromUtf8(script_state->GetIsolate(), utf8_data, length); 181 V8StringFromUtf8(script_state->GetIsolate(), utf8_data, length);
182 182
183 v8::TryCatch exception_catcher(script_state->GetIsolate()); 183 v8::TryCatch exception_catcher(script_state->GetIsolate());
184 v8::Local<v8::Value> json_dictionary; 184 v8::Local<v8::Value> json_dictionary;
185 if (V8Call(v8::JSON::Parse(script_state->GetIsolate(), json_string), 185 if (v8::JSON::Parse(script_state->GetIsolate(), json_string)
186 json_dictionary, exception_catcher)) 186 .ToLocal(&json_dictionary))
187 resolver_->Resolve(json_dictionary); 187 resolver_->Resolve(json_dictionary);
188 else 188 else
189 resolver_->Reject(exception_catcher.Exception()); 189 resolver_->Reject(exception_catcher.Exception());
190 ClearResolver(); 190 ClearResolver();
191 } 191 }
192 192
193 void CryptoResultImpl::CompleteWithBoolean(bool b) { 193 void CryptoResultImpl::CompleteWithBoolean(bool b) {
194 if (!resolver_) 194 if (!resolver_)
195 return; 195 return;
196 196
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 cancel_->Cancel(); 230 cancel_->Cancel();
231 cancel_.Clear(); 231 cancel_.Clear();
232 ClearResolver(); 232 ClearResolver();
233 } 233 }
234 234
235 ScriptPromise CryptoResultImpl::Promise() { 235 ScriptPromise CryptoResultImpl::Promise() {
236 return resolver_ ? resolver_->Promise() : ScriptPromise(); 236 return resolver_ ? resolver_->Promise() : ScriptPromise();
237 } 237 }
238 238
239 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698