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

Unified Diff: Source/bindings/v8/custom/V8AlgorithmCustom.cpp

Issue 18475002: WebCrypto: Add framework for AlgorithmIdentifier normalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rename verify --> verifySignature (because "verify" is a macro on Mac) Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8AlgorithmCustom.cpp
diff --git a/Source/bindings/v8/custom/V8EntrySyncCustom.cpp b/Source/bindings/v8/custom/V8AlgorithmCustom.cpp
similarity index 68%
copy from Source/bindings/v8/custom/V8EntrySyncCustom.cpp
copy to Source/bindings/v8/custom/V8AlgorithmCustom.cpp
index d09bcf42fd3eb7269f770ff631a4856956863a27..172abb3f1decac22526aaa03571a7bf0d3ecb6f3 100644
--- a/Source/bindings/v8/custom/V8EntrySyncCustom.cpp
+++ b/Source/bindings/v8/custom/V8AlgorithmCustom.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 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,25 +29,30 @@
*/
#include "config.h"
-#include "modules/filesystem/EntrySync.h"
+#include "modules/crypto/Algorithm.h"
-#include "V8Attr.h"
-#include "V8DirectoryEntrySync.h"
-#include "V8EntrySync.h"
-#include "V8FileEntrySync.h"
+#include "V8AesCbcParams.h"
+#include "V8AesKeyGenParams.h"
#include "bindings/v8/V8Binding.h"
-#include "wtf/RefPtr.h"
namespace WebCore {
-v8::Handle<v8::Object> wrap(EntrySync* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Object> wrap(Algorithm* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
- if (impl->isFile())
- return wrap(static_cast<FileEntrySync*>(impl), creationContext, isolate);
- ASSERT(impl->isDirectory());
- return wrap(static_cast<DirectoryEntrySync*>(impl), creationContext, isolate);
+ // Wrap as the more derived type.
+ switch (impl->type()) {
+ case WebKit::WebCryptoAlgorithmParamsTypeNone:
+ return V8Algorithm::createWrapper(impl, creationContext, isolate);
+ case WebKit::WebCryptoAlgorithmParamsTypeAesCbcParams:
+ return wrap(static_cast<AesCbcParams*>(impl), creationContext, isolate);
+ case WebKit::WebCryptoAlgorithmParamsTypeAesKeyGenParams:
+ return wrap(static_cast<AesKeyGenParams*>(impl), creationContext, isolate);
+ }
+
+ ASSERT_NOT_REACHED();
+ return v8::Handle<v8::Object>();
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/Dictionary.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698