OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/js_arg_list.h" | 5 #include "chrome/browser/sync/js_arg_list.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 | 9 |
10 namespace browser_sync { | 10 namespace browser_sync { |
11 | 11 |
12 JsArgList::JsArgList() : args_(new SharedListValue()) {} | 12 JsArgList::JsArgList() : args_(new SharedListValue()) {} |
13 | 13 |
14 JsArgList::JsArgList(const ListValue& args) | 14 JsArgList::JsArgList(const ListValue& args) |
15 : args_(new SharedListValue(args)) {} | 15 : args_(new SharedListValue(args)) {} |
16 | 16 |
17 JsArgList::JsArgList(const std::vector<const Value*>& args) | 17 JsArgList::JsArgList(const std::vector<const Value*>& args) |
18 : args_(new SharedListValue(args)) {} | 18 : args_(new SharedListValue(args)) {} |
19 | 19 |
| 20 JsArgList::~JsArgList() {} |
| 21 |
20 const ListValue& JsArgList::Get() const { | 22 const ListValue& JsArgList::Get() const { |
21 return args_->Get(); | 23 return args_->Get(); |
22 } | 24 } |
23 | 25 |
24 std::string JsArgList::ToString() const { | 26 std::string JsArgList::ToString() const { |
25 std::string str; | 27 std::string str; |
26 base::JSONWriter::Write(&Get(), false, &str); | 28 base::JSONWriter::Write(&Get(), false, &str); |
27 return str; | 29 return str; |
28 } | 30 } |
29 | 31 |
(...skipping 14 matching lines...) Expand all Loading... |
44 } | 46 } |
45 } | 47 } |
46 | 48 |
47 const ListValue& JsArgList::SharedListValue::Get() const { | 49 const ListValue& JsArgList::SharedListValue::Get() const { |
48 return list_value_; | 50 return list_value_; |
49 } | 51 } |
50 | 52 |
51 JsArgList::SharedListValue::~SharedListValue() {} | 53 JsArgList::SharedListValue::~SharedListValue() {} |
52 | 54 |
53 } // namespace browser_sync | 55 } // namespace browser_sync |
OLD | NEW |