OLD | NEW |
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // | 275 // |
276 bool getOptionalBufferSource(const Dictionary& raw, const char* propertyName, bo
ol& hasProperty, BufferSource& buffer, const ErrorContext& context, AlgorithmErr
or* error) | 276 bool getOptionalBufferSource(const Dictionary& raw, const char* propertyName, bo
ol& hasProperty, BufferSource& buffer, const ErrorContext& context, AlgorithmErr
or* error) |
277 { | 277 { |
278 hasProperty = false; | 278 hasProperty = false; |
279 v8::Local<v8::Value> v8Value; | 279 v8::Local<v8::Value> v8Value; |
280 if (!raw.get(propertyName, v8Value)) | 280 if (!raw.get(propertyName, v8Value)) |
281 return true; | 281 return true; |
282 hasProperty = true; | 282 hasProperty = true; |
283 | 283 |
284 if (v8Value->IsArrayBufferView()) { | 284 if (v8Value->IsArrayBufferView()) { |
285 buffer.setArrayBufferView(V8ArrayBufferView::toImpl(v8::Handle<v8::Objec
t>::Cast(v8Value))); | 285 buffer.setArrayBufferView(V8ArrayBufferView::toImpl(v8::Local<v8::Object
>::Cast(v8Value))); |
286 return true; | 286 return true; |
287 } | 287 } |
288 | 288 |
289 if (v8Value->IsArrayBuffer()) { | 289 if (v8Value->IsArrayBuffer()) { |
290 buffer.setArrayBuffer(V8ArrayBuffer::toImpl(v8::Handle<v8::Object>::Cast
(v8Value))); | 290 buffer.setArrayBuffer(V8ArrayBuffer::toImpl(v8::Local<v8::Object>::Cast(
v8Value))); |
291 return true; | 291 return true; |
292 } | 292 } |
293 | 293 |
294 if (hasProperty) { | 294 if (hasProperty) { |
295 setTypeError(context.toString(propertyName, "Not a BufferSource"), error
); | 295 setTypeError(context.toString(propertyName, "Not a BufferSource"), error
); |
296 return false; | 296 return false; |
297 } | 297 } |
298 return true; | 298 return true; |
299 } | 299 } |
300 | 300 |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 } | 978 } |
979 | 979 |
980 } // namespace | 980 } // namespace |
981 | 981 |
982 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op, W
ebCryptoAlgorithm& algorithm, AlgorithmError* error) | 982 bool normalizeAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op, W
ebCryptoAlgorithm& algorithm, AlgorithmError* error) |
983 { | 983 { |
984 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); | 984 return parseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); |
985 } | 985 } |
986 | 986 |
987 } // namespace blink | 987 } // namespace blink |
OLD | NEW |