diff options
-rw-r--r-- | extensions/browser/user_script_loader.cc | 2 | ||||
-rw-r--r-- | extensions/common/extension_messages.cc | 12 | ||||
-rw-r--r-- | extensions/common/stack_frame.cc | 7 | ||||
-rw-r--r-- | extensions/common/stack_frame.h | 8 | ||||
-rw-r--r-- | extensions/common/user_script.cc | 24 | ||||
-rw-r--r-- | extensions/renderer/user_script_set.cc | 6 |
6 files changed, 29 insertions, 30 deletions
diff --git a/extensions/browser/user_script_loader.cc b/extensions/browser/user_script_loader.cc index 4e0b9f6..91af052 100644 --- a/extensions/browser/user_script_loader.cc +++ b/extensions/browser/user_script_loader.cc @@ -279,7 +279,7 @@ void UserScriptLoader::StartLoad() { scoped_ptr<base::SharedMemory> UserScriptLoader::Serialize( const UserScriptList& scripts) { base::Pickle pickle; - pickle.WriteSizeT(scripts.size()); + pickle.WriteUInt32(scripts.size()); for (const UserScript& script : scripts) { // TODO(aa): This can be replaced by sending content script metadata to // renderers along with other extension data in ExtensionMsg_Loaded. diff --git a/extensions/common/extension_messages.cc b/extensions/common/extension_messages.cc index 5cccc11..d6ab4f2 100644 --- a/extensions/common/extension_messages.cc +++ b/extensions/common/extension_messages.cc @@ -187,7 +187,7 @@ void ParamTraits<APIPermissionSet>::Write(base::Pickle* m, const param_type& p) { APIPermissionSet::const_iterator it = p.begin(); const APIPermissionSet::const_iterator end = p.end(); - WriteParam(m, p.size()); + WriteParam(m, static_cast<uint32_t>(p.size())); for (; it != end; ++it) { WriteParam(m, it->id()); it->Write(m); @@ -197,10 +197,10 @@ void ParamTraits<APIPermissionSet>::Write(base::Pickle* m, bool ParamTraits<APIPermissionSet>::Read(const base::Pickle* m, base::PickleIterator* iter, param_type* r) { - size_t size; + uint32_t size; if (!ReadParam(m, iter, &size)) return false; - for (size_t i = 0; i < size; ++i) { + for (uint32_t i = 0; i < size; ++i) { APIPermission::ID id; if (!ReadParam(m, iter, &id)) return false; @@ -225,7 +225,7 @@ void ParamTraits<ManifestPermissionSet>::Write(base::Pickle* m, const param_type& p) { ManifestPermissionSet::const_iterator it = p.begin(); const ManifestPermissionSet::const_iterator end = p.end(); - WriteParam(m, p.size()); + WriteParam(m, static_cast<uint32_t>(p.size())); for (; it != end; ++it) { WriteParam(m, it->name()); it->Write(m); @@ -235,10 +235,10 @@ void ParamTraits<ManifestPermissionSet>::Write(base::Pickle* m, bool ParamTraits<ManifestPermissionSet>::Read(const base::Pickle* m, base::PickleIterator* iter, param_type* r) { - size_t size; + uint32_t size; if (!ReadParam(m, iter, &size)) return false; - for (size_t i = 0; i < size; ++i) { + for (uint32_t i = 0; i < size; ++i) { std::string name; if (!ReadParam(m, iter, &name)) return false; diff --git a/extensions/common/stack_frame.cc b/extensions/common/stack_frame.cc index 0286c5b..046a265 100644 --- a/extensions/common/stack_frame.cc +++ b/extensions/common/stack_frame.cc @@ -25,16 +25,15 @@ StackFrame::StackFrame(const StackFrame& frame) function(frame.function) { } -StackFrame::StackFrame(size_t line_number, - size_t column_number, +StackFrame::StackFrame(uint32_t line_number, + uint32_t column_number, const base::string16& source, const base::string16& function) : line_number(line_number), column_number(column_number), source(source), function(function.empty() ? base::UTF8ToUTF16(kAnonymousFunction) - : function) { -} + : function) {} StackFrame::~StackFrame() { } diff --git a/extensions/common/stack_frame.h b/extensions/common/stack_frame.h index 671f564..b174ffc 100644 --- a/extensions/common/stack_frame.h +++ b/extensions/common/stack_frame.h @@ -17,8 +17,8 @@ namespace extensions { struct StackFrame { StackFrame(); StackFrame(const StackFrame& frame); - StackFrame(size_t line_number, - size_t column_number, + StackFrame(uint32_t line_number, + uint32_t column_number, const base::string16& source, const base::string16& function); ~StackFrame(); @@ -29,8 +29,8 @@ struct StackFrame { bool operator==(const StackFrame& rhs) const; - size_t line_number; - size_t column_number; + uint32_t line_number; + uint32_t column_number; base::string16 source; base::string16 function; // optional }; diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc index 08adfbc..0bb3c8d 100644 --- a/extensions/common/user_script.cc +++ b/extensions/common/user_script.cc @@ -163,7 +163,7 @@ void UserScript::Pickle(base::Pickle* pickle) const { void UserScript::PickleGlobs(base::Pickle* pickle, const std::vector<std::string>& globs) const { - pickle->WriteSizeT(globs.size()); + pickle->WriteUInt32(globs.size()); for (std::vector<std::string>::const_iterator glob = globs.begin(); glob != globs.end(); ++glob) { pickle->WriteString(*glob); @@ -178,7 +178,7 @@ void UserScript::PickleHostID(base::Pickle* pickle, void UserScript::PickleURLPatternSet(base::Pickle* pickle, const URLPatternSet& pattern_list) const { - pickle->WriteSizeT(pattern_list.patterns().size()); + pickle->WriteUInt32(pattern_list.patterns().size()); for (URLPatternSet::const_iterator pattern = pattern_list.begin(); pattern != pattern_list.end(); ++pattern) { pickle->WriteInt(pattern->valid_schemes()); @@ -188,7 +188,7 @@ void UserScript::PickleURLPatternSet(base::Pickle* pickle, void UserScript::PickleScripts(base::Pickle* pickle, const FileList& scripts) const { - pickle->WriteSizeT(scripts.size()); + pickle->WriteUInt32(scripts.size()); for (FileList::const_iterator file = scripts.begin(); file != scripts.end(); ++file) { file->Pickle(pickle); @@ -227,10 +227,10 @@ void UserScript::Unpickle(const base::Pickle& pickle, void UserScript::UnpickleGlobs(const base::Pickle& pickle, base::PickleIterator* iter, std::vector<std::string>* globs) { - size_t num_globs = 0; - CHECK(iter->ReadSizeT(&num_globs)); + uint32_t num_globs = 0; + CHECK(iter->ReadUInt32(&num_globs)); globs->clear(); - for (size_t i = 0; i < num_globs; ++i) { + for (uint32_t i = 0; i < num_globs; ++i) { std::string glob; CHECK(iter->ReadString(&glob)); globs->push_back(glob); @@ -250,11 +250,11 @@ void UserScript::UnpickleHostID(const base::Pickle& pickle, void UserScript::UnpickleURLPatternSet(const base::Pickle& pickle, base::PickleIterator* iter, URLPatternSet* pattern_list) { - size_t num_patterns = 0; - CHECK(iter->ReadSizeT(&num_patterns)); + uint32_t num_patterns = 0; + CHECK(iter->ReadUInt32(&num_patterns)); pattern_list->ClearPatterns(); - for (size_t i = 0; i < num_patterns; ++i) { + for (uint32_t i = 0; i < num_patterns; ++i) { int valid_schemes; CHECK(iter->ReadInt(&valid_schemes)); @@ -274,10 +274,10 @@ void UserScript::UnpickleURLPatternSet(const base::Pickle& pickle, void UserScript::UnpickleScripts(const base::Pickle& pickle, base::PickleIterator* iter, FileList* scripts) { - size_t num_files = 0; - CHECK(iter->ReadSizeT(&num_files)); + uint32_t num_files = 0; + CHECK(iter->ReadUInt32(&num_files)); scripts->clear(); - for (size_t i = 0; i < num_files; ++i) { + for (uint32_t i = 0; i < num_files; ++i) { File file; file.Unpickle(pickle, iter); scripts->push_back(file); diff --git a/extensions/renderer/user_script_set.cc b/extensions/renderer/user_script_set.cc index 200f84c..e289f3f 100644 --- a/extensions/renderer/user_script_set.cc +++ b/extensions/renderer/user_script_set.cc @@ -109,15 +109,15 @@ bool UserScriptSet::UpdateUserScripts(base::SharedMemoryHandle shared_memory, return false; // Unpickle scripts. - size_t num_scripts = 0; + uint32_t num_scripts = 0; base::Pickle pickle(reinterpret_cast<char*>(shared_memory_->memory()), pickle_size); base::PickleIterator iter(pickle); - CHECK(iter.ReadSizeT(&num_scripts)); + CHECK(iter.ReadUInt32(&num_scripts)); scripts_.clear(); scripts_.reserve(num_scripts); - for (size_t i = 0; i < num_scripts; ++i) { + for (uint32_t i = 0; i < num_scripts; ++i) { scoped_ptr<UserScript> script(new UserScript()); script->Unpickle(pickle, &iter); |