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

Unified Diff: extensions/renderer/utils_native_handler.cc

Issue 332233002: enterprise.platformKeys: Copy-on-read the 'algorithm' member of Key objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed the unnecessary unit test. Created 6 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 | « extensions/renderer/utils_native_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/utils_native_handler.cc
diff --git a/extensions/renderer/utils_native_handler.cc b/extensions/renderer/utils_native_handler.cc
index 1c0941f0999527f73fbeb3bab4e22f50fcd28fe5..a59cc7ccf26a59e9ee5c93ed1f3e3cfc9fa542f2 100644
--- a/extensions/renderer/utils_native_handler.cc
+++ b/extensions/renderer/utils_native_handler.cc
@@ -7,6 +7,7 @@
#include "base/strings/stringprintf.h"
#include "extensions/renderer/script_context.h"
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
+#include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
namespace extensions {
@@ -15,6 +16,9 @@ UtilsNativeHandler::UtilsNativeHandler(ScriptContext* context)
RouteFunction("createClassWrapper",
base::Bind(&UtilsNativeHandler::CreateClassWrapper,
base::Unretained(this)));
+ RouteFunction(
+ "deepCopy",
+ base::Bind(&UtilsNativeHandler::DeepCopy, base::Unretained(this)));
}
UtilsNativeHandler::~UtilsNativeHandler() {}
@@ -81,4 +85,11 @@ void UtilsNativeHandler::CreateClassWrapper(
args.GetReturnValue().Set(result);
}
+void UtilsNativeHandler::DeepCopy(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ CHECK_EQ(1, args.Length());
+ args.GetReturnValue().Set(
+ blink::WebSerializedScriptValue::serialize(args[0]).deserialize());
+}
+
} // namespace extensions
« no previous file with comments | « extensions/renderer/utils_native_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698