diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 01:56:32 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 01:56:32 +0000 |
commit | f6b4853153c6be7a7ce092d4c5f3172c022da561 (patch) | |
tree | 99f03bfa0866d1441f37f979d88c82f3fb51180f /chrome/browser/history | |
parent | 5e5136c2a2fc497ada68dadfacfd9068ee22f36f (diff) | |
download | chromium_src-f6b4853153c6be7a7ce092d4c5f3172c022da561.zip chromium_src-f6b4853153c6be7a7ce092d4c5f3172c022da561.tar.gz chromium_src-f6b4853153c6be7a7ce092d4c5f3172c022da561.tar.bz2 |
Change url wstrings to GURLS
Review URL: http://codereview.chromium.org/20273
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/download_database.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/download_types.h | 5 | ||||
-rw-r--r-- | chrome/browser/history/history_unittest.cc | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc index 7f66dba..5c34ef4 100644 --- a/chrome/browser/history/download_database.cc +++ b/chrome/browser/history/download_database.cc @@ -72,7 +72,9 @@ void DownloadDatabase::QueryDownloads(std::vector<DownloadCreateInfo>* results) std::wstring path_str; statement->column_wstring(1, &path_str); info.path = FilePath::FromWStringHack(path_str); - statement->column_wstring(2, &info.url); + std::wstring url_str; + statement->column_wstring(2, &url_str); + info.url = GURL(WideToUTF8(url_str)); info.start_time = Time::FromTimeT(statement->column_int64(3)); info.received_bytes = statement->column_int64(4); info.total_bytes = statement->column_int64(5); @@ -120,7 +122,7 @@ int64 DownloadDatabase::CreateDownload(const DownloadCreateInfo& info) { return 0; statement->bind_wstring(0, info.path.ToWStringHack()); - statement->bind_wstring(1, info.url); + statement->bind_wstring(1, UTF8ToWide(info.url.spec())); statement->bind_int64(2, info.start_time.ToTimeT()); statement->bind_int64(3, info.received_bytes); statement->bind_int64(4, info.total_bytes); diff --git a/chrome/browser/history/download_types.h b/chrome/browser/history/download_types.h index e520ff6..de87d2e 100644 --- a/chrome/browser/history/download_types.h +++ b/chrome/browser/history/download_types.h @@ -13,6 +13,7 @@ #include "base/basictypes.h" #include "base/file_path.h" #include "base/time.h" +#include "googleurl/src/gurl.h" // Used for informing the download database of a new download, where we don't // want to pass DownloadItems between threads. The history service also uses a @@ -20,7 +21,7 @@ // initialization time (see DownloadQueryInfo below). struct DownloadCreateInfo { DownloadCreateInfo(const FilePath& path, - const std::wstring& url, + const GURL& url, base::Time start_time, int64 received_bytes, int64 total_bytes, @@ -46,7 +47,7 @@ struct DownloadCreateInfo { // DownloadItem fields FilePath path; - std::wstring url; + GURL url; FilePath suggested_path; // A number that should be added to the suggested path to make it unique. // 0 means no number should be appended. Not actually stored in the db. diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 6677145..b8f953e 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -194,7 +194,7 @@ class HistoryTest : public testing::Test { int64 AddDownload(int32 state, const Time& time) { DownloadCreateInfo download(FilePath(FILE_PATH_LITERAL("foo-path")), - L"foo-url", time, 0, 512, state, 0); + GURL("foo-url"), time, 0, 512, state, 0); return db_->CreateDownload(download); } |