diff options
author | brettw <brettw@chromium.org> | 2015-07-06 16:53:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-06 23:54:14 +0000 |
commit | 8cc24ae2b51f9db4a16011eb1ab7dbfca0eb6d54 (patch) | |
tree | 876a4d239206096f180630fc3657a1aa58a74630 /extensions/common/manifest_handlers | |
parent | f359166a9a5dc5c4ea15b0b718b643fc06d3c870 (diff) | |
download | chromium_src-8cc24ae2b51f9db4a16011eb1ab7dbfca0eb6d54.zip chromium_src-8cc24ae2b51f9db4a16011eb1ab7dbfca0eb6d54.tar.gz chromium_src-8cc24ae2b51f9db4a16011eb1ab7dbfca0eb6d54.tar.bz2 |
Replace remaining Tokenize calls to SplitString
SplitString is now more general and does the job of Tokenize with specific parameters.
The biggest change is in time_util.cc where the old return pattern better matched how the code was structured. With the new style the conditionals are more nested.
Some simple cases were changed to StringPieces when copies were not required.
BUG=506920, 506255
Review URL: https://codereview.chromium.org/1219263002
Cr-Commit-Position: refs/heads/master@{#337520}
Diffstat (limited to 'extensions/common/manifest_handlers')
-rw-r--r-- | extensions/common/manifest_handlers/shared_module_info.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/extensions/common/manifest_handlers/shared_module_info.cc b/extensions/common/manifest_handlers/shared_module_info.cc index 70f6ea9..99efe88 100644 --- a/extensions/common/manifest_handlers/shared_module_info.cc +++ b/extensions/common/manifest_handlers/shared_module_info.cc @@ -7,6 +7,7 @@ #include "base/lazy_instance.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/version.h" @@ -50,8 +51,8 @@ SharedModuleInfo::~SharedModuleInfo() { void SharedModuleInfo::ParseImportedPath(const std::string& path, std::string* import_id, std::string* import_relative_path) { - std::vector<std::string> tokens; - Tokenize(path, std::string("/"), &tokens); + std::vector<std::string> tokens = base::SplitString( + path, "/", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); if (tokens.size() > 2 && tokens[0] == kModulesDir && crx_file::id_util::IdIsValid(tokens[1])) { *import_id = tokens[1]; @@ -63,8 +64,8 @@ void SharedModuleInfo::ParseImportedPath(const std::string& path, // static bool SharedModuleInfo::IsImportedPath(const std::string& path) { - std::vector<std::string> tokens; - Tokenize(path, std::string("/"), &tokens); + std::vector<std::string> tokens = base::SplitString( + path, "/", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); if (tokens.size() > 2 && tokens[0] == kModulesDir && crx_file::id_util::IdIsValid(tokens[1])) { return true; |