diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 17:29:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 17:29:25 +0000 |
commit | e83326f8400791e92875546b2fd1885a3a17d1b1 (patch) | |
tree | edbe773208b1a9f6965b45b55da10afd210ea7bb /chrome/browser/bookmarks | |
parent | 8e0a03bf3b1aacaa7a2bc2561d8eb1b83eb9c2e5 (diff) | |
download | chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.zip chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.tar.gz chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.tar.bz2 |
Convert more callers of the integer/string functions to using
string_number_conversions.h
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3013046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_codec.cc | 12 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_index_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model_unittest.cc | 3 |
3 files changed, 15 insertions, 8 deletions
diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index a56636a..35ed181 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -193,7 +193,7 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, int64 id = 0; if (ids_valid_) { if (!value.GetString(kIdKey, &id_string) || - !StringToInt64(id_string, &id) || + !base::StringToInt64(id_string, &id) || ids_.count(id) != 0) { ids_valid_ = false; } else { @@ -209,8 +209,9 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, std::string date_added_string; if (!value.GetString(kDateAddedKey, &date_added_string)) date_added_string = base::Int64ToString(Time::Now().ToInternalValue()); - base::Time date_added = base::Time::FromInternalValue( - StringToInt64(date_added_string)); + int64 internal_time; + base::StringToInt64(date_added_string, &internal_time); + base::Time date_added = base::Time::FromInternalValue(internal_time); #if !defined(OS_WIN) // We changed the epoch for dates on Mac & Linux from 1970 to the Windows // one of 1601. We assume any number we encounter from before 1970 is using @@ -267,8 +268,9 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, } node->set_type(BookmarkNode::FOLDER); - node->set_date_group_modified(Time::FromInternalValue( - StringToInt64(last_modified_date))); + int64 internal_time; + base::StringToInt64(last_modified_date, &internal_time); + node->set_date_group_modified(Time::FromInternalValue(internal_time)); if (parent) parent->Add(parent->GetChildCount(), node); diff --git a/chrome/browser/bookmarks/bookmark_index_unittest.cc b/chrome/browser/bookmarks/bookmark_index_unittest.cc index 6225bc7..f631528 100644 --- a/chrome/browser/bookmarks/bookmark_index_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_index_unittest.cc @@ -6,6 +6,7 @@ #include <vector> #include "base/message_loop.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/bookmarks/bookmark_index.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -70,8 +71,11 @@ class BookmarkIndexTest : public testing::Test { SplitString(match_strings[i], ',', &chunks); ASSERT_EQ(2U, chunks.size()); matches->push_back(Snippet::MatchPosition()); - matches->back().first = StringToInt(chunks[0]); - matches->back().second = StringToInt(chunks[1]); + int chunks0, chunks1; + base::StringToInt(chunks[0], &chunks0); + base::StringToInt(chunks[1], &chunks1); + matches->back().first = chunks0; + matches->back().second = chunks1; } } diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index 9d85f1f..515e475 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -7,6 +7,7 @@ #include "app/tree_node_iterator.h" #include "app/tree_node_model.h" #include "base/hash_tables.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/bookmarks/bookmark_codec.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -566,7 +567,7 @@ static void PopulateNodeImpl(const std::vector<std::wstring>& description, // in debugging. static int next_group_id = 1; TestNode* new_node = - new TestNode(IntToWString(next_group_id++), + new TestNode(UTF8ToWide(base::IntToString(next_group_id++)), BookmarkNode::FOLDER); parent->Add(parent->GetChildCount(), new_node); PopulateNodeImpl(description, index, new_node); |