| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import sys | 6 import sys |
| 7 import string | 7 import string |
| 8 import json | 8 import json |
| 9 | 9 |
| 10 blink_protocol_path = sys.argv[1] | 10 blink_protocol_path = sys.argv[1] |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class DevToolsProtocolDispatcher; | 38 class DevToolsProtocolDispatcher; |
| 39 | 39 |
| 40 namespace devtools { | 40 namespace devtools { |
| 41 | 41 |
| 42 extern const char kProtocolVersion[]; | 42 extern const char kProtocolVersion[]; |
| 43 | 43 |
| 44 bool IsSupportedProtocolVersion(const std::string& version); | 44 bool IsSupportedProtocolVersion(const std::string& version); |
| 45 | 45 |
| 46 template<typename T> | 46 template<typename T> |
| 47 std::unique_ptr<base::Value> CreateValue(const T& param) { | 47 std::unique_ptr<base::Value> CreateValue(const T& param) { |
| 48 return base::MakeUnique<base::FundamentalValue>(param); | 48 return base::MakeUnique<base::Value>(param); |
| 49 } | 49 } |
| 50 | 50 |
| 51 template<typename T> | 51 template<typename T> |
| 52 std::unique_ptr<base::Value> CreateValue(std::unique_ptr<T>& param) { | 52 std::unique_ptr<base::Value> CreateValue(std::unique_ptr<T>& param) { |
| 53 return std::move(param); | 53 return std::move(param); |
| 54 } | 54 } |
| 55 | 55 |
| 56 template<class T> | 56 template<class T> |
| 57 std::unique_ptr<base::Value> CreateValue(const scoped_refptr<T>& param) { | 57 std::unique_ptr<base::Value> CreateValue(const scoped_refptr<T>& param) { |
| 58 return param->ToValue(); | 58 return param->ToValue(); |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 output_h_file.close() | 831 output_h_file.close() |
| 832 | 832 |
| 833 output_cc_file.write(template_cc.substitute({}, | 833 output_cc_file.write(template_cc.substitute({}, |
| 834 major = blink_protocol["version"]["major"], | 834 major = blink_protocol["version"]["major"], |
| 835 minor = blink_protocol["version"]["minor"], | 835 minor = blink_protocol["version"]["minor"], |
| 836 includes = "".join(sorted(includes)), | 836 includes = "".join(sorted(includes)), |
| 837 fields_init = ",\n ".join(fields_init), | 837 fields_init = ",\n ".join(fields_init), |
| 838 methods = "\n".join(handler_method_impls), | 838 methods = "\n".join(handler_method_impls), |
| 839 types = "\n".join(type_impls))) | 839 types = "\n".join(type_impls))) |
| 840 output_cc_file.close() | 840 output_cc_file.close() |
| OLD | NEW |