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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 1471043004: Convert various vector_as_array calls to vector::data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/touch_injector_win.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cc_generator.py
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 48a723e047246e4c54470a9b161a9cd1cfd002d9..f93c4d9fb80db3479fd43215e66af5161ca9485c 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -43,7 +43,6 @@ class _Generator(object):
.Append()
.Append(self._util_cc_helper.GetIncludePath())
.Append('#include "base/logging.h"')
- .Append('#include "base/stl_util.h"')
.Append('#include "base/strings/string_number_conversions.h"')
.Append('#include "base/strings/utf_string_conversions.h"')
.Append('#include "%s/%s.h"' %
@@ -557,12 +556,10 @@ class _Generator(object):
elif underlying_type.property_type == PropertyType.BINARY:
if is_ptr:
vardot = var + '->'
- ref = var + '.get()'
else:
vardot = var + '.'
- ref = '&' + var
- return ('base::BinaryValue::CreateWithCopiedBuffer(vector_as_array(%s),'
- ' %ssize())' % (ref, vardot))
+ return ('base::BinaryValue::CreateWithCopiedBuffer(%sdata(),'
+ ' %ssize())' % (vardot, vardot))
elif underlying_type.property_type == PropertyType.ARRAY:
return '%s.release()' % self._util_cc_helper.CreateValueFromArray(
var,
« no previous file with comments | « remoting/host/touch_injector_win.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698