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 // 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 |
OLD | NEW |