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

Side by Side Diff: third_party/WebKit/Source/modules/nfc/NFC.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
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/ReadableStreamBytesConsumerTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "modules/nfc/NFC.h" 5 #include "modules/nfc/NFC.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/V8ArrayBuffer.h" 8 #include "bindings/core/v8/V8ArrayBuffer.h"
9 #include "bindings/core/v8/V8StringResource.h" 9 #include "bindings/core/v8/V8StringResource.h"
10 #include "core/dom/DOMArrayBuffer.h" 10 #include "core/dom/DOMArrayBuffer.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 505 }
506 506
507 v8::Isolate* isolate = script_state->GetIsolate(); 507 v8::Isolate* isolate = script_state->GetIsolate();
508 v8::Local<v8::String> string = V8String(isolate, string_data); 508 v8::Local<v8::String> string = V8String(isolate, string_data);
509 509
510 // Stringified JSON must be converted back to an Object. 510 // Stringified JSON must be converted back to an Object.
511 if (record->record_type == 511 if (record->record_type ==
512 device::nfc::mojom::blink::NFCRecordType::JSON) { 512 device::nfc::mojom::blink::NFCRecordType::JSON) {
513 v8::Local<v8::Value> json_object; 513 v8::Local<v8::Value> json_object;
514 v8::TryCatch try_catch(isolate); 514 v8::TryCatch try_catch(isolate);
515 if (!V8Call(v8::JSON::Parse(isolate, string), json_object, try_catch)) { 515 if (!v8::JSON::Parse(isolate, string).ToLocal(&json_object)) {
516 return v8::Null(isolate); 516 return v8::Null(isolate);
517 } 517 }
518 518
519 return json_object; 519 return json_object;
520 } 520 }
521 521
522 return string; 522 return string;
523 } 523 }
524 524
525 case device::nfc::mojom::blink::NFCRecordType::OPAQUE_RECORD: { 525 case device::nfc::mojom::blink::NFCRecordType::OPAQUE_RECORD: {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 826
827 DEFINE_TRACE(NFC) { 827 DEFINE_TRACE(NFC) {
828 PageVisibilityObserver::Trace(visitor); 828 PageVisibilityObserver::Trace(visitor);
829 ContextLifecycleObserver::Trace(visitor); 829 ContextLifecycleObserver::Trace(visitor);
830 visitor->Trace(requests_); 830 visitor->Trace(requests_);
831 visitor->Trace(callbacks_); 831 visitor->Trace(callbacks_);
832 } 832 }
833 833
834 } // namespace blink 834 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/ReadableStreamBytesConsumerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698