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

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.cpp

Issue 2164353002: [DevTools] Unify toValue and FromValue into ValueConversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "platform/inspector_protocol/ValueConversions.h"
6
7 namespace blink {
8 namespace protocol {
9
10 std::unique_ptr<protocol::Value> toValue(int value)
11 {
12 return FundamentalValue::create(value);
13 }
14
15 std::unique_ptr<protocol::Value> toValue(double value)
16 {
17 return FundamentalValue::create(value);
18 }
19
20 std::unique_ptr<protocol::Value> toValue(bool value)
21 {
22 return FundamentalValue::create(value);
23 }
24
25 std::unique_ptr<protocol::Value> toValue(const String16& param)
26 {
27 return StringValue::create(param);
28 }
29
30 std::unique_ptr<protocol::Value> toValue(const String& param)
31 {
32 return StringValue::create(param);
33 }
34
35 std::unique_ptr<protocol::Value> toValue(Value* param)
36 {
37 return param->clone();
38 }
39
40 std::unique_ptr<protocol::Value> toValue(DictionaryValue* param)
41 {
42 return param->clone();
43 }
44
45 std::unique_ptr<protocol::Value> toValue(ListValue* param)
46 {
47 return param->clone();
48 }
49
50 } // namespace protocol
51 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698