| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 "tools/json_schema_compiler/any.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/values.h" | |
| 9 | |
| 10 namespace json_schema_compiler { | |
| 11 namespace any { | |
| 12 | |
| 13 Any::Any() {} | |
| 14 | |
| 15 Any::Any(scoped_ptr<base::Value> from_value) | |
| 16 : value_(from_value.Pass()) { | |
| 17 } | |
| 18 | |
| 19 Any::~Any() {} | |
| 20 | |
| 21 void Any::Init(const base::Value& from_value) { | |
| 22 CHECK(!value_.get()); | |
| 23 value_.reset(from_value.DeepCopy()); | |
| 24 } | |
| 25 | |
| 26 const base::Value& Any::value() const { | |
| 27 CHECK(value_.get()); | |
| 28 return *value_; | |
| 29 } | |
| 30 | |
| 31 } // namespace any | |
| 32 } // namespace json_schema_compiler | |
| OLD | NEW |