diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 00:21:39 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 00:21:39 +0000 |
commit | f4ebe772e28369908c70e2e79f052d043c6f8eeb (patch) | |
tree | 8abbccc21509118c1228bc116a6f0f250759a801 | |
parent | 11e45efce9cc17e1b2b76e6a636cc63b2c021324 (diff) | |
download | chromium_src-f4ebe772e28369908c70e2e79f052d043c6f8eeb.zip chromium_src-f4ebe772e28369908c70e2e79f052d043c6f8eeb.tar.gz chromium_src-f4ebe772e28369908c70e2e79f052d043c6f8eeb.tar.bz2 |
Move string tokenizer to base/strings.
BUG=
Review URL: https://codereview.chromium.org/12087091
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180211 0039d316-1c4b-4281-b951-d872f2087c98
66 files changed, 190 insertions, 190 deletions
diff --git a/base/base.gyp b/base/base.gyp index 183955e..edcc721 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -529,9 +529,9 @@ 'string_number_conversions_unittest.cc', 'string_piece_unittest.cc', 'string_split_unittest.cc', - 'string_tokenizer_unittest.cc', 'string_util_unittest.cc', 'stringprintf_unittest.cc', + 'strings/string_tokenizer_unittest.cc', 'strings/stringize_macros_unittest.cc', 'synchronization/cancellation_flag_unittest.cc', 'synchronization/condition_variable_unittest.cc', diff --git a/base/base.gypi b/base/base.gypi index 6689ceb..57107f4 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -390,7 +390,6 @@ 'string_piece.h', 'string_split.cc', 'string_split.h', - 'string_tokenizer.h', 'string_util.cc', 'string_util.h', 'string_util_posix.h', @@ -399,6 +398,7 @@ 'string16.h', 'stringprintf.cc', 'stringprintf.h', + 'strings/string_tokenizer.h', 'strings/stringize_macros.h', 'supports_user_data.cc', 'supports_user_data.h', diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc index 411da1d..69e9c600 100644 --- a/base/debug/trace_event_impl.cc +++ b/base/debug/trace_event_impl.cc @@ -14,9 +14,9 @@ #include "base/memory/singleton.h" #include "base/process_util.h" #include "base/stl_util.h" -#include "base/stringprintf.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "base/sys_info.h" #include "base/third_party/dynamic_annotations/dynamic_annotations.h" #include "base/threading/platform_thread.h" @@ -162,7 +162,7 @@ TraceEvent::TraceEvent(int thread_id, } if (alloc_size) { - parameter_copy_storage_ = new base::RefCountedString; + parameter_copy_storage_ = new RefCountedString; parameter_copy_storage_->data().resize(alloc_size); char* ptr = string_as_array(¶meter_copy_storage_->data()); const char* end = ptr + alloc_size; @@ -279,7 +279,7 @@ void TraceEvent::AppendAsJSON(std::string* out) const { TraceResultBuffer::OutputCallback TraceResultBuffer::SimpleOutput::GetCallback() { - return base::Bind(&SimpleOutput::Append, base::Unretained(this)); + return Bind(&SimpleOutput::Append, Unretained(this)); } void TraceResultBuffer::SimpleOutput::Append( @@ -365,7 +365,7 @@ TraceLog::TraceLog() #if defined(OS_NACL) // NaCl shouldn't expose the process id. SetProcessID(0); #else - SetProcessID(static_cast<int>(base::GetCurrentProcId())); + SetProcessID(static_cast<int>(GetCurrentProcId())); #endif } @@ -442,7 +442,7 @@ const unsigned char* TraceLog::GetCategoryEnabledInternal(const char* name) { // Don't hold on to the name pointer, so that we can create categories // with strings not known at compile time (this is required by // SetWatchEvent). - const char* new_name = base::strdup(name); + const char* new_name = strdup(name); ANNOTATE_LEAKING_OBJECT_PTR(new_name); g_categories[new_index] = new_name; DCHECK(!g_category_enabled[new_index]); @@ -657,7 +657,7 @@ void TraceLog::AddTraceEvent(char phase, if (new_name != g_current_thread_name.Get().Get() && new_name && *new_name) { g_current_thread_name.Get().Set(new_name); - base::hash_map<int, std::string>::iterator existing_name = + hash_map<int, std::string>::iterator existing_name = thread_names_.find(thread_id); if (existing_name == thread_names_.end()) { // This is a new thread id, and a new name. @@ -665,7 +665,7 @@ void TraceLog::AddTraceEvent(char phase, } else { // This is a thread id that we've seen before, but potentially with a // new name. - std::vector<base::StringPiece> existing_names; + std::vector<StringPiece> existing_names; Tokenize(existing_name->second, ",", &existing_names); bool found = std::find(existing_names.begin(), existing_names.end(), @@ -756,7 +756,7 @@ void TraceLog::CancelWatchEvent() { void TraceLog::AddThreadNameMetadataEvents() { lock_.AssertAcquired(); - for(base::hash_map<int, std::string>::iterator it = thread_names_.begin(); + for(hash_map<int, std::string>::iterator it = thread_names_.begin(); it != thread_names_.end(); it++) { if (!it->second.empty()) { diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc index 11937f0..06077a8 100644 --- a/base/process_util_linux.cc +++ b/base/process_util_linux.cc @@ -14,11 +14,13 @@ #include "base/logging.h" #include "base/string_number_conversions.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/sys_info.h" #include "base/threading/thread_restrictions.h" +namespace base { + namespace { enum ParsingState { @@ -31,7 +33,7 @@ const char kStatFile[] = "stat"; // Returns a FilePath to "/proc/pid". FilePath GetProcPidDir(pid_t pid) { - return FilePath(kProcDir).Append(base::IntToString(pid)); + return FilePath(kProcDir).Append(IntToString(pid)); } // Fields from /proc/<pid>/stat, 0-based. See man 5 proc. @@ -53,7 +55,7 @@ enum ProcStatsFields { bool ReadProcStats(pid_t pid, std::string* buffer) { buffer->clear(); // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; FilePath stat_file = GetProcPidDir(pid).Append(kStatFile); if (!file_util::ReadFileToString(stat_file, buffer)) { @@ -98,7 +100,7 @@ bool ParseProcStats(const std::string& stats_data, // Split the rest. std::vector<std::string> other_stats; - base::SplitString(stats_data.substr(close_parens_idx + 2), ' ', &other_stats); + SplitString(stats_data.substr(close_parens_idx + 2), ' ', &other_stats); for (size_t i = 0; i < other_stats.size(); ++i) proc_stats->push_back(other_stats[i]); return true; @@ -113,7 +115,7 @@ int GetProcStatsFieldAsInt(const std::vector<std::string>& proc_stats, CHECK_LT(static_cast<size_t>(field_num), proc_stats.size()); int value; - return base::StringToInt(proc_stats[field_num], &value) ? value : 0; + return StringToInt(proc_stats[field_num], &value) ? value : 0; } // Same as GetProcStatsFieldAsInt(), but for size_t values. @@ -123,7 +125,7 @@ size_t GetProcStatsFieldAsSizeT(const std::vector<std::string>& proc_stats, CHECK_LT(static_cast<size_t>(field_num), proc_stats.size()); size_t value; - return base::StringToSizeT(proc_stats[field_num], &value) ? value : 0; + return StringToSizeT(proc_stats[field_num], &value) ? value : 0; } // Convenience wrapper around GetProcStatsFieldAsInt(), ParseProcStats() and @@ -175,7 +177,7 @@ std::string GetProcStatsFieldAsString( // delimiter. bool GetProcCmdline(pid_t pid, std::vector<std::string>* proc_cmd_line_args) { // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; FilePath cmd_line_file = GetProcPidDir(pid).Append("cmdline"); std::string cmd_line; @@ -204,7 +206,7 @@ pid_t ProcDirSlotToPid(const char* d_name) { // Read the process's command line. pid_t pid; std::string pid_string(d_name); - if (!base::StringToInt(pid_string, &pid)) { + if (!StringToInt(pid_string, &pid)) { NOTREACHED(); return 0; } @@ -230,12 +232,12 @@ int GetProcessCPU(pid_t pid) { continue; // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; std::string stat; FilePath stat_path = task_path.Append(ent->d_name).Append(kStatFile); if (file_util::ReadFileToString(stat_path, &stat)) { - int cpu = base::ParseProcStatCPU(stat); + int cpu = ParseProcStatCPU(stat); if (cpu > 0) total_cpu += cpu; } @@ -252,14 +254,14 @@ size_t ReadProcStatusAndGetFieldAsSizeT(pid_t pid, const std::string& field) { std::string status; { // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; if (!file_util::ReadFileToString(stat_file, &status)) return 0; } StringTokenizer tokenizer(status, ":\n"); ParsingState state = KEY_NAME; - base::StringPiece last_key_name; + StringPiece last_key_name; while (tokenizer.GetNext()) { switch (state) { case KEY_NAME: @@ -274,13 +276,13 @@ size_t ReadProcStatusAndGetFieldAsSizeT(pid_t pid, const std::string& field) { std::string value_str_trimmed; TrimWhitespaceASCII(value_str, TRIM_ALL, &value_str_trimmed); std::vector<std::string> split_value_str; - base::SplitString(value_str_trimmed, ' ', &split_value_str); + SplitString(value_str_trimmed, ' ', &split_value_str); if (split_value_str.size() != 2 || split_value_str[1] != "kB") { NOTREACHED(); return 0; } size_t value; - if (!base::StringToSizeT(split_value_str[0], &value)) { + if (!StringToSizeT(split_value_str[0], &value)) { NOTREACHED(); return 0; } @@ -296,8 +298,6 @@ size_t ReadProcStatusAndGetFieldAsSizeT(pid_t pid, const std::string& field) { } // namespace -namespace base { - #if defined(USE_LINUX_BREAKPAD) size_t g_oom_size = 0U; #endif @@ -460,20 +460,20 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const { { FilePath statm_file = GetProcPidDir(process_).Append("statm"); // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; bool ret = file_util::ReadFileToString(statm_file, &statm); if (!ret || statm.length() == 0) return false; } std::vector<std::string> statm_vec; - base::SplitString(statm, ' ', &statm_vec); + SplitString(statm, ' ', &statm_vec); if (statm_vec.size() != 7) return false; // Not the format we expect. int statm_rss, statm_shared; - base::StringToInt(statm_vec[1], &statm_rss); - base::StringToInt(statm_vec[2], &statm_shared); + StringToInt(statm_vec[1], &statm_rss); + StringToInt(statm_vec[2], &statm_shared); ws_usage->priv = (statm_rss - statm_shared) * page_size_kb; ws_usage->shared = statm_shared * page_size_kb; @@ -531,7 +531,7 @@ double ProcessMetrics::GetCPUUsage() { // in your kernel configuration. bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const { // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; std::string proc_io_contents; FilePath io_file = GetProcPidDir(process_).Append("io"); @@ -553,16 +553,16 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const { case KEY_VALUE: DCHECK(!last_key_name.empty()); if (last_key_name == "syscr") { - base::StringToInt64(tokenizer.token_piece(), + StringToInt64(tokenizer.token_piece(), reinterpret_cast<int64*>(&(*io_counters).ReadOperationCount)); } else if (last_key_name == "syscw") { - base::StringToInt64(tokenizer.token_piece(), + StringToInt64(tokenizer.token_piece(), reinterpret_cast<int64*>(&(*io_counters).WriteOperationCount)); } else if (last_key_name == "rchar") { - base::StringToInt64(tokenizer.token_piece(), + StringToInt64(tokenizer.token_piece(), reinterpret_cast<int64*>(&(*io_counters).ReadTransferCount)); } else if (last_key_name == "wchar") { - base::StringToInt64(tokenizer.token_piece(), + StringToInt64(tokenizer.token_piece(), reinterpret_cast<int64*>(&(*io_counters).WriteTransferCount)); } state = KEY_NAME; @@ -577,7 +577,7 @@ ProcessMetrics::ProcessMetrics(ProcessHandle process) last_time_(0), last_system_time_(0), last_cpu_(0) { - processor_count_ = base::SysInfo::NumberOfProcessors(); + processor_count_ = SysInfo::NumberOfProcessors(); } @@ -630,7 +630,7 @@ SystemMemoryInfoKB::SystemMemoryInfoKB() bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { // Synchronously reading files in /proc is safe. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; // Used memory is: total - free - buffers - caches FilePath meminfo_file("/proc/meminfo"); @@ -657,15 +657,15 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { DCHECK_EQ(meminfo_fields[kMemActiveFileIndex-1], "Active(file):"); DCHECK_EQ(meminfo_fields[kMemInactiveFileIndex-1], "Inactive(file):"); - base::StringToInt(meminfo_fields[kMemTotalIndex], &meminfo->total); - base::StringToInt(meminfo_fields[kMemFreeIndex], &meminfo->free); - base::StringToInt(meminfo_fields[kMemBuffersIndex], &meminfo->buffers); - base::StringToInt(meminfo_fields[kMemCachedIndex], &meminfo->cached); - base::StringToInt(meminfo_fields[kMemActiveAnonIndex], &meminfo->active_anon); - base::StringToInt(meminfo_fields[kMemInactiveAnonIndex], + StringToInt(meminfo_fields[kMemTotalIndex], &meminfo->total); + StringToInt(meminfo_fields[kMemFreeIndex], &meminfo->free); + StringToInt(meminfo_fields[kMemBuffersIndex], &meminfo->buffers); + StringToInt(meminfo_fields[kMemCachedIndex], &meminfo->cached); + StringToInt(meminfo_fields[kMemActiveAnonIndex], &meminfo->active_anon); + StringToInt(meminfo_fields[kMemInactiveAnonIndex], &meminfo->inactive_anon); - base::StringToInt(meminfo_fields[kMemActiveFileIndex], &meminfo->active_file); - base::StringToInt(meminfo_fields[kMemInactiveFileIndex], + StringToInt(meminfo_fields[kMemActiveFileIndex], &meminfo->active_file); + StringToInt(meminfo_fields[kMemInactiveFileIndex], &meminfo->inactive_file); #if defined(OS_CHROMEOS) // Chrome OS has a tweaked kernel that allows us to query Shmem, which is @@ -674,7 +674,7 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { // string. It always appears after "Cached:". for (size_t i = kMemCachedIndex+2; i < meminfo_fields.size(); i += 3) { if (meminfo_fields[i] == "Shmem:") { - base::StringToInt(meminfo_fields[i+1], &meminfo->shmem); + StringToInt(meminfo_fields[i+1], &meminfo->shmem); break; } } @@ -854,7 +854,7 @@ bool AdjustOOMScore(ProcessId process, int score) { // Attempt to write the newer oom_score_adj file first. FilePath oom_file = oom_path.AppendASCII("oom_score_adj"); if (file_util::PathExists(oom_file)) { - std::string score_str = base::IntToString(score); + std::string score_str = IntToString(score); DVLOG(1) << "Adjusting oom_score_adj of " << process << " to " << score_str; int score_len = static_cast<int>(score_str.length()); @@ -872,7 +872,7 @@ bool AdjustOOMScore(ProcessId process, int score) { const int kMaxOldOomScore = 15; int converted_score = score * kMaxOldOomScore / kMaxOomScore; - std::string score_str = base::IntToString(converted_score); + std::string score_str = IntToString(converted_score); DVLOG(1) << "Adjusting oom_adj of " << process << " to " << score_str; int score_len = static_cast<int>(score_str.length()); return (score_len == file_util::WriteFile(oom_file, diff --git a/base/string_tokenizer.h b/base/strings/string_tokenizer.h index c2307a5..791051a 100644 --- a/base/string_tokenizer.h +++ b/base/strings/string_tokenizer.h @@ -2,14 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_STRING_TOKENIZER_H_ -#define BASE_STRING_TOKENIZER_H_ +#ifndef BASE_STRINGS_STRING_TOKENIZER_H_ +#define BASE_STRINGS_STRING_TOKENIZER_H_ #include <algorithm> #include <string> #include "base/string_piece.h" +namespace base { + // StringTokenizerT is a simple string tokenizer class. It works like an // iterator that with each step (see the Advance method) updates members that // refer to the next token in the input string. The user may optionally @@ -253,4 +255,6 @@ typedef StringTokenizerT<std::wstring, std::wstring::const_iterator> WStringTokenizer; typedef StringTokenizerT<std::string, const char*> CStringTokenizer; -#endif // BASE_STRING_TOKENIZER_H_ +} // namespace base + +#endif // BASE_STRINGS_STRING_TOKENIZER_H_ diff --git a/base/string_tokenizer_unittest.cc b/base/strings/string_tokenizer_unittest.cc index 61841f2..d391845 100644 --- a/base/string_tokenizer_unittest.cc +++ b/base/strings/string_tokenizer_unittest.cc @@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "testing/gtest/include/gtest/gtest.h" using std::string; +namespace base { + namespace { TEST(StringTokenizerTest, Simple) { @@ -228,3 +230,5 @@ TEST(StringTokenizerTest, ParseQuotedString_EscapedQuotes2) { } } // namespace + +} // namespace base diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc index 92a3f0c..5d34954 100644 --- a/base/sys_info_chromeos.cc +++ b/base/sys_info_chromeos.cc @@ -10,7 +10,7 @@ #include "base/lazy_instance.h" #include "base/string_number_conversions.h" #include "base/string_piece.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread_restrictions.h" #include <execinfo.h> @@ -40,7 +40,7 @@ struct ChromeOSVersionNumbers { bool parsed; }; -static base::LazyInstance<ChromeOSVersionNumbers> +static LazyInstance<ChromeOSVersionNumbers> g_chrome_os_version_numbers = LAZY_INSTANCE_INITIALIZER; // static @@ -52,7 +52,7 @@ void SysInfo::OperatingSystemVersionNumbers(int32* major_version, // See http://code.google.com/p/chromium/issues/detail?id=60394 // Perhaps the caller ought to cache this? // Temporary allowing while we work the bug out. - base::ThreadRestrictions::ScopedAllowIO allow_io; + ThreadRestrictions::ScopedAllowIO allow_io; FilePath path(kLinuxStandardBaseReleaseFile); std::string contents; diff --git a/chrome/browser/character_encoding.cc b/chrome/browser/character_encoding.cc index c8bdb74..7875685 100644 --- a/chrome/browser/character_encoding.cc +++ b/chrome/browser/character_encoding.cc @@ -9,8 +9,8 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "content/public/browser/browser_thread.h" @@ -241,7 +241,7 @@ const int kDefaultEncodingMenusLength = arraysize(kDefaultEncodingMenus); void ParseEncodingListSeparatedWithComma( const std::string& encoding_list, std::vector<int>* const available_list, size_t maximum_size) { - StringTokenizer tokenizer(encoding_list, ","); + base::StringTokenizer tokenizer(encoding_list, ","); while (tokenizer.GetNext()) { int id = CharacterEncoding::GetCommandIdByCanonicalEncodingName( tokenizer.token()); diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 21ed3e8..78e9939 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -11,7 +11,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/path_service.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/utf_string_conversions.h" #include "chrome/app/breakpad_mac.h" #include "chrome/browser/browser_about_handler.h" @@ -1912,7 +1912,7 @@ bool ChromeContentBrowserClient::AllowPepperSocketAPI( (extension->GetType() == Manifest::TYPE_LEGACY_PACKAGED_APP || extension->GetType() == Manifest::TYPE_PLATFORM_APP); } else if (!allowed_list.empty()) { - StringTokenizer t(allowed_list, ","); + base::StringTokenizer t(allowed_list, ","); while (t.GetNext()) { if (t.token() == host) return true; diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc index 6230b79..0d5c6cc 100644 --- a/chrome/browser/chromeos/customization_document.cc +++ b/chrome/browser/chromeos/customization_document.cc @@ -10,7 +10,6 @@ #include "base/file_util.h" #include "base/json/json_reader.h" #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/time.h" #include "base/utf_string_conversions.h" diff --git a/chrome/browser/chromeos/system/name_value_pairs_parser.cc b/chrome/browser/chromeos/system/name_value_pairs_parser.cc index 88f1d48..2c89e7c 100644 --- a/chrome/browser/chromeos/system/name_value_pairs_parser.cc +++ b/chrome/browser/chromeos/system/name_value_pairs_parser.cc @@ -10,8 +10,8 @@ #include "base/logging.h" #include "base/process_util.h" #include "base/stl_util.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" namespace chromeos { // NOLINT namespace system { @@ -70,7 +70,7 @@ bool NameValuePairsParser::ParseNameValuePairsWithComments( const std::string& comment_delim) { bool all_valid = true; // Set up the pair tokenizer. - StringTokenizer pair_toks(in_string, delim); + base::StringTokenizer pair_toks(in_string, delim); pair_toks.set_quote_chars(kQuoteChars); // Process token pairs. while (pair_toks.GetNext()) { diff --git a/chrome/browser/chromeos/web_socket_proxy_controller.cc b/chrome/browser/chromeos/web_socket_proxy_controller.cc index 3e67336..4bcf211 100644 --- a/chrome/browser/chromeos/web_socket_proxy_controller.cc +++ b/chrome/browser/chromeos/web_socket_proxy_controller.cc @@ -15,7 +15,6 @@ #include "base/command_line.h" #include "base/lazy_instance.h" #include "base/message_loop.h" -#include "base/string_tokenizer.h" #include "base/threading/thread.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/web_socket_proxy.h" diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc index 7e89b5f..11e45fd 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc @@ -15,8 +15,8 @@ #include "base/base64.h" #include "base/basictypes.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/extensions/api/proxy/proxy_api_constants.h" @@ -480,7 +480,7 @@ DictionaryValue* CreatePacScriptDict( ListValue* TokenizeToStringList(const std::string& in, const std::string& delims) { ListValue* out = new ListValue; - StringTokenizer entries(in, delims); + base::StringTokenizer entries(in, delims); while (entries.GetNext()) out->Append(Value::CreateStringValue(entries.token())); return out; diff --git a/chrome/browser/extensions/extension_system.cc b/chrome/browser/extensions/extension_system.cc index 7a1d9e8..d09a0c3 100644 --- a/chrome/browser/extensions/extension_system.cc +++ b/chrome/browser/extensions/extension_system.cc @@ -8,7 +8,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/file_path.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings.h" #include "chrome/browser/extensions/api/alarms/alarm_manager.h" @@ -168,7 +168,7 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { if (command_line->HasSwitch(switches::kLoadComponentExtension)) { CommandLine::StringType path_list = command_line->GetSwitchValueNative( switches::kLoadComponentExtension); - StringTokenizerT<CommandLine::StringType, + base::StringTokenizerT<CommandLine::StringType, CommandLine::StringType::const_iterator> t(path_list, FILE_PATH_LITERAL(",")); while (t.GetNext()) { @@ -189,7 +189,7 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { if (command_line->HasSwitch(switches::kLoadExtension)) { CommandLine::StringType path_list = command_line->GetSwitchValueNative( switches::kLoadExtension); - StringTokenizerT<CommandLine::StringType, + base::StringTokenizerT<CommandLine::StringType, CommandLine::StringType::const_iterator> t(path_list, FILE_PATH_LITERAL(",")); while (t.GetNext()) { diff --git a/chrome/browser/google_apis/fake_drive_service.cc b/chrome/browser/google_apis/fake_drive_service.cc index 700975f..1ca7ca0 100644 --- a/chrome/browser/google_apis/fake_drive_service.cc +++ b/chrome/browser/google_apis/fake_drive_service.cc @@ -9,9 +9,9 @@ #include "base/message_loop.h" #include "base/string_number_conversions.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "base/utf_string_conversions.h" #include "chrome/browser/google_apis/drive_api_parser.h" #include "chrome/browser/google_apis/gdata_wapi_parser.h" @@ -30,7 +30,7 @@ namespace { // - Limited attribute search. Only "title:" is supported. bool EntryMatchWithQuery(const ResourceEntry& entry, const std::string& query) { - StringTokenizer tokenizer(query, " "); + base::StringTokenizer tokenizer(query, " "); tokenizer.set_quote_chars("\"'"); while (tokenizer.GetNext()) { std::string key, value; @@ -38,7 +38,7 @@ bool EntryMatchWithQuery(const ResourceEntry& entry, if (token.find(':') == std::string::npos) { TrimString(token, "\"'", &value); } else { - StringTokenizer key_value(token, ":"); + base::StringTokenizer key_value(token, ":"); key_value.set_quote_chars("\"'"); if (!key_value.GetNext()) return false; diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index a5dde8c..2e72c05 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -12,8 +12,8 @@ #include "base/memory/ref_counted_memory.h" #include "base/metrics/histogram.h" #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/diagnostics/sqlite_diagnostics.h" @@ -1146,7 +1146,7 @@ void ThumbnailDatabase::DatabaseStringToFaviconSizes( FaviconSizes* favicon_sizes) { bool parsing_errors = false; - StringTokenizer t(favicon_sizes_string, " "); + base::StringTokenizer t(favicon_sizes_string, " "); while (t.GetNext() && !parsing_errors) { int width, height = 0; parsing_errors |= !base::StringToInt(t.token(), &width); diff --git a/chrome/browser/importer/firefox_proxy_settings.cc b/chrome/browser/importer/firefox_proxy_settings.cc index 1771b1c..f92df2e 100644 --- a/chrome/browser/importer/firefox_proxy_settings.cc +++ b/chrome/browser/importer/firefox_proxy_settings.cc @@ -5,8 +5,8 @@ #include "chrome/browser/importer/firefox_proxy_settings.h" #include "base/file_path.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/values.h" #include "chrome/browser/importer/firefox_importer_utils.h" #include "net/proxy/proxy_config.h" @@ -210,7 +210,7 @@ bool FirefoxProxySettings::GetSettingsFromFile(const FilePath& pref_file, std::string proxy_bypass; if (dictionary.GetStringASCII(kNoProxyListKey, &proxy_bypass) && !proxy_bypass.empty()) { - StringTokenizer string_tok(proxy_bypass, ","); + base::StringTokenizer string_tok(proxy_bypass, ","); while (string_tok.GetNext()) { std::string token = string_tok.token(); TrimWhitespaceASCII(token, TRIM_ALL, &token); diff --git a/chrome/browser/language_usage_metrics.cc b/chrome/browser/language_usage_metrics.cc index b53c25f..ae4faa0 100644 --- a/chrome/browser/language_usage_metrics.cc +++ b/chrome/browser/language_usage_metrics.cc @@ -7,8 +7,8 @@ #include <algorithm> #include "base/metrics/histogram.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" namespace { void RecordAcceptLanguage(Language language) { @@ -43,7 +43,7 @@ void LanguageUsageMetrics::RecordApplicationLanguage( void LanguageUsageMetrics::ParseAcceptLanguages( const std::string& accept_languages, std::set<Language>* languages) { languages->clear(); - StringTokenizer locales(accept_languages, ","); + base::StringTokenizer locales(accept_languages, ","); while (locales.GetNext()) { const Language language = ToLanguage(locales.token()); if (language != UNKNOWN_LANGUAGE) { @@ -54,7 +54,7 @@ void LanguageUsageMetrics::ParseAcceptLanguages( // static Language LanguageUsageMetrics::ToLanguage(const std::string& locale) { - StringTokenizer parts(locale, "-_"); + base::StringTokenizer parts(locale, "-_"); if (!parts.GetNext()) { return UNKNOWN_LANGUAGE; } diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc index 069e033..c0b7616 100644 --- a/chrome/browser/metrics/thread_watcher.cc +++ b/chrome/browser/metrics/thread_watcher.cc @@ -12,7 +12,7 @@ #include "base/lazy_instance.h" #include "base/string_number_conversions.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" #include "chrome/browser/metrics/metrics_service.h" @@ -543,7 +543,7 @@ void ThreadWatcherList::ParseCommandLine( command_line.GetSwitchValueASCII(switches::kCrashOnHangThreads); has_command_line_overwrite = true; } - StringTokenizer tokens(crash_on_hang_thread_names, ","); + base::StringTokenizer tokens(crash_on_hang_thread_names, ","); std::vector<std::string> values; while (tokens.GetNext()) { const std::string& token = tokens.token(); diff --git a/chrome/browser/metrics/thread_watcher_unittest.cc b/chrome/browser/metrics/thread_watcher_unittest.cc index 27d893e..d39e23c 100644 --- a/chrome/browser/metrics/thread_watcher_unittest.cc +++ b/chrome/browser/metrics/thread_watcher_unittest.cc @@ -12,7 +12,7 @@ #include "base/message_loop_proxy.h" #include "base/string_number_conversions.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/synchronization/condition_variable.h" #include "base/synchronization/lock.h" #include "base/threading/platform_thread.h" @@ -351,7 +351,7 @@ TEST_F(ThreadWatcherTest, CommandLineArgs) { atoi(crash_on_hang_seconds.c_str())); // Check ThreadWatcherTestList has the right crash_on_hang_thread_names. - StringTokenizer tokens(crash_on_hang_thread_names, ","); + base::StringTokenizer tokens(crash_on_hang_thread_names, ","); std::vector<std::string> values; while (tokens.GetNext()) { const std::string& token = tokens.token(); diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 46dbd95..0cbf0ba5 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -15,7 +15,6 @@ #include "base/path_service.h" #include "base/prefs/json_pref_store.h" #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/synchronization/waitable_event.h" diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index 82519b8..d1e9f42 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -26,7 +26,7 @@ #include "base/posix/eintr_wrapper.h" #include "base/process_util.h" #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "base/utf_string_conversions.h" @@ -454,7 +454,7 @@ bool GetDesktopShortcutTemplate(base::Environment* env, std::string xdg_data_dirs; if (env->GetVar("XDG_DATA_DIRS", &xdg_data_dirs) && !xdg_data_dirs.empty()) { - StringTokenizer tokenizer(xdg_data_dirs, ":"); + base::StringTokenizer tokenizer(xdg_data_dirs, ":"); while (tokenizer.GetNext()) { FilePath data_dir(tokenizer.token()); search_paths.push_back(data_dir); @@ -583,7 +583,7 @@ std::string GetDesktopFileContents( if (exec_c_string) { std::string exec_string(exec_c_string); g_free(exec_c_string); - StringTokenizer exec_tokenizer(exec_string, " "); + base::StringTokenizer exec_tokenizer(exec_string, " "); std::string final_path; while (exec_tokenizer.GetNext() && exec_tokenizer.token() != "%U") { diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index 167664d..c7fcb79 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -14,7 +14,7 @@ #include "base/i18n/rtl.h" #include "base/memory/singleton.h" #include "base/string_piece.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" @@ -406,8 +406,8 @@ void BrowserTitlebar::BuildButtons(const std::string& button_string) { top_padding_right_ = NULL; bool left_side = true; - StringTokenizer tokenizer(button_string, ":,"); - tokenizer.set_options(StringTokenizer::RETURN_DELIMS); + base::StringTokenizer tokenizer(button_string, ":,"); + tokenizer.set_options(base::StringTokenizer::RETURN_DELIMS); int left_count = 0; int right_count = 0; while (tokenizer.GetNext()) { diff --git a/chrome/common/auto_start_linux.cc b/chrome/common/auto_start_linux.cc index 6041f0e..142086a 100644 --- a/chrome/common/auto_start_linux.cc +++ b/chrome/common/auto_start_linux.cc @@ -9,7 +9,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/nix/xdg_util.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" namespace { @@ -75,7 +75,7 @@ bool AutoStart::GetAutostartFileValue(const std::string& autostart_filename, std::string contents; if (!GetAutostartFileContents(autostart_filename, &contents)) return false; - StringTokenizer tokenizer(contents, "\n"); + base::StringTokenizer tokenizer(contents, "\n"); std::string token = value_name + "="; while (tokenizer.GetNext()) { if (tokenizer.token().substr(0, token.length()) == token) { diff --git a/chrome/common/extensions/csp_validator.cc b/chrome/common/extensions/csp_validator.cc index 814026c..e6a7677 100644 --- a/chrome/common/extensions/csp_validator.cc +++ b/chrome/common/extensions/csp_validator.cc @@ -5,8 +5,8 @@ #include "chrome/common/extensions/csp_validator.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" namespace extensions { @@ -35,7 +35,8 @@ struct DirectiveStatus { bool is_secure; }; -bool HasOnlySecureTokens(StringTokenizer& tokenizer, Manifest::Type type) { +bool HasOnlySecureTokens(base::StringTokenizer& tokenizer, + Manifest::Type type) { while (tokenizer.GetNext()) { std::string source = tokenizer.token(); StringToLowerASCII(&source); @@ -89,7 +90,7 @@ bool HasOnlySecureTokens(StringTokenizer& tokenizer, Manifest::Type type) { // Returns true if |directive_name| matches |status.directive_name|. bool UpdateStatus(const std::string& directive_name, - StringTokenizer& tokenizer, + base::StringTokenizer& tokenizer, DirectiveStatus* status, Manifest::Type type) { if (status->seen_in_policy) @@ -124,7 +125,7 @@ bool ContentSecurityPolicyIsSecure(const std::string& policy, for (size_t i = 0; i < directives.size(); ++i) { std::string& input = directives[i]; - StringTokenizer tokenizer(input, " \t\r\n"); + base::StringTokenizer tokenizer(input, " \t\r\n"); if (!tokenizer.GetNext()) continue; @@ -164,7 +165,7 @@ bool ContentSecurityPolicyIsSandboxed( for (size_t i = 0; i < directives.size(); ++i) { std::string& input = directives[i]; - StringTokenizer tokenizer(input, " \t\r\n"); + base::StringTokenizer tokenizer(input, " \t\r\n"); if (!tokenizer.GetNext()) continue; diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index e105b2c..fc32fdb 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -11,7 +11,6 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/path_service.h" -#include "base/string_tokenizer.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/common/child_process_logging.h" diff --git a/chrome_frame/html_utils.cc b/chrome_frame/html_utils.cc index 3192f14..ef49b06 100644 --- a/chrome_frame/html_utils.cc +++ b/chrome_frame/html_utils.cc @@ -8,8 +8,8 @@ #include <urlmon.h> #include "base/string_util.h" -#include "base/string_tokenizer.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "chrome/common/chrome_version_info.h" #include "chrome_frame/utils.h" #include "net/base/net_util.h" @@ -82,8 +82,8 @@ bool HTMLScanner::StringRange::GetTagAttribute(const wchar_t* attribute_name, // from string_util.h. std::string search_name_ascii(WideToASCII(attribute_name)); - WStringTokenizer tokenizer(start_, end_, L" =/"); - tokenizer.set_options(WStringTokenizer::RETURN_DELIMS); + base::WStringTokenizer tokenizer(start_, end_, L" =/"); + tokenizer.set_options(base::WStringTokenizer::RETURN_DELIMS); // Set up the quote chars so that we get quoted attribute values as single // tokens. diff --git a/chrome_frame/test/test_server.cc b/chrome_frame/test/test_server.cc index 83946c6..e580476 100644 --- a/chrome_frame/test/test_server.cc +++ b/chrome_frame/test/test_server.cc @@ -37,7 +37,7 @@ void Request::ParseHeaders(const std::string& headers) { if (pos != std::string::npos) { headers_ = headers.substr(pos + 2); - StringTokenizer tokenizer(headers.begin(), headers.begin() + pos, " "); + base::StringTokenizer tokenizer(headers.begin(), headers.begin() + pos, " "); std::string* parse[] = { &method_, &path_, &version_ }; int field = 0; while (tokenizer.GetNext() && field < arraysize(parse)) { diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index a4814fea..7a9dc39 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -17,9 +17,9 @@ #include "base/path_service.h" #include "base/string_number_conversions.h" #include "base/string_piece.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread_local.h" #include "base/utf_string_conversions.h" #include "base/win/registry.h" @@ -1401,7 +1401,7 @@ bool ChromeFrameUrl::ParseAttachExternalTabUrl() { } attach_to_external_tab_ = true; - StringTokenizer tokenizer(query, "&"); + base::StringTokenizer tokenizer(query, "&"); // Skip over kChromeAttachExternalTabPrefix tokenizer.GetNext(); // Read the following items in order. diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc index 6ed6d7d..c0497ad6 100644 --- a/chromeos/network/network_util.cc +++ b/chromeos/network/network_util.cc @@ -4,8 +4,8 @@ #include "chromeos/network/network_util.h" -#include "base/string_tokenizer.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" namespace chromeos { @@ -51,7 +51,7 @@ std::string PrefixLengthToNetmask(int32 prefix_length) { int32 NetmaskToPrefixLength(const std::string& netmask) { int count = 0; int prefix_length = 0; - StringTokenizer t(netmask, "."); + base::StringTokenizer t(netmask, "."); while (t.GetNext()) { // If there are more than 4 numbers, then it's invalid. if (count == 4) diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc index ac6ef27..1a2fbd0 100644 --- a/content/app/android/library_loader_hooks.cc +++ b/content/app/android/library_loader_hooks.cc @@ -15,7 +15,6 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/tracked_objects.h" #include "content/app/android/app_jni_registrar.h" diff --git a/content/browser/devtools/devtools_netlog_observer.cc b/content/browser/devtools/devtools_netlog_observer.cc index f65bc42..92390aa 100644 --- a/content/browser/devtools/devtools_netlog_observer.cc +++ b/content/browser/devtools/devtools_netlog_observer.cc @@ -4,7 +4,6 @@ #include "content/browser/devtools/devtools_netlog_observer.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/values.h" #include "content/public/browser/browser_thread.h" diff --git a/content/common/android/address_parser_internal.h b/content/common/android/address_parser_internal.h index 81fc3e3..f236afc 100644 --- a/content/common/android/address_parser_internal.h +++ b/content/common/android/address_parser_internal.h @@ -7,7 +7,7 @@ #include <vector> -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "content/common/content_export.h" namespace content { @@ -63,7 +63,7 @@ class CONTENT_EXPORT HouseNumberParser { }; typedef std::vector<Word> WordList; -typedef StringTokenizerT<string16, string16::const_iterator> +typedef base::StringTokenizerT<string16, string16::const_iterator> String16Tokenizer; // These are exposed for tests. diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index c1f6f67..b0fb4ba 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc @@ -15,7 +15,6 @@ #include "base/bind.h" #include "base/lazy_instance.h" -#include "base/string_tokenizer.h" #include "base/command_line.h" #include "base/debug/trace_event.h" #include "base/logging.h" diff --git a/content/gpu/gpu_info_collector_linux.cc b/content/gpu/gpu_info_collector_linux.cc index e96d251..06d2ae4 100644 --- a/content/gpu/gpu_info_collector_linux.cc +++ b/content/gpu/gpu_info_collector_linux.cc @@ -15,8 +15,8 @@ #include "base/message_loop.h" #include "base/string_piece.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "library_loaders/libpci.h" #include "third_party/libXNVCtrl/NVCtrl.h" #include "third_party/libXNVCtrl/NVCtrlLib.h" @@ -48,7 +48,7 @@ std::string CollectDriverVersionATI() { std::string contents; if (!file_util::ReadFileToString(ati_file_path, &contents)) return std::string(); - StringTokenizer t(contents, "\r\n"); + base::StringTokenizer t(contents, "\r\n"); while (t.GetNext()) { std::string line = t.token(); if (StartsWithASCII(line, "ReleaseVersion=", true)) { diff --git a/content/shell/android/browsertests_apk/content_browser_tests_android.cc b/content/shell/android/browsertests_apk/content_browser_tests_android.cc index 4ed222d4..83f24f6 100644 --- a/content/shell/android/browsertests_apk/content_browser_tests_android.cc +++ b/content/shell/android/browsertests_apk/content_browser_tests_android.cc @@ -16,9 +16,9 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "content/public/app/android_library_loader_hooks.h" #include "content/shell/android/shell_jni_registrar.h" #include "jni/ContentBrowserTestsActivity_jni.h" @@ -30,7 +30,7 @@ namespace { void ParseArgsFromString(const std::string& command_line, std::vector<std::string>* args) { - StringTokenizer tokenizer(command_line, kWhitespaceASCII); + base::StringTokenizer tokenizer(command_line, kWhitespaceASCII); tokenizer.set_quote_chars("\""); while (tokenizer.GetNext()) { std::string token; diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc index fadd17b..13cc469 100644 --- a/gpu/command_buffer/service/test_helper.cc +++ b/gpu/command_buffer/service/test_helper.cc @@ -4,11 +4,11 @@ #include "gpu/command_buffer/service/test_helper.h" -#include <string> #include <algorithm> +#include <string> #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "gpu/command_buffer/common/types.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/program_manager.h" @@ -143,7 +143,7 @@ void TestHelper::SetupTextureManagerInitExpectations( bool ext_image_external = false; bool arb_texture_rectangle = false; - CStringTokenizer t(extensions, extensions + strlen(extensions), " "); + base::CStringTokenizer t(extensions, extensions + strlen(extensions), " "); while (t.GetNext()) { if (t.token() == "GL_OES_EGL_image_external") { ext_image_external = true; @@ -196,7 +196,7 @@ void TestHelper::SetupTextureManagerDestructionExpectations( bool ext_image_external = false; bool arb_texture_rectangle = false; - CStringTokenizer t(extensions, extensions + strlen(extensions), " "); + base::CStringTokenizer t(extensions, extensions + strlen(extensions), " "); while (t.GetNext()) { if (t.token() == "GL_OES_EGL_image_external") { ext_image_external = true; diff --git a/net/base/host_mapping_rules.cc b/net/base/host_mapping_rules.cc index effea59..776d4d3 100644 --- a/net/base/host_mapping_rules.cc +++ b/net/base/host_mapping_rules.cc @@ -6,8 +6,8 @@ #include "base/logging.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "net/base/host_port_pair.h" #include "net/base/net_util.h" @@ -100,7 +100,7 @@ void HostMappingRules::SetRulesFromString(const std::string& rules_string) { exclusion_rules_.clear(); map_rules_.clear(); - StringTokenizer rules(rules_string, ","); + base::StringTokenizer rules(rules_string, ","); while (rules.GetNext()) { bool ok = AddRuleFromString(rules.token()); LOG_IF(ERROR, !ok) << "Failed parsing rule: " << rules.token(); diff --git a/net/base/mapped_host_resolver.cc b/net/base/mapped_host_resolver.cc index dce9558..2c164f4 100644 --- a/net/base/mapped_host_resolver.cc +++ b/net/base/mapped_host_resolver.cc @@ -4,7 +4,6 @@ #include "net/base/mapped_host_resolver.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "net/base/host_port_pair.h" #include "net/base/net_errors.h" diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 05e59e3..df6bbd0 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -12,16 +12,16 @@ #if defined(OS_WIN) #include <windows.h> -#include <winsock2.h> #include <iphlpapi.h> +#include <winsock2.h> #pragma comment(lib, "iphlpapi.lib") #elif defined(OS_POSIX) #include <fcntl.h> #if !defined(OS_ANDROID) #include <ifaddrs.h> #endif -#include <netdb.h> #include <net/if.h> +#include <netdb.h> #include <netinet/in.h> #endif @@ -42,12 +42,12 @@ #include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "base/synchronization/lock.h" -#include "base/sys_string_conversions.h" #include "base/sys_byteorder.h" +#include "base/sys_string_conversions.h" #include "base/time.h" #include "base/utf_offset_string_conversions.h" #include "base/utf_string_conversions.h" @@ -397,7 +397,7 @@ bool IsIDNComponentSafe(const char16* str, // the remainder. component_characters.removeAll(common_characters); - StringTokenizer t(languages, ","); + base::StringTokenizer t(languages, ","); while (t.GetNext()) { if (IsComponentCoveredByLang(component_characters, t.token())) return true; diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc index 0829a71..f66ae97 100644 --- a/net/base/net_util_posix.cc +++ b/net/base/net_util_posix.cc @@ -9,8 +9,8 @@ #include "base/file_path.h" #include "base/logging.h" #include "base/posix/eintr_wrapper.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread_restrictions.h" #include "googleurl/src/gurl.h" #include "net/base/escape.h" @@ -66,10 +66,10 @@ bool FileURLToFilePath(const GURL& url, FilePath* path) { bool GetNetworkList(NetworkInterfaceList* networks) { #if defined(OS_ANDROID) std::string network_list = android::GetNetworkList(); - StringTokenizer network_interfaces(network_list, ";"); + base::StringTokenizer network_interfaces(network_list, ";"); while (network_interfaces.GetNext()) { std::string network_item = network_interfaces.token(); - StringTokenizer network_tokenizer(network_item, ","); + base::StringTokenizer network_tokenizer(network_item, ","); std::string name; if (!network_tokenizer.GetNext()) continue; diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc index 3dcb2ae..8a83e41 100644 --- a/net/base/x509_certificate_win.cc +++ b/net/base/x509_certificate_win.cc @@ -10,7 +10,6 @@ #include "base/memory/scoped_ptr.h" #include "base/pickle.h" #include "base/sha1.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "crypto/capi_util.h" diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc index d02b511..439f4c8 100644 --- a/net/cookies/cookie_monster_unittest.cc +++ b/net/cookies/cookie_monster_unittest.cc @@ -14,7 +14,7 @@ #include "base/metrics/histogram.h" #include "base/metrics/histogram_samples.h" #include "base/stringprintf.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread.h" #include "base/time.h" #include "googleurl/src/gurl.h" diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h index 51c389d..0b742b3 100644 --- a/net/cookies/cookie_store_unittest.h +++ b/net/cookies/cookie_store_unittest.h @@ -7,7 +7,7 @@ #include "base/bind.h" #include "base/message_loop.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread.h" #include "googleurl/src/gurl.h" #include "net/cookies/cookie_monster.h" @@ -252,7 +252,7 @@ class CookieStoreTest : public testing::Test { // Returns a set of strings of type "name=value". Fails in case of duplicate. std::set<std::string> TokenizeCookieLine(const std::string& line) { std::set<std::string> tokens; - StringTokenizer tokenizer(line, " ;"); + base::StringTokenizer tokenizer(line, " ;"); while (tokenizer.GetNext()) EXPECT_TRUE(tokens.insert(tokenizer.token()).second); return tokens; diff --git a/net/cookies/cookie_util.cc b/net/cookies/cookie_util.cc index 6cd3b29..efea441 100644 --- a/net/cookies/cookie_util.cc +++ b/net/cookies/cookie_util.cc @@ -8,8 +8,8 @@ #include <cstdlib> #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "build/build_config.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" @@ -103,7 +103,7 @@ base::Time ParseCookieTime(const std::string& time_string) { base::Time::Exploded exploded = {0}; - StringTokenizer tokenizer(time_string, kDelimiters); + base::StringTokenizer tokenizer(time_string, kDelimiters); bool found_day_of_month = false; bool found_month = false; diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc index 66290b4..82f4243 100644 --- a/net/dns/dns_hosts.cc +++ b/net/dns/dns_hosts.cc @@ -7,8 +7,8 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/metrics/histogram.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" namespace net { @@ -16,17 +16,17 @@ void ParseHosts(const std::string& contents, DnsHosts* dns_hosts) { CHECK(dns_hosts); DnsHosts& hosts = *dns_hosts; // Split into lines. Accept CR for Windows. - StringTokenizer contents_lines(contents, "\n\r"); + base::StringTokenizer contents_lines(contents, "\n\r"); while (contents_lines.GetNext()) { // Ignore comments after '#'. std::string line = contents_lines.token(); - StringTokenizer line_parts(line, "#"); - line_parts.set_options(StringTokenizer::RETURN_DELIMS); + base::StringTokenizer line_parts(line, "#"); + line_parts.set_options(base::StringTokenizer::RETURN_DELIMS); if (line_parts.GetNext() && !line_parts.token_is_delim()) { // Split and trim whitespace. std::string part = line_parts.token(); - StringTokenizer tokens(part, " \t"); + base::StringTokenizer tokens(part, " \t"); if (tokens.GetNext()) { IPAddressNumber ip; diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc index efa67f5..e47f153 100644 --- a/net/ftp/ftp_util.cc +++ b/net/ftp/ftp_util.cc @@ -14,8 +14,8 @@ #include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_split.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "third_party/icu/public/common/unicode/uchar.h" @@ -34,7 +34,7 @@ std::string FtpUtil::UnixFilePathToVMS(const std::string& unix_path) { if (unix_path.empty()) return std::string(); - StringTokenizer tokenizer(unix_path, "/"); + base::StringTokenizer tokenizer(unix_path, "/"); std::vector<std::string> tokens; while (tokenizer.GetNext()) tokens.push_back(tokenizer.token()); diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc index 08f70c0..fb7fc5d 100644 --- a/net/http/http_auth.cc +++ b/net/http/http_auth.cc @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "net/base/net_errors.h" #include "net/http/http_auth_handler.h" #include "net/http/http_auth_handler_factory.h" @@ -121,7 +122,7 @@ void HttpAuth::ChallengeTokenizer::Init(std::string::const_iterator begin, // The first space-separated token is the auth-scheme. // NOTE: we are more permissive than RFC 2617 which says auth-scheme // is separated by 1*SP. - StringTokenizer tok(begin, end, HTTP_LWS); + base::StringTokenizer tok(begin, end, HTTP_LWS); if (!tok.GetNext()) { // Default param and scheme iterators provide empty strings return; diff --git a/net/http/http_content_disposition.cc b/net/http/http_content_disposition.cc index 734b1da..20c7479 100644 --- a/net/http/http_content_disposition.cc +++ b/net/http/http_content_disposition.cc @@ -8,6 +8,7 @@ #include "base/i18n/icu_string_conversions.h" #include "base/logging.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #include "net/base/net_util.h" @@ -131,7 +132,7 @@ bool DecodeWord(const std::string& encoded_word, *is_rfc2047 = true; int part_index = 0; std::string charset; - StringTokenizer t(encoded_word, "?"); + base::StringTokenizer t(encoded_word, "?"); RFC2047EncodingType enc_type = Q_ENCODING; while (*is_rfc2047 && t.GetNext()) { std::string part = t.token(); @@ -236,8 +237,8 @@ bool DecodeFilenameValue(const std::string& input, bool is_previous_token_rfc2047 = true; // Tokenize with whitespace characters. - StringTokenizer t(input, " \t\n\r"); - t.set_options(StringTokenizer::RETURN_DELIMS); + base::StringTokenizer t(input, " \t\n\r"); + t.set_options(base::StringTokenizer::RETURN_DELIMS); while (t.GetNext()) { if (t.token_is_delim()) { // If the previous non-delimeter token is not RFC2047-encoded, @@ -269,8 +270,8 @@ bool DecodeFilenameValue(const std::string& input, bool ParseExtValueComponents(const std::string& input, std::string* charset, std::string* value_chars) { - StringTokenizer t(input, "'"); - t.set_options(StringTokenizer::RETURN_DELIMS); + base::StringTokenizer t(input, "'"); + t.set_options(base::StringTokenizer::RETURN_DELIMS); std::string temp_charset; std::string temp_value; int numDelimsSeen = 0; diff --git a/net/http/http_security_headers.cc b/net/http/http_security_headers.cc index 8018927..7671c8e 100644 --- a/net/http/http_security_headers.cc +++ b/net/http/http_security_headers.cc @@ -5,8 +5,8 @@ #include "base/base64.h" #include "base/basictypes.h" #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "net/http/http_security_headers.h" #include "net/http/http_util.h" @@ -185,8 +185,8 @@ bool ParseHSTSHeader(const base::Time& now, const std::string& value, DIRECTIVE_END } state = START; - StringTokenizer tokenizer(value, " \t=;"); - tokenizer.set_options(StringTokenizer::RETURN_DELIMS); + base::StringTokenizer tokenizer(value, " \t=;"); + tokenizer.set_options(base::StringTokenizer::RETURN_DELIMS); tokenizer.set_quote_chars("\""); std::string unquoted; while (tokenizer.GetNext()) { diff --git a/net/http/http_util.cc b/net/http/http_util.cc index 44d7330..7757df4 100644 --- a/net/http/http_util.cc +++ b/net/http/http_util.cc @@ -11,10 +11,11 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/stringprintf.h" #include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_util.h" +#include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "base/time.h" using std::string; @@ -113,8 +114,8 @@ void HttpUtil::ParseContentType(const string& content_type_str, // Iterate over parameters size_t param_start = content_type_str.find_first_of(';', type_end); if (param_start != string::npos) { - StringTokenizer tokenizer(begin + param_start, content_type_str.end(), - ";"); + base::StringTokenizer tokenizer(begin + param_start, content_type_str.end(), + ";"); tokenizer.set_quote_chars("\""); while (tokenizer.GetNext()) { string::const_iterator equals_sign = @@ -600,7 +601,7 @@ std::string HttpUtil::AssembleRawHeaders(const char* input_begin, // line's field-value. // TODO(ericroman): is this too permissive? (delimits on [\r\n]+) - CStringTokenizer lines(status_line_end, input_end, "\r\n"); + base::CStringTokenizer lines(status_line_end, input_end, "\r\n"); // This variable is true when the previous line was continuable. bool prev_line_continuable = false; @@ -639,7 +640,7 @@ std::string HttpUtil::AssembleRawHeaders(const char* input_begin, std::string HttpUtil::ConvertHeadersBackToHTTPResponse(const std::string& str) { std::string disassembled_headers; - StringTokenizer tokenizer(str, std::string(1, '\0')); + base::StringTokenizer tokenizer(str, std::string(1, '\0')); while (tokenizer.GetNext()) { disassembled_headers.append(tokenizer.token_begin(), tokenizer.token_end()); disassembled_headers.append("\r\n"); @@ -664,7 +665,7 @@ std::string HttpUtil::GenerateAcceptLanguageHeader( // two floating point numbers. const unsigned int kQvalueDecrement10 = 2; unsigned int qvalue10 = 10; - StringTokenizer t(raw_language_list, ","); + base::StringTokenizer t(raw_language_list, ","); std::string lang_list_with_q; while (t.GetNext()) { std::string language = t.token(); diff --git a/net/http/http_util.h b/net/http/http_util.h index 7560b92..8f15d13 100644 --- a/net/http/http_util.h +++ b/net/http/http_util.h @@ -9,7 +9,7 @@ #include <vector> #include "base/memory/ref_counted.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "googleurl/src/gurl.h" #include "net/base/net_export.h" #include "net/http/http_byte_range.h" @@ -252,7 +252,7 @@ class NET_EXPORT HttpUtil { } private: - StringTokenizer lines_; + base::StringTokenizer lines_; std::string::const_iterator name_begin_; std::string::const_iterator name_end_; std::string::const_iterator values_begin_; @@ -292,7 +292,7 @@ class NET_EXPORT HttpUtil { } private: - StringTokenizer values_; + base::StringTokenizer values_; std::string::const_iterator value_begin_; std::string::const_iterator value_end_; }; diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc index 1c0fd61..5f63c5c 100644 --- a/net/proxy/proxy_bypass_rules.cc +++ b/net/proxy/proxy_bypass_rules.cc @@ -5,11 +5,11 @@ #include "net/proxy/proxy_bypass_rules.h" #include "base/stl_util.h" -#include "base/stringprintf.h" #include "base/string_number_conversions.h" #include "base/string_piece.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "net/base/net_util.h" namespace net { @@ -251,7 +251,7 @@ void ProxyBypassRules::ParseFromStringInternal( bool use_hostname_suffix_matching) { Clear(); - StringTokenizer entries(raw, ",;"); + base::StringTokenizer entries(raw, ",;"); while (entries.GetNext()) { AddRuleFromStringInternalWithLogging(entries.token(), use_hostname_suffix_matching); diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc index 12acc5a..44f0a69 100644 --- a/net/proxy/proxy_config.cc +++ b/net/proxy/proxy_config.cc @@ -5,8 +5,8 @@ #include "net/proxy/proxy_config.h" #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/values.h" #include "net/proxy/proxy_info.h" @@ -79,9 +79,9 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) { proxy_for_ftp = ProxyServer(); fallback_proxy = ProxyServer(); - StringTokenizer proxy_server_list(proxy_rules, ";"); + base::StringTokenizer proxy_server_list(proxy_rules, ";"); while (proxy_server_list.GetNext()) { - StringTokenizer proxy_server_for_scheme( + base::StringTokenizer proxy_server_for_scheme( proxy_server_list.token_begin(), proxy_server_list.token_end(), "="); while (proxy_server_for_scheme.GetNext()) { diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc index f48c366..70c639e 100644 --- a/net/proxy/proxy_config_service_android.cc +++ b/net/proxy/proxy_config_service_android.cc @@ -16,8 +16,8 @@ #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/sequenced_task_runner.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "googleurl/src/url_parse.h" #include "jni/ProxyChangeListener_jni.h" #include "net/base/host_port_pair.h" @@ -101,7 +101,7 @@ void AddBypassRules(const std::string& scheme, get_property.Run(scheme + ".nonProxyHosts"); if (non_proxy_hosts.empty()) return; - StringTokenizer tokenizer(non_proxy_hosts, "|"); + base::StringTokenizer tokenizer(non_proxy_hosts, "|"); while (tokenizer.GetNext()) { std::string token = tokenizer.token(); std::string pattern; diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index c604820..db4b738 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -27,8 +27,8 @@ #include "base/nix/xdg_util.h" #include "base/single_thread_task_runner.h" #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread_restrictions.h" #include "base/timer.h" #include "googleurl/src/url_canon.h" @@ -1053,7 +1053,7 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter, void AddHostList(StringListSetting key, const std::string& value) { std::vector<std::string> tokens; - StringTokenizer tk(value, ", "); + base::StringTokenizer tk(value, ", "); while (tk.GetNext()) { std::string token = tk.token(); if (!token.empty()) diff --git a/net/proxy/proxy_config_service_win.cc b/net/proxy/proxy_config_service_win.cc index 60f6f74..4b6a926 100644 --- a/net/proxy/proxy_config_service_win.cc +++ b/net/proxy/proxy_config_service_win.cc @@ -9,9 +9,9 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" -#include "base/string_tokenizer.h" -#include "base/string_util.h" #include "base/stl_util.h" +#include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/threading/thread_restrictions.h" #include "base/win/registry.h" #include "net/base/net_errors.h" @@ -180,7 +180,7 @@ void ProxyConfigServiceWin::SetFromIEConfig( if (ie_config.lpszProxyBypass) { std::string proxy_bypass = WideToASCII(ie_config.lpszProxyBypass); - StringTokenizer proxy_server_bypass_list(proxy_bypass, ";, \t\n\r"); + base::StringTokenizer proxy_server_bypass_list(proxy_bypass, ";, \t\n\r"); while (proxy_server_bypass_list.GetNext()) { std::string bypass_url_domain = proxy_server_bypass_list.token(); config->proxy_rules().bypass_rules.AddRuleFromString(bypass_url_domain); diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc index 2057d50..edb9807 100644 --- a/net/proxy/proxy_list.cc +++ b/net/proxy/proxy_list.cc @@ -6,7 +6,7 @@ #include "base/callback.h" #include "base/logging.h" -#include "base/string_tokenizer.h" +#include "base/strings/string_tokenizer.h" #include "base/time.h" #include "net/proxy/proxy_server.h" @@ -23,7 +23,7 @@ ProxyList::~ProxyList() { void ProxyList::Set(const std::string& proxy_uri_list) { proxies_.clear(); - StringTokenizer str_tok(proxy_uri_list, ";"); + base::StringTokenizer str_tok(proxy_uri_list, ";"); while (str_tok.GetNext()) { ProxyServer uri = ProxyServer::FromURI( str_tok.token_begin(), str_tok.token_end(), ProxyServer::SCHEME_HTTP); @@ -116,7 +116,7 @@ const ProxyServer& ProxyList::Get() const { } void ProxyList::SetFromPacString(const std::string& pac_string) { - StringTokenizer entry_tok(pac_string, ";"); + base::StringTokenizer entry_tok(pac_string, ";"); proxies_.clear(); while (entry_tok.GetNext()) { ProxyServer uri = ProxyServer::FromPacString( diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc index 72254b3..4a33910 100644 --- a/net/proxy/proxy_resolver_v8.cc +++ b/net/proxy/proxy_resolver_v8.cc @@ -10,8 +10,8 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/logging.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/strings/string_tokenizer.h" #include "base/synchronization/lock.h" #include "base/utf_string_conversions.h" #include "googleurl/src/gurl.h" @@ -273,7 +273,7 @@ bool SortIpAddressList(const std::string& ip_address_list, // Split-up IP addresses and store them in a vector. std::vector<IPAddress> ip_vector; IPAddressNumber ip_num; - StringTokenizer str_tok(cleaned_ip_address_list, ";"); + base::StringTokenizer str_tok(cleaned_ip_address_list, ";"); while (str_tok.GetNext()) { if (!ParseIPLiteralToNumber(str_tok.token(), &ip_num)) return false; diff --git a/net/proxy/proxy_server.cc b/net/proxy/proxy_server.cc index eb160dc..5d2eaa7 100644 --- a/net/proxy/proxy_server.cc +++ b/net/proxy/proxy_server.cc @@ -6,7 +6,6 @@ #include <algorithm> -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "net/base/net_util.h" #include "net/http/http_util.h" diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc index 54856ca..8cb44cc 100644 --- a/net/websockets/websocket_handshake_handler.cc +++ b/net/websockets/websocket_handshake_handler.cc @@ -11,6 +11,7 @@ #include "base/string_piece.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "googleurl/src/gurl.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" @@ -89,7 +90,7 @@ std::string FilterHeaders( size_t headers_to_remove_len) { std::string filtered_headers; - StringTokenizer lines(headers.begin(), headers.end(), "\r\n"); + base::StringTokenizer lines(headers.begin(), headers.end(), "\r\n"); while (lines.GetNext()) { std::string::const_iterator line_begin = lines.token_begin(); std::string::const_iterator line_end = lines.token_end(); diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc index ff60ebe..90ed553 100644 --- a/net/websockets/websocket_job.cc +++ b/net/websockets/websocket_job.cc @@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/lazy_instance.h" -#include "base/string_tokenizer.h" #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/base/net_log.h" diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc index ade30b2..e3cf59e 100644 --- a/testing/android/native_test_launcher.cc +++ b/testing/android/native_test_launcher.cc @@ -26,9 +26,9 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" -#include "base/stringprintf.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" +#include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "gtest/gtest.h" #include "testing/jni/ChromeNativeTestActivity_jni.h" @@ -82,7 +82,7 @@ void InstallHandlers() { void ParseArgsFromString(const std::string& command_line, std::vector<std::string>* args) { - StringTokenizer tokenizer(command_line, kWhitespaceASCII); + base::StringTokenizer tokenizer(command_line, kWhitespaceASCII); tokenizer.set_quote_chars("\""); while (tokenizer.GetNext()) { std::string token; diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc index 56c12a8..a08feae 100644 --- a/ui/base/gestures/gesture_sequence.cc +++ b/ui/base/gestures/gesture_sequence.cc @@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/string_number_conversions.h" -#include "base/string_tokenizer.h" #include "base/time.h" #include "ui/base/events/event.h" #include "ui/base/events/event_constants.h" diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index 779af5f..e2358d0 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -5,8 +5,8 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_WIN) -#include <objidl.h> #include <mlang.h> +#include <objidl.h> #elif defined(OS_POSIX) && !defined(OS_MACOSX) #include <sys/utsname.h> #endif @@ -22,9 +22,9 @@ #include "base/path_service.h" #include "base/process_util.h" #include "base/string_piece.h" -#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/strings/string_tokenizer.h" #include "base/sys_info.h" #include "base/utf_string_conversions.h" #include "net/base/escape.h" @@ -97,7 +97,7 @@ void SetJavaScriptFlags(const std::string& str) { void EnableWebCoreLogChannels(const std::string& channels) { if (channels.empty()) return; - StringTokenizer t(channels, ", "); + base::StringTokenizer t(channels, ", "); while (t.GetNext()) { WebKit::enableLogChannel(t.token().c_str()); } diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index 48d882b..42ada0c 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -24,7 +24,6 @@ #include "base/memory/singleton.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" -#include "base/string_tokenizer.h" #include "base/synchronization/lock.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_lib.h" |