| OLD | NEW |
| 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/modules/v8/ScriptValueSerializerForModules.h" | 5 #include "bindings/modules/v8/ScriptValueSerializerForModules.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/SerializationTag.h" | 7 #include "bindings/core/v8/SerializationTag.h" |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "bindings/modules/v8/V8CryptoKey.h" | 9 #include "bindings/modules/v8/V8CryptoKey.h" |
| 10 #include "bindings/modules/v8/V8DOMFileSystem.h" | 10 #include "bindings/modules/v8/V8DOMFileSystem.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 return false; | 405 return false; |
| 406 String pemCertificate; | 406 String pemCertificate; |
| 407 if (!readWebCoreString(&pemCertificate)) | 407 if (!readWebCoreString(&pemCertificate)) |
| 408 return false; | 408 return false; |
| 409 | 409 |
| 410 std::unique_ptr<WebRTCCertificateGenerator> certificateGenerator = | 410 std::unique_ptr<WebRTCCertificateGenerator> certificateGenerator = |
| 411 wrapUnique(Platform::current()->createRTCCertificateGenerator()); | 411 wrapUnique(Platform::current()->createRTCCertificateGenerator()); |
| 412 | 412 |
| 413 std::unique_ptr<WebRTCCertificate> certificate( | 413 std::unique_ptr<WebRTCCertificate> certificate( |
| 414 certificateGenerator->fromPEM(pemPrivateKey, pemCertificate)); | 414 certificateGenerator->fromPEM(pemPrivateKey, pemCertificate)); |
| 415 if (!certificate) |
| 416 return false; |
| 415 RTCCertificate* jsCertificate = new RTCCertificate(std::move(certificate)); | 417 RTCCertificate* jsCertificate = new RTCCertificate(std::move(certificate)); |
| 416 | 418 |
| 417 *value = | 419 *value = |
| 418 toV8(jsCertificate, getScriptState()->context()->Global(), isolate()); | 420 toV8(jsCertificate, getScriptState()->context()->Global(), isolate()); |
| 419 return !value->IsEmpty(); | 421 return !value->IsEmpty(); |
| 420 } | 422 } |
| 421 | 423 |
| 422 bool SerializedScriptValueReaderForModules::doReadHmacKey( | 424 bool SerializedScriptValueReaderForModules::doReadHmacKey( |
| 423 WebCryptoKeyAlgorithm& algorithm, | 425 WebCryptoKeyAlgorithm& algorithm, |
| 424 WebCryptoKeyType& type) { | 426 WebCryptoKeyType& type) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 : ScriptValueDeserializer(reader, | 658 : ScriptValueDeserializer(reader, |
| 657 messagePorts, | 659 messagePorts, |
| 658 arrayBufferContents, | 660 arrayBufferContents, |
| 659 imageBitmapContents) {} | 661 imageBitmapContents) {} |
| 660 | 662 |
| 661 bool ScriptValueDeserializerForModules::read(v8::Local<v8::Value>* value) { | 663 bool ScriptValueDeserializerForModules::read(v8::Local<v8::Value>* value) { |
| 662 return toSerializedScriptValueReaderForModules(reader()).read(value, *this); | 664 return toSerializedScriptValueReaderForModules(reader()).read(value, *this); |
| 663 } | 665 } |
| 664 | 666 |
| 665 } // namespace blink | 667 } // namespace blink |
| OLD | NEW |