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

Side by Side Diff: tools/json_schema_compiler/h_generator.py

Issue 1551493002: Switch to standard integer types in tools/json_schema_compiler/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('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 import os 5 import os
6 6
7 from code import Code 7 from code import Code
8 from model import PropertyType 8 from model import PropertyType
9 import cpp_util 9 import cpp_util
10 import schema_util 10 import schema_util
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 # Hack: tabs and windows have circular references, so only generate hard 44 # Hack: tabs and windows have circular references, so only generate hard
45 # references for them (i.e. anything that can't be forward declared). In 45 # references for them (i.e. anything that can't be forward declared). In
46 # other cases, generate soft dependencies so that they can include 46 # other cases, generate soft dependencies so that they can include
47 # non-optional types from other namespaces. 47 # non-optional types from other namespaces.
48 include_soft = self._namespace.name not in ('tabs', 'windows') 48 include_soft = self._namespace.name not in ('tabs', 'windows')
49 49
50 (c.Append('#ifndef %s' % ifndef_name) 50 (c.Append('#ifndef %s' % ifndef_name)
51 .Append('#define %s' % ifndef_name) 51 .Append('#define %s' % ifndef_name)
52 .Append() 52 .Append()
53 .Append('#include <stdint.h>')
54 .Append()
53 .Append('#include <map>') 55 .Append('#include <map>')
54 .Append('#include <string>') 56 .Append('#include <string>')
55 .Append('#include <vector>') 57 .Append('#include <vector>')
56 .Append() 58 .Append()
57 .Append('#include "base/basictypes.h"')
58 .Append('#include "base/logging.h"') 59 .Append('#include "base/logging.h"')
59 .Append('#include "base/memory/linked_ptr.h"') 60 .Append('#include "base/memory/linked_ptr.h"')
60 .Append('#include "base/memory/scoped_ptr.h"') 61 .Append('#include "base/memory/scoped_ptr.h"')
61 .Append('#include "base/values.h"') 62 .Append('#include "base/values.h"')
62 .Cblock(self._type_helper.GenerateIncludes(include_soft=include_soft)) 63 .Cblock(self._type_helper.GenerateIncludes(include_soft=include_soft))
63 .Append() 64 .Append()
64 ) 65 )
65 66
66 # Hack: we're not generating soft includes for tabs and windows, so we need 67 # Hack: we're not generating soft includes for tabs and windows, so we need
67 # to generate forward declarations for them. 68 # to generate forward declarations for them.
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 """Builds the parameter list for a function, given an array of parameters. 394 """Builds the parameter list for a function, given an array of parameters.
394 """ 395 """
395 # |error| is populated with warnings and/or errors found during parsing. 396 # |error| is populated with warnings and/or errors found during parsing.
396 # |error| being set does not necessarily imply failure and may be 397 # |error| being set does not necessarily imply failure and may be
397 # recoverable. 398 # recoverable.
398 # For example, optional properties may have failed to parse, but the 399 # For example, optional properties may have failed to parse, but the
399 # parser was able to continue. 400 # parser was able to continue.
400 if self._generate_error_messages: 401 if self._generate_error_messages:
401 params += ('base::string16* error',) 402 params += ('base::string16* error',)
402 return ', '.join(str(p) for p in params) 403 return ', '.join(str(p) for p in params)
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698