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

Unified Diff: third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp

Issue 2290523005: Simplify AnimationTestHelper.h (Closed)
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/Source/core/animation/AnimationTestHelper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp b/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp
index d9987b6d4daa359a6f4f94eddde1c4e3ff15143f..273ecea1c98debf3b109e255860605d6b4f8b257 100644
--- a/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp
@@ -8,24 +8,14 @@
namespace blink {
-v8::Local<v8::Value> stringToV8Value(String string)
+void setV8ObjectPropertyAsString(v8::Isolate* isolate, v8::Local<v8::Object> object, const StringView& name, const StringView& value)
{
- return v8::Local<v8::Value>::Cast(v8String(v8::Isolate::GetCurrent(), string));
+ object->Set(isolate->GetCurrentContext(), v8String(isolate, name), v8String(isolate, value)).ToChecked();
}
-v8::Local<v8::Value> doubleToV8Value(double number)
+void setV8ObjectPropertyAsNumber(v8::Isolate* isolate, v8::Local<v8::Object> object, const StringView& name, double value)
{
- return v8::Local<v8::Value>::Cast(v8::Number::New(v8::Isolate::GetCurrent(), number));
-}
-
-void setV8ObjectPropertyAsString(v8::Isolate* isolate, v8::Local<v8::Object> object, String name, String value)
-{
- object->Set(isolate->GetCurrentContext(), stringToV8Value(name), stringToV8Value(value)).ToChecked();
-}
-
-void setV8ObjectPropertyAsNumber(v8::Isolate* isolate, v8::Local<v8::Object> object, String name, double value)
-{
- object->Set(isolate->GetCurrentContext(), stringToV8Value(name), doubleToV8Value(value)).ToChecked();
+ object->Set(isolate->GetCurrentContext(), v8String(isolate, name), v8::Number::New(isolate, value)).ToChecked();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/animation/AnimationTestHelper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698