| OLD | NEW |
| 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 import code | 5 import code |
| 6 import cpp_util | 6 import cpp_util |
| 7 from model import Platforms | 7 from model import Platforms |
| 8 from schema_util import CapitalizeFirstLetter | 8 from schema_util import CapitalizeFirstLetter |
| 9 from schema_util import JsFunctionNameToClassName | 9 from schema_util import JsFunctionNameToClassName |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 separators=(',', ':')) | 200 separators=(',', ':')) |
| 201 # Escape all double-quotes and backslashes. For this to output a valid | 201 # Escape all double-quotes and backslashes. For this to output a valid |
| 202 # JSON C string, we need to escape \ and ". | 202 # JSON C string, we need to escape \ and ". |
| 203 json_content = json_content.replace('\\', '\\\\').replace('"', '\\"') | 203 json_content = json_content.replace('\\', '\\\\').replace('"', '\\"') |
| 204 c.Append('(*schemas)["%s"] = "%s";' % (namespace.name, json_content)) | 204 c.Append('(*schemas)["%s"] = "%s";' % (namespace.name, json_content)) |
| 205 c.Eblock('}') | 205 c.Eblock('}') |
| 206 c.Append() | 206 c.Append() |
| 207 c.Concat(self._cpp_type_generator.GetRootNamespaceEnd()) | 207 c.Concat(self._cpp_type_generator.GetRootNamespaceEnd()) |
| 208 c.Append() | 208 c.Append() |
| 209 return c | 209 return c |
| OLD | NEW |