| 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 71%
|
| copy from Source/bindings/v8/custom/V8EntrySyncCustom.cpp
|
| copy to Source/bindings/v8/custom/V8AlgorithmCustom.cpp
|
| index d09bcf42fd3eb7269f770ff631a4856956863a27..d50212ece4e07f561668d7856d0f064deeddb92c 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::NoParams:
|
| + return V8Algorithm::createWrapper(impl, creationContext, isolate);
|
| + case WebKit::AesCbcParams:
|
| + return wrap(static_cast<AesCbcParams*>(impl), creationContext, isolate);
|
| + case WebKit::AesKeyGenParams:
|
| + return wrap(static_cast<AesKeyGenParams*>(impl), creationContext, isolate);
|
| + }
|
| +
|
| + ASSERT_NOT_REACHED();
|
| + return v8::Handle<v8::Object>();
|
| }
|
|
|
| } // namespace WebCore
|
|
|