Chromium Code Reviews| Index: Source/bindings/v8/custom/V8KeyAlgorithmCustom.cpp |
| diff --git a/Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp b/Source/bindings/v8/custom/V8KeyAlgorithmCustom.cpp |
| similarity index 60% |
| copy from Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp |
| copy to Source/bindings/v8/custom/V8KeyAlgorithmCustom.cpp |
| index 66a73c4854196167e2ca227b46e6ac497b1a26e5..0d2552e1683ae8610fc3afa275829a11409138a2 100644 |
| --- a/Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp |
| +++ b/Source/bindings/v8/custom/V8KeyAlgorithmCustom.cpp |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (C) 2007-2009 Google Inc. All rights reserved. |
| + * Copyright (C) 2014 Google Inc. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| @@ -29,21 +29,32 @@ |
| */ |
| #include "config.h" |
| -#include "V8CanvasRenderingContext.h" |
| +#include "V8KeyAlgorithm.h" |
| -#include "V8CanvasRenderingContext2D.h" |
| -#include "V8WebGLRenderingContext.h" |
| -#include "core/html/canvas/CanvasRenderingContext.h" |
| +#include "V8AesKeyAlgorithm.h" |
| +#include "V8HmacKeyAlgorithm.h" |
| +#include "V8RsaHashedKeyAlgorithm.h" |
| +#include "V8RsaKeyAlgorithm.h" |
| +#include "public/platform/WebCryptoKey.h" |
| namespace WebCore { |
| -v8::Handle<v8::Object> wrap(CanvasRenderingContext* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| +v8::Handle<v8::Object> wrap(KeyAlgorithm* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
|
haraken
2014/02/25 09:15:46
Probably you might want to remove the custom bindi
eroman
2014/02/26 01:37:36
Done. Cool, didn't know about that!
|
| { |
| ASSERT(impl); |
| - if (impl->is2d()) |
| - return wrap(toCanvasRenderingContext2D(impl), creationContext, isolate); |
| - if (impl->is3d()) |
| - return wrap(toWebGLRenderingContext(impl), creationContext, isolate); |
| + switch (impl->type()) { |
| + case blink::WebCryptoKeyAlgorithmParamsTypeNone: |
| + return V8KeyAlgorithm::createWrapper(impl, creationContext, isolate); |
| + case blink::WebCryptoKeyAlgorithmParamsTypeAes: |
| + return wrap(static_cast<AesKeyAlgorithm*>(impl), creationContext, isolate); |
| + case blink::WebCryptoKeyAlgorithmParamsTypeHmac: |
| + return wrap(static_cast<HmacKeyAlgorithm*>(impl), creationContext, isolate); |
| + case blink::WebCryptoKeyAlgorithmParamsTypeRsa: |
| + return wrap(static_cast<RsaKeyAlgorithm*>(impl), creationContext, isolate); |
| + case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed: |
| + return wrap(static_cast<RsaHashedKeyAlgorithm*>(impl), creationContext, isolate); |
| + } |
| + |
| ASSERT_NOT_REACHED(); |
| return v8::Handle<v8::Object>(); |
| } |