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

Side by Side Diff: tools/json_schema_compiler/any.cc

Issue 11572061: Create DeclarativeConditionSet, DeclarativeActionSet, and DeclarativeRule templates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix kalman's nit Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tools/json_schema_compiler/any.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "tools/json_schema_compiler/any.h" 5 #include "tools/json_schema_compiler/any.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 9
10 namespace json_schema_compiler { 10 namespace json_schema_compiler {
11 namespace any { 11 namespace any {
12 12
13 Any::Any() {} 13 Any::Any() {}
14 14
15 Any::Any(scoped_ptr<base::Value> from_value)
16 : value_(from_value.Pass()) {
17 }
18
15 Any::~Any() {} 19 Any::~Any() {}
16 20
17 void Any::Init(const base::Value& from_value) { 21 void Any::Init(const base::Value& from_value) {
18 CHECK(!value_.get()); 22 CHECK(!value_.get());
19 value_.reset(from_value.DeepCopy()); 23 value_.reset(from_value.DeepCopy());
20 } 24 }
21 25
22 const base::Value& Any::value() const { 26 const base::Value& Any::value() const {
23 CHECK(value_.get()); 27 CHECK(value_.get());
24 return *value_; 28 return *value_;
25 } 29 }
26 30
27 } // namespace any 31 } // namespace any
28 } // namespace json_schema_compiler 32 } // namespace json_schema_compiler
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/any.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698