| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_RENDERER_EXTENSIONS_PLATFORM_KEYS_NATIVES_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_PLATFORM_KEYS_NATIVES_H_ |
| 6 #define CHROME_RENDERER_EXTENSIONS_PLATFORM_KEYS_NATIVES_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_PLATFORM_KEYS_NATIVES_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" |
| 8 #include "extensions/renderer/object_backed_native_handler.h" | 9 #include "extensions/renderer/object_backed_native_handler.h" |
| 9 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
| 10 | 11 |
| 11 namespace extensions { | 12 namespace extensions { |
| 12 class ScriptContext; | 13 class ScriptContext; |
| 13 | 14 |
| 14 class PlatformKeysNatives : public ObjectBackedNativeHandler { | 15 class PlatformKeysNatives : public ObjectBackedNativeHandler { |
| 15 public: | 16 public: |
| 16 explicit PlatformKeysNatives(ScriptContext* context); | 17 explicit PlatformKeysNatives(ScriptContext* context); |
| 17 | 18 |
| 18 private: | 19 private: |
| 19 // Normalizes algorithm parameters, and then validates the expected parameters | 20 // Normalizes algorithm parameters, and then validates the expected parameters |
| 20 // for the algorithm/operation combination. | 21 // for the algorithm/operation combination. |
| 21 // Expects the following arguments in |call_info|: | 22 // Expects the following arguments in |call_info|: |
| 22 // |parameters|: An object containing the parameters to normalize. | 23 // |parameters|: An object containing the parameters to normalize. |
| 23 // |operation|: A string describing the operation. Supported operations are | 24 // |operation|: A string describing the operation. Supported operations are |
| 24 // "GenerateKey", "Sign" and "Verify". | 25 // "GenerateKey", "Sign" and "Verify". |
| 25 // Returns the normalized dictionary on success, or null if some required | 26 // Returns the normalized dictionary on success, or null if some required |
| 26 // parameters are missing or not supported. Note that it returns untyped | 27 // parameters are missing or not supported. Note that it returns untyped |
| 27 // arrays instead of typed arrays (e.g. for RSA publicExponent). | 28 // arrays instead of typed arrays (e.g. for RSA publicExponent). |
| 28 void NormalizeAlgorithm(const v8::FunctionCallbackInfo<v8::Value>& call_info); | 29 void NormalizeAlgorithm(const v8::FunctionCallbackInfo<v8::Value>& call_info); |
| 29 | 30 |
| 30 DISALLOW_COPY_AND_ASSIGN(PlatformKeysNatives); | 31 DISALLOW_COPY_AND_ASSIGN(PlatformKeysNatives); |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 } // namespace extensions | 34 } // namespace extensions |
| 34 | 35 |
| 35 #endif // CHROME_RENDERER_EXTENSIONS_PLATFORM_KEYS_NATIVES_H_ | 36 #endif // CHROME_RENDERER_EXTENSIONS_PLATFORM_KEYS_NATIVES_H_ |
| OLD | NEW |