summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 01:56:32 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 01:56:32 +0000
commitf6b4853153c6be7a7ce092d4c5f3172c022da561 (patch)
tree99f03bfa0866d1441f37f979d88c82f3fb51180f /chrome
parent5e5136c2a2fc497ada68dadfacfd9068ee22f36f (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/download/download_file.cc5
-rw-r--r--chrome/browser/download/download_file.h2
-rw-r--r--chrome/browser/download/download_manager.cc2
-rw-r--r--chrome/browser/download/download_manager.h8
-rw-r--r--chrome/browser/download/download_manager_unittest.cc112
-rw-r--r--chrome/browser/download/download_util.cc2
-rw-r--r--chrome/browser/download/save_file_manager.cc40
-rw-r--r--chrome/browser/download/save_file_manager.h18
-rw-r--r--chrome/browser/download/save_item.cc4
-rw-r--r--chrome/browser/download/save_item.h13
-rw-r--r--chrome/browser/download/save_package.cc37
-rw-r--r--chrome/browser/download/save_package.h6
-rw-r--r--chrome/browser/download/save_types.h7
-rw-r--r--chrome/browser/history/download_database.cc6
-rw-r--r--chrome/browser/history/download_types.h5
-rw-r--r--chrome/browser/history/history_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/buffered_resource_handler.cc2
-rw-r--r--chrome/browser/renderer_host/download_resource_handler.cc6
-rw-r--r--chrome/browser/renderer_host/download_resource_handler.h4
-rw-r--r--chrome/browser/renderer_host/download_throttling_resource_handler.cc4
-rw-r--r--chrome/browser/renderer_host/download_throttling_resource_handler.h5
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc2
-rw-r--r--chrome/browser/renderer_host/render_view_host.h2
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc4
-rw-r--r--chrome/browser/renderer_host/save_file_resource_handler.cc6
-rw-r--r--chrome/browser/renderer_host/save_file_resource_handler.h6
-rw-r--r--chrome/common/render_messages_internal.h2
-rw-r--r--chrome/common/temp_scaffolding_stubs.h2
-rw-r--r--chrome/renderer/render_view.cc2
-rw-r--r--chrome/renderer/render_view.h2
30 files changed, 161 insertions, 157 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index d3c7c63..7d03acb 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -531,12 +531,13 @@ void DownloadFileManager::OnShowDownloadInShell(const FilePath& full_path) {
// a valid parent window, the 'safer' version will be used which can
// display a modal dialog asking for user consent on dangerous files.
void DownloadFileManager::OnOpenDownloadInShell(const FilePath& full_path,
- const std::wstring& url,
+ const GURL& url,
gfx::NativeView parent_window) {
#if defined(OS_WIN)
DCHECK(MessageLoop::current() == file_loop_);
if (NULL != parent_window) {
- win_util::SaferOpenItemViaShell(parent_window, L"", full_path, url, true);
+ win_util::SaferOpenItemViaShell(parent_window, L"", full_path,
+ UTF8ToWide(url.spec()), true);
} else {
win_util::OpenItemViaShell(full_path, true);
}
diff --git a/chrome/browser/download/download_file.h b/chrome/browser/download/download_file.h
index ebc1dde..9991c03 100644
--- a/chrome/browser/download/download_file.h
+++ b/chrome/browser/download/download_file.h
@@ -200,7 +200,7 @@ class DownloadFileManager
void OnShowDownloadInShell(const FilePath& full_path);
// Handler to open or execute a downloaded file.
void OnOpenDownloadInShell(const FilePath& full_path,
- const std::wstring& url,
+ const GURL& url,
gfx::NativeView parent_window);
// The download manager has provided a final name for a download. Sent from
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index d448f0a..5747c3b 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -126,7 +126,7 @@ DownloadItem::DownloadItem(const DownloadCreateInfo& info)
DownloadItem::DownloadItem(int32 download_id,
const FilePath& path,
int path_uniquifier,
- const std::wstring& url,
+ const GURL& url,
const FilePath& original_name,
const base::Time start_time,
int64 download_size,
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index f718094..942361b 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -103,7 +103,7 @@ class DownloadItem {
DownloadItem(int32 download_id,
const FilePath& path,
int path_uniquifier,
- const std::wstring& url,
+ const GURL& url,
const FilePath& original_name,
const base::Time start_time,
int64 download_size,
@@ -176,7 +176,7 @@ class DownloadItem {
void set_full_path(const FilePath& path) { full_path_ = path; }
int path_uniquifier() const { return path_uniquifier_; }
void set_path_uniquifier(int uniquifier) { path_uniquifier_ = uniquifier; }
- std::wstring url() const { return url_; }
+ GURL url() const { return url_; }
int64 total_bytes() const { return total_bytes_; }
void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; }
int64 received_bytes() const { return received_bytes_; }
@@ -221,8 +221,8 @@ class DownloadItem {
// Short display version of the file
FilePath file_name_;
- // The URL from whence we came, for display
- std::wstring url_;
+ // The URL from whence we came.
+ GURL url_;
// Total bytes expected
int64 total_bytes_;
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index 51feb5b..3771030 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -17,12 +17,12 @@ class DownloadManagerTest : public testing::Test {
}
void GetGeneratedFilename(const std::string& content_disposition,
- const std::wstring& url,
+ const std::string& url,
const std::string& mime_type,
std::wstring* generated_name_string) {
DownloadCreateInfo info;
info.content_disposition = content_disposition;
- info.url = url;
+ info.url = GURL(url);
info.mime_type = mime_type;
FilePath generated_name;
download_manager_->GenerateFilename(&info, &generated_name);
@@ -40,277 +40,277 @@ namespace {
const struct {
const char* disposition;
- const wchar_t* url;
+ const char* url;
const char* mime_type;
const wchar_t* expected_name;
} kGeneratedFiles[] = {
// No 'filename' keyword in the disposition, use the URL
{"a_file_name.txt",
- L"http://www.evil.com/my_download.txt",
+ "http://www.evil.com/my_download.txt",
"text/plain",
L"my_download.txt"},
// Disposition has relative paths, remove them
{"filename=../../../../././../a_file_name.txt",
- L"http://www.evil.com/my_download.txt",
+ "http://www.evil.com/my_download.txt",
"text/plain",
L"a_file_name.txt"},
// Disposition has parent directories, remove them
{"filename=dir1/dir2/a_file_name.txt",
- L"http://www.evil.com/my_download.txt",
+ "http://www.evil.com/my_download.txt",
"text/plain",
L"a_file_name.txt"},
// No useful information in disposition or URL, use default
- {"", L"http://www.truncated.com/path/", "text/plain", L"download.txt"},
+ {"", "http://www.truncated.com/path/", "text/plain", L"download.txt"},
// A normal avi should get .avi and not .avi.avi
- {"", L"https://blah.google.com/misc/2.avi", "video/x-msvideo", L"2.avi"},
+ {"", "https://blah.google.com/misc/2.avi", "video/x-msvideo", L"2.avi"},
// Spaces in the disposition file name
{"filename=My Downloaded File.exe",
- L"http://www.frontpagehacker.com/a_download.exe",
+ "http://www.frontpagehacker.com/a_download.exe",
"application/octet-stream",
L"My Downloaded File.exe"},
{"filename=my-cat",
- L"http://www.example.com/my-cat",
+ "http://www.example.com/my-cat",
"image/jpeg",
L"my-cat.jpg"},
{"filename=my-cat",
- L"http://www.example.com/my-cat",
+ "http://www.example.com/my-cat",
"text/plain",
L"my-cat.txt"},
{"filename=my-cat",
- L"http://www.example.com/my-cat",
+ "http://www.example.com/my-cat",
"text/html",
L"my-cat.htm"},
{"filename=my-cat",
- L"http://www.example.com/my-cat",
+ "http://www.example.com/my-cat",
"dance/party",
L"my-cat"},
{"filename=my-cat.jpg",
- L"http://www.example.com/my-cat.jpg",
+ "http://www.example.com/my-cat.jpg",
"text/plain",
L"my-cat.jpg"},
{"filename=evil.exe",
- L"http://www.goodguy.com/evil.exe",
+ "http://www.goodguy.com/evil.exe",
"image/jpeg",
L"evil.jpg"},
{"filename=ok.exe",
- L"http://www.goodguy.com/ok.exe",
+ "http://www.goodguy.com/ok.exe",
"binary/octet-stream",
L"ok.exe"},
{"filename=evil.exe.exe",
- L"http://www.goodguy.com/evil.exe.exe",
+ "http://www.goodguy.com/evil.exe.exe",
"dance/party",
L"evil.exe.download"},
{"filename=evil.exe",
- L"http://www.goodguy.com/evil.exe",
+ "http://www.goodguy.com/evil.exe",
"application/xml",
L"evil.xml"},
{"filename=evil.exe",
- L"http://www.goodguy.com/evil.exe",
+ "http://www.goodguy.com/evil.exe",
"application/html+xml",
L"evil.download"},
{"filename=evil.exe",
- L"http://www.goodguy.com/evil.exe",
+ "http://www.goodguy.com/evil.exe",
"application/rss+xml",
L"evil.download"},
{"filename=utils.js",
- L"http://www.goodguy.com/utils.js",
+ "http://www.goodguy.com/utils.js",
"application/x-javascript",
L"utils.js"},
{"filename=contacts.js",
- L"http://www.goodguy.com/contacts.js",
+ "http://www.goodguy.com/contacts.js",
"application/json",
L"contacts.js"},
{"filename=utils.js",
- L"http://www.goodguy.com/utils.js",
+ "http://www.goodguy.com/utils.js",
"text/javascript",
L"utils.js"},
{"filename=utils.js",
- L"http://www.goodguy.com/utils.js",
+ "http://www.goodguy.com/utils.js",
"text/javascript;version=2",
L"utils.js"},
{"filename=utils.js",
- L"http://www.goodguy.com/utils.js",
+ "http://www.goodguy.com/utils.js",
"application/ecmascript",
L"utils.js"},
{"filename=utils.js",
- L"http://www.goodguy.com/utils.js",
+ "http://www.goodguy.com/utils.js",
"application/ecmascript;version=4",
L"utils.js"},
{"filename=program.exe",
- L"http://www.goodguy.com/program.exe",
+ "http://www.goodguy.com/program.exe",
"application/foo-bar",
L"program.exe"},
{"filename=../foo.txt",
- L"http://www.evil.com/../foo.txt",
+ "http://www.evil.com/../foo.txt",
"text/plain",
L"foo.txt"},
{"filename=..\\foo.txt",
- L"http://www.evil.com/..\\foo.txt",
+ "http://www.evil.com/..\\foo.txt",
"text/plain",
L"foo.txt"},
{"filename=.hidden",
- L"http://www.evil.com/.hidden",
+ "http://www.evil.com/.hidden",
"text/plain",
L"hidden.txt"},
{"filename=trailing.",
- L"http://www.evil.com/trailing.",
+ "http://www.evil.com/trailing.",
"dance/party",
L"trailing"},
{"filename=trailing.",
- L"http://www.evil.com/trailing.",
+ "http://www.evil.com/trailing.",
"text/plain",
L"trailing.txt"},
{"filename=.",
- L"http://www.evil.com/.",
+ "http://www.evil.com/.",
"dance/party",
L"download"},
{"filename=..",
- L"http://www.evil.com/..",
+ "http://www.evil.com/..",
"dance/party",
L"download"},
{"filename=...",
- L"http://www.evil.com/...",
+ "http://www.evil.com/...",
"dance/party",
L"download"},
{"a_file_name.txt",
- L"http://www.evil.com/",
+ "http://www.evil.com/",
"image/jpeg",
L"download.jpg"},
{"filename=",
- L"http://www.evil.com/",
+ "http://www.evil.com/",
"image/jpeg",
L"download.jpg"},
{"filename=simple",
- L"http://www.example.com/simple",
+ "http://www.example.com/simple",
"application/octet-stream",
L"simple"},
{"filename=COM1",
- L"http://www.goodguy.com/COM1",
+ "http://www.goodguy.com/COM1",
"application/foo-bar",
L"_COM1"},
{"filename=COM4.txt",
- L"http://www.goodguy.com/COM4.txt",
+ "http://www.goodguy.com/COM4.txt",
"text/plain",
L"_COM4.txt"},
{"filename=lpt1.TXT",
- L"http://www.goodguy.com/lpt1.TXT",
+ "http://www.goodguy.com/lpt1.TXT",
"text/plain",
L"_lpt1.TXT"},
{"filename=clock$.txt",
- L"http://www.goodguy.com/clock$.txt",
+ "http://www.goodguy.com/clock$.txt",
"text/plain",
L"_clock$.txt"},
{"filename=mycom1.foo",
- L"http://www.goodguy.com/mycom1.foo",
+ "http://www.goodguy.com/mycom1.foo",
"text/plain",
L"mycom1.foo"},
{"filename=Setup.exe.local",
- L"http://www.badguy.com/Setup.exe.local",
+ "http://www.badguy.com/Setup.exe.local",
"application/foo-bar",
L"Setup.exe.download"},
{"filename=Setup.exe.local.local",
- L"http://www.badguy.com/Setup.exe.local",
+ "http://www.badguy.com/Setup.exe.local",
"application/foo-bar",
L"Setup.exe.local.download"},
{"filename=Setup.exe.lnk",
- L"http://www.badguy.com/Setup.exe.lnk",
+ "http://www.badguy.com/Setup.exe.lnk",
"application/foo-bar",
L"Setup.exe.download"},
{"filename=Desktop.ini",
- L"http://www.badguy.com/Desktop.ini",
+ "http://www.badguy.com/Desktop.ini",
"application/foo-bar",
L"_Desktop.ini"},
{"filename=Thumbs.db",
- L"http://www.badguy.com/Thumbs.db",
+ "http://www.badguy.com/Thumbs.db",
"application/foo-bar",
L"_Thumbs.db"},
{"filename=source.srf",
- L"http://www.hotmail.com",
+ "http://www.hotmail.com",
"image/jpeg",
L"source.srf.jpg"},
{"filename=source.jpg",
- L"http://www.hotmail.com",
+ "http://www.hotmail.com",
"application/x-javascript",
L"source.jpg"},
// NetUtilTest.{GetSuggestedFilename, GetFileNameFromCD} test these
// more thoroughly. Tested below are a small set of samples.
{"attachment; filename=\"%EC%98%88%EC%88%A0%20%EC%98%88%EC%88%A0.jpg\"",
- L"http://www.examples.com/",
+ "http://www.examples.com/",
"image/jpeg",
L"\uc608\uc220 \uc608\uc220.jpg"},
{"attachment; name=abc de.pdf",
- L"http://www.examples.com/q.cgi?id=abc",
+ "http://www.examples.com/q.cgi?id=abc",
"application/octet-stream",
L"abc de.pdf"},
{"filename=\"=?EUC-JP?Q?=B7=DD=BD=D13=2Epng?=\"",
- L"http://www.example.com/path",
+ "http://www.example.com/path",
"image/png",
L"\x82b8\x8853" L"3.png"},
// The following two have invalid CD headers and filenames come
// from the URL.
{"attachment; filename==?iiso88591?Q?caf=EG?=",
- L"http://www.example.com/test%20123",
+ "http://www.example.com/test%20123",
"image/jpeg",
L"test 123.jpg"},
{"malformed_disposition",
- L"http://www.google.com/%EC%98%88%EC%88%A0%20%EC%98%88%EC%88%A0.jpg",
+ "http://www.google.com/%EC%98%88%EC%88%A0%20%EC%98%88%EC%88%A0.jpg",
"image/jpeg",
L"\uc608\uc220 \uc608\uc220.jpg"},
// Invalid C-D. No filename from URL. Falls back to 'download'.
{"attachment; filename==?iso88591?Q?caf=E3?",
- L"http://www.google.com/path1/path2/",
+ "http://www.google.com/path1/path2/",
"image/jpeg",
L"download.jpg"},
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index e264987..09ae4c0 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -112,7 +112,7 @@ void BaseContextMenu::ExecuteCommand(int id) {
download_->manager()->ShowDownloadInShell(download_);
break;
case COPY_LINK:
- scw.WriteText(download_->url());
+ scw.WriteText(UTF8ToWide(download_->url().spec()));
break;
case COPY_PATH:
scw.WriteText(download_->full_path().ToWStringHack());
diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc
index 64984de..510b94c 100644
--- a/chrome/browser/download/save_file_manager.cc
+++ b/chrome/browser/download/save_file_manager.cc
@@ -87,7 +87,7 @@ int SaveFileManager::GetNextId() {
return next_id_++;
}
-void SaveFileManager::RegisterStartingRequest(const std::wstring& save_url,
+void SaveFileManager::RegisterStartingRequest(const GURL& save_url,
SavePackage* save_package) {
// Make sure it runs in the UI thread.
DCHECK(MessageLoop::current() == ui_loop_);
@@ -96,19 +96,19 @@ void SaveFileManager::RegisterStartingRequest(const std::wstring& save_url,
// Register this starting request.
StartingRequestsMap& starting_requests = tab_starting_requests_[tab_id];
bool never_present = starting_requests.insert(
- StartingRequestsMap::value_type(save_url, save_package)).second;
+ StartingRequestsMap::value_type(save_url.spec(), save_package)).second;
DCHECK(never_present);
}
SavePackage* SaveFileManager::UnregisterStartingRequest(
- const std::wstring& save_url, int tab_id) {
+ const GURL& save_url, int tab_id) {
// Make sure it runs in UI thread.
DCHECK(MessageLoop::current() == ui_loop_);
TabToStartingRequestsMap::iterator it = tab_starting_requests_.find(tab_id);
if (it != tab_starting_requests_.end()) {
StartingRequestsMap& requests = it->second;
- StartingRequestsMap::iterator sit = requests.find(save_url);
+ StartingRequestsMap::iterator sit = requests.find(save_url.spec());
if (sit == requests.end())
return NULL;
@@ -149,8 +149,8 @@ SavePackage* SaveFileManager::LookupPackage(int save_id) {
}
// Call from SavePackage for starting a saving job
-void SaveFileManager::SaveURL(const std::wstring& url,
- const std::wstring& referrer,
+void SaveFileManager::SaveURL(const GURL& url,
+ const GURL& referrer,
int render_process_host_id,
int render_view_id,
SaveFileCreateInfo::SaveFileSource save_source,
@@ -166,14 +166,13 @@ void SaveFileManager::SaveURL(const std::wstring& url,
// Register a saving job.
RegisterStartingRequest(url, save_package);
if (save_source == SaveFileCreateInfo::SAVE_FILE_FROM_NET) {
- GURL save_url(url);
- DCHECK(save_url.is_valid());
+ DCHECK(url.is_valid());
io_loop_->PostTask(FROM_HERE,
NewRunnableMethod(this,
&SaveFileManager::OnSaveURL,
- save_url,
- GURL(referrer),
+ url,
+ referrer,
render_process_host_id,
render_view_id,
request_context));
@@ -195,7 +194,7 @@ void SaveFileManager::SaveURL(const std::wstring& url,
// If the save id is -1, it means we just send a request to save, but the
// saving action has still not happened, need to call UnregisterStartingRequest
// to remove it from the tracking map.
-void SaveFileManager::RemoveSaveFile(int save_id, const std::wstring& save_url,
+void SaveFileManager::RemoveSaveFile(int save_id, const GURL& save_url,
SavePackage* package) {
DCHECK(MessageLoop::current() == ui_loop_ && package);
// A save page job(SavePackage) can only have one manager,
@@ -295,7 +294,7 @@ void SaveFileManager::UpdateSaveProgress(int save_id,
// thread, which will use the save URL to find corresponding request record and
// delete it.
void SaveFileManager::SaveFinished(int save_id,
- std::wstring save_url,
+ GURL save_url,
int render_process_id,
bool is_success) {
DCHECK(MessageLoop::current() == GetSaveLoop());
@@ -312,7 +311,7 @@ void SaveFileManager::SaveFinished(int save_id,
save_file->Finish();
} else if (save_id == -1) {
// Before saving started, we got error. We still call finish process.
- DCHECK(!save_url.empty());
+ DCHECK(!save_url.is_empty());
ui_loop_->PostTask(FROM_HERE,
NewRunnableMethod(this,
&SaveFileManager::OnErrorFinished,
@@ -375,7 +374,7 @@ void SaveFileManager::OnSaveFinished(int save_id,
package->SaveFinished(save_id, bytes_so_far, is_success);
}
-void SaveFileManager::OnErrorFinished(std::wstring save_url, int tab_id) {
+void SaveFileManager::OnErrorFinished(GURL save_url, int tab_id) {
DCHECK(MessageLoop::current() == ui_loop_);
SavePackage* save_package = UnregisterStartingRequest(save_url, tab_id);
if (save_package)
@@ -473,7 +472,7 @@ void SaveFileManager::CancelSave(int save_id) {
// It is possible that SaveItem which has specified save_id has been canceled
// before this function runs. So if we can not find corresponding SaveFile by
// using specified save_id, just return.
-void SaveFileManager::SaveLocalFile(const std::wstring& original_file_url,
+void SaveFileManager::SaveLocalFile(const GURL& original_file_url,
int save_id,
int render_process_id) {
DCHECK(MessageLoop::current() == GetSaveLoop());
@@ -488,10 +487,9 @@ void SaveFileManager::SaveLocalFile(const std::wstring& original_file_url,
// Close the save file before the copy operation.
save_file->Finish();
- GURL file_url(original_file_url);
- DCHECK(file_url.SchemeIsFile());
- std::wstring file_path;
- net::FileURLToFilePath(file_url, &file_path);
+ DCHECK(original_file_url.SchemeIsFile());
+ FilePath file_path;
+ net::FileURLToFilePath(original_file_url, &file_path);
// If we can not get valid file path from original URL, treat it as
// disk error.
if (file_path.empty())
@@ -499,8 +497,8 @@ void SaveFileManager::SaveLocalFile(const std::wstring& original_file_url,
// Copy the local file to the temporary file. It will be renamed to its
// final name later.
- bool success = CopyFile(file_path.c_str(),
- save_file->full_path().c_str(), FALSE) != 0;
+ bool success = file_util::CopyFile(file_path,
+ FilePath::FromWStringHack(save_file->full_path()));
if (!success)
file_util::Delete(save_file->full_path(), false);
SaveFinished(save_id, original_file_url, render_process_id, success);
diff --git a/chrome/browser/download/save_file_manager.h b/chrome/browser/download/save_file_manager.h
index cf29e1c..4df5abf 100644
--- a/chrome/browser/download/save_file_manager.h
+++ b/chrome/browser/download/save_file_manager.h
@@ -93,8 +93,8 @@ class SaveFileManager
// Save the specified URL. Called on the UI thread and forwarded to the
// ResourceDispatcherHost on the IO thread.
- void SaveURL(const std::wstring& url,
- const std::wstring& referrer,
+ void SaveURL(const GURL& url,
+ const GURL& referrer,
int render_process_host_id,
int render_view_id,
SaveFileCreateInfo::SaveFileSource save_source,
@@ -105,7 +105,7 @@ class SaveFileManager
// Notifications sent from the IO thread and run on the file thread:
void StartSave(SaveFileCreateInfo* info);
void UpdateSaveProgress(int save_id, net::IOBuffer* data, int size);
- void SaveFinished(int save_id, std::wstring save_url,
+ void SaveFinished(int save_id, GURL save_url,
int render_process_id, bool is_success);
// Notifications sent from the UI thread and run on the file thread.
@@ -114,7 +114,7 @@ class SaveFileManager
// Called on the UI thread to remove a save package from SaveFileManager's
// tracking map.
- void RemoveSaveFile(int save_id, const std::wstring& save_url,
+ void RemoveSaveFile(int save_id, const GURL& save_url,
SavePackage* package);
// Handler for shell operations sent from the UI to the file thread.
@@ -128,7 +128,7 @@ class SaveFileManager
// Runs on file thread to save a file by copying from file system when
// original url is using file scheme.
- void SaveLocalFile(const std::wstring& original_file_url,
+ void SaveLocalFile(const GURL& original_file_url,
int save_id,
int render_process_id);
@@ -161,11 +161,11 @@ class SaveFileManager
// Register a starting request. Associate the save URL with a
// SavePackage for further matching.
- void RegisterStartingRequest(const std::wstring& save_url,
+ void RegisterStartingRequest(const GURL& save_url,
SavePackage* save_package);
// Unregister a start request according save URL, disassociate
// the save URL and SavePackage.
- SavePackage* UnregisterStartingRequest(const std::wstring& save_url,
+ SavePackage* UnregisterStartingRequest(const GURL& save_url,
int tab_id);
// Look up the SavePackage according to save id.
@@ -193,7 +193,7 @@ class SaveFileManager
void OnSaveFinished(int save_id, int64 bytes_so_far, bool is_success);
// For those requests that do not have valid save id, use
// map:(url, SavePackage) to find the request and remove it.
- void OnErrorFinished(std::wstring save_url, int tab_id);
+ void OnErrorFinished(GURL save_url, int tab_id);
// Handler for a notification sent to the UI thread.
// The user has requested a cancel in the UI thread, so send a cancel request
// to stop the network requests in net IO thread.
@@ -255,7 +255,7 @@ class SaveFileManager
// use a hashmap to map the tab id (we actually use render_process_id) to the
// hashmap since it is possible to save same URL in different tab at
// same time.
- typedef base::hash_map<std::wstring, SavePackage*> StartingRequestsMap;
+ typedef base::hash_map<std::string, SavePackage*> StartingRequestsMap;
typedef base::hash_map<int, StartingRequestsMap> TabToStartingRequestsMap;
TabToStartingRequestsMap tab_starting_requests_;
diff --git a/chrome/browser/download/save_item.cc b/chrome/browser/download/save_item.cc
index b7b7ee40..bd96010 100644
--- a/chrome/browser/download/save_item.cc
+++ b/chrome/browser/download/save_item.cc
@@ -13,8 +13,8 @@
#include "chrome/browser/download/save_package.h"
// Constructor for SaveItem when creating each saving job.
-SaveItem::SaveItem(const std::wstring& url,
- const std::wstring& referrer,
+SaveItem::SaveItem(const GURL& url,
+ const GURL& referrer,
SavePackage* package,
SaveFileCreateInfo::SaveFileSource save_source)
: save_id_(-1),
diff --git a/chrome/browser/download/save_item.h b/chrome/browser/download/save_item.h
index 3c3ed4a..b54840a 100644
--- a/chrome/browser/download/save_item.h
+++ b/chrome/browser/download/save_item.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "chrome/browser/download/save_types.h"
+#include "googleurl/src/gurl.h"
class SavePackage;
@@ -23,8 +24,8 @@ class SaveItem {
CANCELED
};
- SaveItem(const std::wstring& url,
- const std::wstring& referrer,
+ SaveItem(const GURL& url,
+ const GURL& referrer,
SavePackage* package,
SaveFileCreateInfo::SaveFileSource save_source);
@@ -56,8 +57,8 @@ class SaveItem {
SaveState state() const { return state_; }
const std::wstring full_path() const { return full_path_; }
const std::wstring file_name() const { return file_name_; }
- const std::wstring& url() const { return url_; }
- const std::wstring& referrer() const { return referrer_; }
+ const GURL& url() const { return url_; }
+ const GURL& referrer() const { return referrer_; }
int64 total_bytes() const { return total_bytes_; }
int64 received_bytes() const { return received_bytes_; }
int32 save_id() const { return save_id_; }
@@ -82,8 +83,8 @@ class SaveItem {
std::wstring file_name_;
// The URL for this save item.
- std::wstring url_;
- std::wstring referrer_;
+ GURL url_;
+ GURL referrer_;
// Total bytes expected.
int64 total_bytes_;
diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc
index 6ddc554..4c6d938 100644
--- a/chrome/browser/download/save_package.cc
+++ b/chrome/browser/download/save_package.cc
@@ -109,7 +109,7 @@ SavePackage::SavePackage(WebContents* web_content,
DCHECK(web_content);
const GURL& current_page_url = web_contents_->GetURL();
DCHECK(current_page_url.is_valid());
- page_url_ = UTF8ToWide(current_page_url.spec());
+ page_url_ = current_page_url;
DCHECK(save_type_ == SAVE_AS_ONLY_HTML ||
save_type_ == SAVE_AS_COMPLETE_HTML);
DCHECK(!saved_main_file_path_.empty() &&
@@ -230,7 +230,7 @@ bool SavePackage::Init() {
SaveFileCreateInfo::SAVE_FILE_FROM_FILE :
SaveFileCreateInfo::SAVE_FILE_FROM_NET;
SaveItem* save_item = new SaveItem(page_url_,
- L"",
+ GURL(),
this,
save_source);
// Add this item to waiting list.
@@ -329,9 +329,9 @@ bool SavePackage::GenerateFilename(const std::string& disposition,
// We have received a message from SaveFileManager about a new saving job. We
// create a SaveItem and store it in our in_progress list.
void SavePackage::StartSave(const SaveFileCreateInfo* info) {
- DCHECK(info && !info->url.empty());
+ DCHECK(info && !info->url.is_empty());
- SaveUrlItemMap::iterator it = in_progress_items_.find(info->url);
+ SaveUrlItemMap::iterator it = in_progress_items_.find(info->url.spec());
if (it == in_progress_items_.end()) {
// If not found, we must have cancel action.
DCHECK(canceled());
@@ -409,8 +409,8 @@ void SavePackage::StartSave(const SaveFileCreateInfo* info) {
// Look up SaveItem by save id from in progress map.
SaveItem* SavePackage::LookupItemInProcessBySaveId(int32 save_id) {
if (in_process_count()) {
- SaveUrlItemMap::iterator it = in_progress_items_.begin();
- for (; it != in_progress_items_.end(); ++it) {
+ for (SaveUrlItemMap::iterator it = in_progress_items_.begin();
+ it != in_progress_items_.end(); ++it) {
SaveItem* save_item = it->second;
DCHECK(save_item->state() == SaveItem::IN_PROGRESS);
if (save_item->save_id() == save_id)
@@ -423,7 +423,7 @@ SaveItem* SavePackage::LookupItemInProcessBySaveId(int32 save_id) {
// Remove SaveItem from in progress map and put it to saved map.
void SavePackage::PutInProgressItemToSavedMap(SaveItem* save_item) {
SaveUrlItemMap::iterator it = in_progress_items_.find(
- save_item->url());
+ save_item->url().spec());
DCHECK(it != in_progress_items_.end());
DCHECK(save_item == it->second);
in_progress_items_.erase(it);
@@ -435,9 +435,9 @@ void SavePackage::PutInProgressItemToSavedMap(SaveItem* save_item) {
saved_success_items_[save_item->save_id()] = save_item;
} else {
// Add it to saved_failed_items_.
- DCHECK(saved_failed_items_.find(save_item->url()) ==
+ DCHECK(saved_failed_items_.find(save_item->url().spec()) ==
saved_failed_items_.end());
- saved_failed_items_[save_item->url()] = save_item;
+ saved_failed_items_[save_item->url().spec()] = save_item;
}
}
@@ -599,8 +599,8 @@ void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) {
// this error.
// Saving an item failed. If it's a sub-resource, ignore it. If the error comes
// from serializing HTML data, then cancel saving page.
-void SavePackage::SaveFailed(const std::wstring& save_url) {
- SaveUrlItemMap::iterator it = in_progress_items_.find(save_url);
+void SavePackage::SaveFailed(const GURL& save_url) {
+ SaveUrlItemMap::iterator it = in_progress_items_.find(save_url.spec());
if (it == in_progress_items_.end()) {
NOTREACHED(); // Should not exist!
return;
@@ -660,9 +660,9 @@ void SavePackage::SaveNextFile(bool process_all_remaining_items) {
// Add the item to in_progress_items_.
SaveUrlItemMap::iterator it = in_progress_items_.find(
- save_item->url());
+ save_item->url().spec());
DCHECK(it == in_progress_items_.end());
- in_progress_items_[save_item->url()] = save_item;
+ in_progress_items_[save_item->url().spec()] = save_item;
save_item->Start();
file_manager_->SaveURL(save_item->url(),
save_item->referrer(),
@@ -744,7 +744,7 @@ void SavePackage::DoSavingProcess() {
void SavePackage::GetSerializedHtmlDataForCurrentPageWithLocalLinks() {
if (wait_state_ != HTML_DATA)
return;
- std::vector<std::wstring> saved_links;
+ std::vector<GURL> saved_links;
std::vector<std::wstring> saved_file_paths;
int successful_started_items_count = 0;
@@ -815,8 +815,7 @@ void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url,
return;
}
- std::wstring current_frame_url = UTF8ToWide(frame_url.spec());
- SaveUrlItemMap::iterator it = in_progress_items_.find(current_frame_url);
+ SaveUrlItemMap::iterator it = in_progress_items_.find(frame_url.spec());
if (it == in_progress_items_.end())
return;
SaveItem* save_item = it->second;
@@ -886,15 +885,15 @@ void SavePackage::OnReceivedSavableResourceLinksForCurrentPage(
SaveFileCreateInfo::SaveFileSource save_source = u.SchemeIsFile() ?
SaveFileCreateInfo::SAVE_FILE_FROM_FILE :
SaveFileCreateInfo::SAVE_FILE_FROM_NET;
- SaveItem* save_item = new SaveItem(UTF8ToWide(u.spec()),
- UTF8ToWide(referrers_list[i].spec()), this, save_source);
+ SaveItem* save_item = new SaveItem(u, referrers_list[i],
+ this, save_source);
waiting_item_queue_.push(save_item);
}
// Put all HTML resources to wait list.
for (int i = 0; i < static_cast<int>(frames_list.size()); ++i) {
const GURL& u = frames_list[i];
DCHECK(u.is_valid());
- SaveItem* save_item = new SaveItem(UTF8ToWide(u.spec()), L"",
+ SaveItem* save_item = new SaveItem(u, GURL(),
this, SaveFileCreateInfo::SAVE_FILE_FROM_DOM);
waiting_item_queue_.push(save_item);
}
diff --git a/chrome/browser/download/save_package.h b/chrome/browser/download/save_package.h
index 6bbe7b2..5dbc9e6 100644
--- a/chrome/browser/download/save_package.h
+++ b/chrome/browser/download/save_package.h
@@ -98,7 +98,7 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>,
void StartSave(const SaveFileCreateInfo* info);
bool UpdateSaveProgress(int32 save_id, int64 size, bool write_success);
void SaveFinished(int32 save_id, int64 size, bool is_success);
- void SaveFailed(const std::wstring& save_url);
+ void SaveFailed(const GURL& save_url);
void SaveCanceled(SaveItem* save_item);
// Rough percent complete, -1 means we don't know (since we didn't receive a
@@ -228,7 +228,7 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>,
SaveItem* LookupItemInProcessBySaveId(int32 save_id);
void PutInProgressItemToSavedMap(SaveItem* save_item);
- typedef base::hash_map<std::wstring, SaveItem*> SaveUrlItemMap;
+ typedef base::hash_map<std::string, SaveItem*> SaveUrlItemMap;
// in_progress_items_ is map of all saving job in in-progress state.
SaveUrlItemMap in_progress_items_;
// saved_failed_items_ is map of all saving job which are failed.
@@ -268,7 +268,7 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>,
DownloadItem* download_;
// The URL of the page the user wants to save.
- std::wstring page_url_;
+ GURL page_url_;
FilePath saved_main_file_path_;
FilePath saved_main_directory_path_;
diff --git a/chrome/browser/download/save_types.h b/chrome/browser/download/save_types.h
index 624aaa6..7e19d18 100644
--- a/chrome/browser/download/save_types.h
+++ b/chrome/browser/download/save_types.h
@@ -9,6 +9,7 @@
#include <utility>
#include "base/basictypes.h"
+#include "googleurl/src/gurl.h"
typedef std::vector<std::pair<int, std::wstring> > FinalNameList;
typedef std::vector<int> SaveIDList;
@@ -29,7 +30,7 @@ struct SaveFileCreateInfo {
};
SaveFileCreateInfo(const std::wstring& path,
- const std::wstring& url,
+ const GURL& url,
SaveFileSource save_source,
int32 save_id)
: path(path),
@@ -48,9 +49,9 @@ struct SaveFileCreateInfo {
// The local file path of saved file.
std::wstring path;
// Original URL of the saved resource.
- std::wstring url;
+ GURL url;
// Final URL of the saved resource since some URL might be redirected.
- std::wstring final_url;
+ GURL final_url;
// The unique identifier for saving job, assigned at creation by
// the SaveFileManager for its internal record keeping.
int save_id;
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);
}
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc
index d8f66a8..66ef1f3 100644
--- a/chrome/browser/renderer_host/buffered_resource_handler.cc
+++ b/chrome/browser/renderer_host/buffered_resource_handler.cc
@@ -248,7 +248,7 @@ bool BufferedResourceHandler::CompleteResponseStarted(int request_id,
scoped_refptr<DownloadThrottlingResourceHandler> download_handler =
new DownloadThrottlingResourceHandler(host_,
request_,
- request_->url().spec(),
+ request_->url(),
info->render_process_host_id,
info->render_view_id,
request_id,
diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc
index de34a60..9351f56 100644
--- a/chrome/browser/renderer_host/download_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_resource_handler.cc
@@ -19,7 +19,7 @@ DownloadResourceHandler::DownloadResourceHandler(ResourceDispatcherHost* rdh,
int render_process_host_id,
int render_view_id,
int request_id,
- const std::string& url,
+ const GURL& url,
DownloadFileManager* manager,
URLRequest* request,
bool save_as)
@@ -27,7 +27,7 @@ DownloadResourceHandler::DownloadResourceHandler(ResourceDispatcherHost* rdh,
global_id_(ResourceDispatcherHost::GlobalRequestID(render_process_host_id,
request_id)),
render_view_id_(render_view_id),
- url_(UTF8ToWide(url)),
+ url_(url),
content_length_(0),
download_manager_(manager),
request_(request),
@@ -40,7 +40,7 @@ DownloadResourceHandler::DownloadResourceHandler(ResourceDispatcherHost* rdh,
// Not needed, as this event handler ought to be the final resource.
bool DownloadResourceHandler::OnRequestRedirected(int request_id,
const GURL& url) {
- url_ = UTF8ToWide(url.spec());
+ url_ = url;
return true;
}
diff --git a/chrome/browser/renderer_host/download_resource_handler.h b/chrome/browser/renderer_host/download_resource_handler.h
index 0dbeef0..dfc047e 100644
--- a/chrome/browser/renderer_host/download_resource_handler.h
+++ b/chrome/browser/renderer_host/download_resource_handler.h
@@ -19,7 +19,7 @@ class DownloadResourceHandler : public ResourceHandler {
int render_process_host_id,
int render_view_id,
int request_id,
- const std::string& url,
+ const GURL& url,
DownloadFileManager* manager,
URLRequest* request,
bool save_as);
@@ -56,7 +56,7 @@ class DownloadResourceHandler : public ResourceHandler {
int render_view_id_;
scoped_refptr<net::IOBuffer> read_buffer_;
std::string content_disposition_;
- std::wstring url_;
+ GURL url_;
int64 content_length_;
DownloadFileManager* download_manager_;
URLRequest* request_;
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.cc b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
index ea4fdbb..f049788 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
@@ -10,7 +10,7 @@
DownloadThrottlingResourceHandler::DownloadThrottlingResourceHandler(
ResourceDispatcherHost* host,
URLRequest* request,
- const std::string& url,
+ const GURL& url,
int render_process_host_id,
int render_view_id,
int request_id,
@@ -44,7 +44,7 @@ bool DownloadThrottlingResourceHandler::OnRequestRedirected(int request_id,
const GURL& url) {
if (download_handler_.get())
return download_handler_->OnRequestRedirected(request_id, url);
- url_ = url.spec();
+ url_ = url;
return true;
}
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.h b/chrome/browser/renderer_host/download_throttling_resource_handler.h
index 6f7c3d9..80c5a00 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.h
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.h
@@ -8,6 +8,7 @@
#include <string>
#include "chrome/browser/renderer_host/resource_handler.h"
+#include "googleurl/src/gurl.h"
#if defined(OS_WIN)
// TODO(port): Remove ifdef when downloads are ported.
@@ -33,7 +34,7 @@ class DownloadThrottlingResourceHandler
public:
DownloadThrottlingResourceHandler(ResourceDispatcherHost* host,
URLRequest* request,
- const std::string& url,
+ const GURL& url,
int render_process_host_id,
int render_view_id,
int request_id,
@@ -61,7 +62,7 @@ class DownloadThrottlingResourceHandler
ResourceDispatcherHost* host_;
URLRequest* request_;
- std::string url_;
+ GURL url_;
int render_process_host_id_;
int render_view_id_;
int request_id_;
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index b78c4c9..d8d34f7 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1223,7 +1223,7 @@ void RenderViewHost::OnDidGetApplicationInfo(
}
void RenderViewHost::GetSerializedHtmlDataForCurrentPageWithLocalLinks(
- const std::vector<std::wstring>& links,
+ const std::vector<GURL>& links,
const std::vector<std::wstring>& local_paths,
const std::wstring& local_directory_name) {
Send(new ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks(
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 2cd9d29..01f1097 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -351,7 +351,7 @@ class RenderViewHost : public RenderWidgetHost {
// The parameter local_directory_name is relative path of directory which
// contain all saved auxiliary files included all sub frames and resouces.
void GetSerializedHtmlDataForCurrentPageWithLocalLinks(
- const std::vector<std::wstring>& links,
+ const std::vector<GURL>& links,
const std::vector<std::wstring>& local_paths,
const std::wstring& local_directory_name);
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 65b5c3d..5c1bd26 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -349,7 +349,7 @@ void ResourceDispatcherHost::BeginDownload(const GURL& url,
render_process_host_id,
render_view_id,
request_id_,
- url.spec(),
+ url,
download_file_manager_.get(),
request,
true);
@@ -405,7 +405,7 @@ void ResourceDispatcherHost::BeginSaveFile(const GURL& url,
scoped_refptr<ResourceHandler> handler =
new SaveFileResourceHandler(render_process_host_id,
render_view_id,
- url.spec(),
+ url,
save_file_manager_.get());
request_id_--;
diff --git a/chrome/browser/renderer_host/save_file_resource_handler.cc b/chrome/browser/renderer_host/save_file_resource_handler.cc
index 3a1b753..139f5a00 100644
--- a/chrome/browser/renderer_host/save_file_resource_handler.cc
+++ b/chrome/browser/renderer_host/save_file_resource_handler.cc
@@ -14,19 +14,19 @@
SaveFileResourceHandler::SaveFileResourceHandler(int render_process_host_id,
int render_view_id,
- const std::string& url,
+ const GURL& url,
SaveFileManager* manager)
: save_id_(-1),
render_process_id_(render_process_host_id),
render_view_id_(render_view_id),
- url_(UTF8ToWide(url)),
+ url_(url),
content_length_(0),
save_manager_(manager) {
}
bool SaveFileResourceHandler::OnRequestRedirected(int request_id,
const GURL& url) {
- final_url_ = UTF8ToWide(url.spec());
+ final_url_ = url;
return true;
}
diff --git a/chrome/browser/renderer_host/save_file_resource_handler.h b/chrome/browser/renderer_host/save_file_resource_handler.h
index 30fc074..63d78ad 100644
--- a/chrome/browser/renderer_host/save_file_resource_handler.h
+++ b/chrome/browser/renderer_host/save_file_resource_handler.h
@@ -16,7 +16,7 @@ class SaveFileResourceHandler : public ResourceHandler {
public:
SaveFileResourceHandler(int render_process_host_id,
int render_view_id,
- const std::string& url,
+ const GURL& url,
SaveFileManager* manager);
// Saves the redirected URL to final_url_, we need to use the original
@@ -53,8 +53,8 @@ class SaveFileResourceHandler : public ResourceHandler {
int render_view_id_;
scoped_refptr<net::IOBuffer> read_buffer_;
std::string content_disposition_;
- std::wstring url_;
- std::wstring final_url_;
+ GURL url_;
+ GURL final_url_;
int64 content_length_;
SaveFileManager* save_manager_;
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index e6b401e..76e53c4 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -401,7 +401,7 @@ IPC_BEGIN_MESSAGES(View)
// Get html data by serializing all frames of current page with lists
// which contain all resource links that have local copy.
IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks,
- std::vector<std::wstring> /* urls that have local copy */,
+ std::vector<GURL> /* urls that have local copy */,
std::vector<std::wstring> /* paths of local copy */,
std::wstring /* local directory path */)
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index 9e51a80..9bbaa7f 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -456,7 +456,7 @@ class SaveFileManager : public base::RefCountedThreadSafe<SaveFileManager> {
void UpdateSaveProgress(int save_id, net::IOBuffer* data, int size) {
NOTIMPLEMENTED();
}
- void SaveFinished(int save_id, const std::wstring& save_url,
+ void SaveFinished(int save_id, const GURL& save_url,
int render_process_id, int is_success) {
NOTIMPLEMENTED();
}
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 062cde4..bd300e1 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2718,7 +2718,7 @@ void RenderView::OnGetAllSavableResourceLinksForCurrentPage(
}
void RenderView::OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
- const std::vector<std::wstring>& links,
+ const std::vector<GURL>& links,
const std::vector<std::wstring>& local_paths,
const std::wstring& local_directory_name) {
webkit_glue::DomSerializer dom_serializer(webview()->GetMainFrame(),
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 03710f3..b177ed0 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -435,7 +435,7 @@ class RenderView : public RenderWidget,
void OnSetPageEncoding(const std::wstring& encoding_name);
void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
- const std::vector<std::wstring>& links,
+ const std::vector<GURL>& links,
const std::vector<std::wstring>& local_paths,
const std::wstring& local_directory_name);
void OnUploadFileRequest(const ViewMsg_UploadFile_Params& p);