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

Side by Side Diff: generated_files_will_not_submit/crossref.cc

Issue 9309044: Supporting more APIs with json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rework, add a couple of tests Created 8 years, 10 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 (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 // GENERATED FROM THE API DEFINITION IN
6 // tools/json_schema_compiler/test/crossref.json
7 // DO NOT EDIT.
8
9 #include "tools/json_schema_compiler/util.h"
10 #include "tools/json_schema_compiler/test/crossref.h"
11 #include "tools/json_schema_compiler/test/simple_api.h"
12
13
14 using base::Value;
15 using base::DictionaryValue;
16 using base::ListValue;
17
18 namespace test {
19 namespace api {
20 namespace crossref {
21
22 //
23 // Functions
24 //
25
26 Value* GetTestType::Result::Create(const simple_api::TestType& result) {
27 return result.ToValue().release();
28 }
29
30 TestTypeOptionalParam::Params::Params() {}
31 TestTypeOptionalParam::Params::~Params() {}
32
33 // static
34 scoped_ptr<TestTypeOptionalParam::Params> TestTypeOptionalParam::Params::Create( const ListValue& args) {
35 if (args.GetSize() > 1)
36 return scoped_ptr<Params>();
37 scoped_ptr<Params> params(new Params());
38
39 Value* test_type_value = NULL;
40 if (!args.Get(0, &test_type_value) || test_type_value->IsType(Value::TYPE_NULL ))
41 return params.Pass();
42 {
43 if (!test_type_value->IsType(Value::TYPE_DICTIONARY))
44 return scoped_ptr<Params>();
45 DictionaryValue* dictionary = NULL;
46 if (!test_type_value->GetAsDictionary(&dictionary))
47 return scoped_ptr<Params>();
48 scoped_ptr<simple_api::TestType> temp(new simple_api::TestType());
49 if (!simple_api::TestType::Populate(*dictionary, temp.get()))
50 return scoped_ptr<Params>();
51 params->test_type = temp.Pass();
52 }
53
54 return params.Pass();
55 }
56
57
58 Value* TestTypeOptionalParam::Result::Create() {
59 return Value::CreateNullValue();
60 }
61
62 } // crossref
63 } // api
64 } // test
OLDNEW
« no previous file with comments | « generated_files_will_not_submit/crossref.h ('k') | generated_files_will_not_submit/experimental.declarative.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698