| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/serialization/V8ScriptValueSerializerForModules.h" | 5 #include "bindings/modules/v8/serialization/V8ScriptValueSerializerForModules.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 8 #include "bindings/core/v8/ToV8.h" | 8 #include "bindings/core/v8/ToV8.h" |
| 9 #include "bindings/core/v8/V8ArrayBuffer.h" | 9 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 10 #include "bindings/core/v8/V8BindingForTesting.h" | 10 #include "bindings/core/v8/V8BindingForTesting.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 template <typename T> | 293 template <typename T> |
| 294 WebCryptoResult toWebCryptoResult( | 294 WebCryptoResult toWebCryptoResult( |
| 295 ScriptState* scriptState, | 295 ScriptState* scriptState, |
| 296 std::unique_ptr<WTF::Function<void(T)>> function) { | 296 std::unique_ptr<WTF::Function<void(T)>> function) { |
| 297 CryptoResultImpl* result = CryptoResultImpl::create(scriptState); | 297 CryptoResultImpl* result = CryptoResultImpl::create(scriptState); |
| 298 result->promise().then( | 298 result->promise().then( |
| 299 (new WebCryptoResultAdapter<T>(scriptState, std::move(function))) | 299 (new WebCryptoResultAdapter<T>(scriptState, std::move(function))) |
| 300 ->bindToV8Function(), | 300 ->bindToV8Function(), |
| 301 (new WebCryptoResultAdapter<DOMException*>( | 301 (new WebCryptoResultAdapter<DOMException*>( |
| 302 scriptState, WTF::bind([](DOMException* exception) { | 302 scriptState, WTF::bind([](DOMException* exception) { |
| 303 CHECK(false) << "crypto operation failed"; | 303 // crypto operation failed |
| 304 CHECK(false); |
| 304 }))) | 305 }))) |
| 305 ->bindToV8Function()); | 306 ->bindToV8Function()); |
| 306 return result->result(); | 307 return result->result(); |
| 307 } | 308 } |
| 308 | 309 |
| 309 template <typename T, typename PMF, typename... Args> | 310 template <typename T, typename PMF, typename... Args> |
| 310 T subtleCryptoSync(ScriptState* scriptState, PMF func, Args&&... args) { | 311 T subtleCryptoSync(ScriptState* scriptState, PMF func, Args&&... args) { |
| 311 T result; | 312 T result; |
| 312 (Platform::current()->crypto()->*func)( | 313 (Platform::current()->crypto()->*func)( |
| 313 std::forward<Args>(args)..., | 314 std::forward<Args>(args)..., |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x69, | 972 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x73, 0x69, |
| 972 0x73, 0x74, 0x65, 0x6e, 0x74, 0x2f | 973 0x73, 0x74, 0x65, 0x6e, 0x74, 0x2f |
| 973 | 974 |
| 974 })) | 975 })) |
| 975 .deserialize() | 976 .deserialize() |
| 976 ->IsNull()); | 977 ->IsNull()); |
| 977 } | 978 } |
| 978 | 979 |
| 979 } // namespace | 980 } // namespace |
| 980 } // namespace blink | 981 } // namespace blink |
| OLD | NEW |