diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-18 22:39:31 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-18 22:39:31 +0000 |
commit | fde6714d19b512b6190f08082c2ea05a21050253 (patch) | |
tree | 652fb54b3891708438648dd8d6cc6e0ebda700eb | |
parent | f90efcffb6df294c6e0269aac4a4a4442b9505f3 (diff) | |
download | chromium_src-fde6714d19b512b6190f08082c2ea05a21050253.zip chromium_src-fde6714d19b512b6190f08082c2ea05a21050253.tar.gz chromium_src-fde6714d19b512b6190f08082c2ea05a21050253.tar.bz2 |
Prepare some files for porting:
- Trade in some old wstrings for FilePaths.
- Remove some unnecessary headers.
Review URL: http://codereview.chromium.org/21466
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9986 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/download/save_file.cc | 4 | ||||
-rw-r--r-- | chrome/browser/download/save_file.h | 9 | ||||
-rw-r--r-- | chrome/browser/download/save_file_manager.cc | 31 | ||||
-rw-r--r-- | chrome/browser/download/save_file_manager.h | 11 | ||||
-rw-r--r-- | chrome/browser/download/save_item.cc | 4 | ||||
-rw-r--r-- | chrome/browser/download/save_item.h | 11 | ||||
-rw-r--r-- | chrome/browser/download/save_package.cc | 15 | ||||
-rw-r--r-- | chrome/browser/download/save_types.h | 7 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 4 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 4 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 4 | ||||
-rw-r--r-- | webkit/glue/dom_serializer.cc | 15 | ||||
-rw-r--r-- | webkit/glue/dom_serializer.h | 13 | ||||
-rw-r--r-- | webkit/glue/dom_serializer_unittest.cc | 8 |
16 files changed, 77 insertions, 71 deletions
diff --git a/chrome/browser/download/save_file.cc b/chrome/browser/download/save_file.cc index b889bd2..a060172 100644 --- a/chrome/browser/download/save_file.cc +++ b/chrome/browser/download/save_file.cc @@ -58,7 +58,7 @@ void SaveFile::Cancel() { } // Rename the file when we have final name. -bool SaveFile::Rename(const std::wstring& new_path) { +bool SaveFile::Rename(const FilePath& new_path) { Close(); DCHECK(!path_renamed()); @@ -101,7 +101,7 @@ bool SaveFile::Open(const char* open_mode) { // Sets the zone to tell Windows that this file comes from the Internet. // We ignore the return value because a failure is not fatal. // TODO(port): Similarly mark on Mac. - win_util::SetInternetZoneIdentifier(FilePath::FromWStringHack(full_path_)); + win_util::SetInternetZoneIdentifier(full_path_); #endif return true; } diff --git a/chrome/browser/download/save_file.h b/chrome/browser/download/save_file.h index 361e20c..33ec7be 100644 --- a/chrome/browser/download/save_file.h +++ b/chrome/browser/download/save_file.h @@ -5,9 +5,8 @@ #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_FILE_H__ #define CHROME_BROWSER_DOWNLOAD_SAVE_FILE_H__ -#include <string> - #include "base/basictypes.h" +#include "base/file_path.h" #include "base/scoped_ptr.h" #include "chrome/browser/download/save_types.h" @@ -30,7 +29,7 @@ class SaveFile { void Cancel(); // Rename the saved file. Returns 'true' if the rename was successful. - bool Rename(const std::wstring& full_path); + bool Rename(const FilePath& full_path); void Finish(); @@ -44,7 +43,7 @@ class SaveFile { } int64 bytes_so_far() const { return bytes_so_far_; } - std::wstring full_path() const { return full_path_; } + FilePath full_path() const { return full_path_; } bool path_renamed() const { return path_renamed_; } bool in_progress() const { return in_progress_; } @@ -65,7 +64,7 @@ class SaveFile { int64 bytes_so_far_; // Full path to the saved file including the file name. - std::wstring full_path_; + FilePath full_path_; // Whether the saved file is still using its initial temporary path. bool path_renamed_; diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc index 510b94c..1ec3af5 100644 --- a/chrome/browser/download/save_file_manager.cc +++ b/chrome/browser/download/save_file_manager.cc @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <Windows.h> -#include <objbase.h> +#include "build/build_config.h" #include "chrome/browser/download/save_file_manager.h" @@ -21,13 +20,15 @@ #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/stl_util-inl.h" -#include "chrome/common/win_util.h" -#include "chrome/common/win_safe_util.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" #include "net/base/io_buffer.h" #include "net/url_request/url_request_context.h" +#if defined(OS_WIN) +#include "chrome/common/win_util.h" +#endif + SaveFileManager::SaveFileManager(MessageLoop* ui_loop, MessageLoop* io_loop, ResourceDispatcherHost* rdh) @@ -154,7 +155,7 @@ void SaveFileManager::SaveURL(const GURL& url, int render_process_host_id, int render_view_id, SaveFileCreateInfo::SaveFileSource save_source, - const std::wstring& file_full_path, + const FilePath& file_full_path, URLRequestContext* request_context, SavePackage* save_package) { DCHECK(MessageLoop::current() == ui_loop_); @@ -224,7 +225,7 @@ SavePackage* SaveFileManager::GetSavePackageFromRenderIds( } // Utility function for deleting specified file. -void SaveFileManager::DeleteDirectoryOrFile(const std::wstring& full_path, +void SaveFileManager::DeleteDirectoryOrFile(const FilePath& full_path, bool is_dir) { DCHECK(MessageLoop::current() == ui_loop_); MessageLoop* loop = GetSaveLoop(); @@ -497,14 +498,13 @@ void SaveFileManager::SaveLocalFile(const GURL& original_file_url, // Copy the local file to the temporary file. It will be renamed to its // final name later. - bool success = file_util::CopyFile(file_path, - FilePath::FromWStringHack(save_file->full_path())); + bool success = file_util::CopyFile(file_path, save_file->full_path()); if (!success) file_util::Delete(save_file->full_path(), false); SaveFinished(save_id, original_file_url, render_process_id, success); } -void SaveFileManager::OnDeleteDirectoryOrFile(const std::wstring& full_path, +void SaveFileManager::OnDeleteDirectoryOrFile(const FilePath& full_path, bool is_dir) { DCHECK(MessageLoop::current() == GetSaveLoop()); DCHECK(!full_path.empty()); @@ -514,14 +514,19 @@ void SaveFileManager::OnDeleteDirectoryOrFile(const std::wstring& full_path, // Open a saved page package, show it in a Windows Explorer window. // We run on this thread to avoid blocking the UI with slow Shell operations. -void SaveFileManager::OnShowSavedFileInShell(const std::wstring full_path) { +void SaveFileManager::OnShowSavedFileInShell(const FilePath full_path) { DCHECK(MessageLoop::current() == GetSaveLoop()); - win_util::ShowItemInFolder(full_path); + // TODO(port): make an equivalent call on mac/linux. +#if defined(OS_WIN) + win_util::ShowItemInFolder(full_path.value()); +#elif defined(OS_POSIX) + NOTIMPLEMENTED(); +#endif } void SaveFileManager::RenameAllFiles( const FinalNameList& final_names, - const std::wstring& resource_dir, + const FilePath& resource_dir, int render_process_id, int render_view_id) { DCHECK(MessageLoop::current() == GetSaveLoop()); @@ -571,7 +576,7 @@ void SaveFileManager::RemoveSavedFileFromFileMap( if (it != save_file_map_.end()) { SaveFile* save_file = it->second; DCHECK(!save_file->in_progress()); - DeleteFile(save_file->full_path().c_str()); + file_util::Delete(save_file->full_path(), false); delete save_file; save_file_map_.erase(it); } diff --git a/chrome/browser/download/save_file_manager.h b/chrome/browser/download/save_file_manager.h index 4df5abf..89672fc 100644 --- a/chrome/browser/download/save_file_manager.h +++ b/chrome/browser/download/save_file_manager.h @@ -61,6 +61,7 @@ #include <utility> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/hash_tables.h" #include "base/ref_counted.h" #include "base/thread.h" @@ -98,7 +99,7 @@ class SaveFileManager int render_process_host_id, int render_view_id, SaveFileCreateInfo::SaveFileSource save_source, - const std::wstring& file_full_path, + const FilePath& file_full_path, URLRequestContext* request_context, SavePackage* save_package); @@ -118,10 +119,10 @@ class SaveFileManager SavePackage* package); // Handler for shell operations sent from the UI to the file thread. - void OnShowSavedFileInShell(const std::wstring full_path); + void OnShowSavedFileInShell(const FilePath full_path); // Helper function for deleting specified file. - void DeleteDirectoryOrFile(const std::wstring& full_path, bool is_dir); + void DeleteDirectoryOrFile(const FilePath& full_path, bool is_dir); // For posting notifications from the UI and IO threads. MessageLoop* GetSaveLoop() const { return file_loop_; } @@ -137,7 +138,7 @@ class SaveFileManager // final names of successfully saved files. void RenameAllFiles( const FinalNameList& final_names, - const std::wstring& resource_dir, + const FilePath& resource_dir, int render_process_id, int render_view_id); @@ -204,7 +205,7 @@ class SaveFileManager // Notifications sent from the UI thread and run on the file thread. // Deletes a specified file on the file thread. - void OnDeleteDirectoryOrFile(const std::wstring& full_path, bool is_dir); + void OnDeleteDirectoryOrFile(const FilePath& full_path, bool is_dir); // Notifications sent from the UI thread and run on the IO thread diff --git a/chrome/browser/download/save_item.cc b/chrome/browser/download/save_item.cc index bd96010..da96b88 100644 --- a/chrome/browser/download/save_item.cc +++ b/chrome/browser/download/save_item.cc @@ -113,10 +113,10 @@ int SaveItem::PercentComplete() const { } // Rename the save item with new path. -void SaveItem::Rename(const std::wstring& full_path) { +void SaveItem::Rename(const FilePath& full_path) { DCHECK(!full_path.empty() && !has_final_name()); full_path_ = full_path; - file_name_ = file_util::GetFilenameFromPath(full_path_); + file_name_ = full_path_.BaseName(); has_final_name_ = true; } diff --git a/chrome/browser/download/save_item.h b/chrome/browser/download/save_item.h index b54840a..62fe877 100644 --- a/chrome/browser/download/save_item.h +++ b/chrome/browser/download/save_item.h @@ -8,6 +8,7 @@ #include <string> #include "base/basictypes.h" +#include "base/file_path.h" #include "chrome/browser/download/save_types.h" #include "googleurl/src/gurl.h" @@ -47,7 +48,7 @@ class SaveItem { int PercentComplete() const; // Update path for SaveItem, the actual file is renamed on the file thread. - void Rename(const std::wstring& full_path); + void Rename(const FilePath& full_path); void SetSaveId(int32 save_id); @@ -55,8 +56,8 @@ class SaveItem { // Accessors. SaveState state() const { return state_; } - const std::wstring full_path() const { return full_path_; } - const std::wstring file_name() const { return file_name_; } + const FilePath& full_path() const { return full_path_; } + const FilePath& file_name() const { return file_name_; } const GURL& url() const { return url_; } const GURL& referrer() const { return referrer_; } int64 total_bytes() const { return total_bytes_; } @@ -77,10 +78,10 @@ class SaveItem { int32 save_id_; // Full path to the save item file. - std::wstring full_path_; + FilePath full_path_; // Short display version of the file. - std::wstring file_name_; + FilePath file_name_; // The URL for this save item. GURL url_; diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 4c6d938..91e0b41 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -380,10 +380,10 @@ void SavePackage::StartSave(const SaveFileCreateInfo* info) { // Now we get final name retrieved from GenerateFilename, we will use it // rename the SaveItem. FilePath final_name = saved_main_directory_path_.Append(generated_name); - save_item->Rename(final_name.ToWStringHack()); + save_item->Rename(final_name); } else { // It is the main HTML file, use the name chosen by the user. - save_item->Rename(saved_main_file_path_.ToWStringHack()); + save_item->Rename(saved_main_file_path_); } // If the save source is from file system, inform SaveFileManager to copy @@ -524,7 +524,7 @@ void SavePackage::CheckFinish() { NewRunnableMethod(file_manager_, &SaveFileManager::RenameAllFiles, final_names, - dir.ToWStringHack(), + dir, web_contents_->process()->host_id(), web_contents_->render_view_host()->routing_id())); } @@ -684,7 +684,7 @@ void SavePackage::ShowDownloadInShell() { file_manager_->GetSaveLoop()->PostTask(FROM_HERE, NewRunnableMethod(file_manager_, &SaveFileManager::OnShowSavedFileInShell, - saved_main_file_path_.ToWStringHack())); + saved_main_file_path_)); } // Calculate the percentage of whole save page job. @@ -745,7 +745,7 @@ void SavePackage::GetSerializedHtmlDataForCurrentPageWithLocalLinks() { if (wait_state_ != HTML_DATA) return; std::vector<GURL> saved_links; - std::vector<std::wstring> saved_file_paths; + std::vector<FilePath> saved_file_paths; int successful_started_items_count = 0; // Collect all saved items which have local storage. @@ -778,12 +778,9 @@ void SavePackage::GetSerializedHtmlDataForCurrentPageWithLocalLinks() { // Get the relative directory name. FilePath relative_dir_name = saved_main_directory_path_.BaseName(); - std::wstring relative_dir_name_str = std::wstring(L"./") + - relative_dir_name.ToWStringHack() + L"/"; - web_contents_->render_view_host()-> GetSerializedHtmlDataForCurrentPageWithLocalLinks( - saved_links, saved_file_paths, relative_dir_name_str); + saved_links, saved_file_paths, relative_dir_name); } // Process the serialized HTML content data of a specified web page diff --git a/chrome/browser/download/save_types.h b/chrome/browser/download/save_types.h index 7e19d18..b88361f 100644 --- a/chrome/browser/download/save_types.h +++ b/chrome/browser/download/save_types.h @@ -9,9 +9,10 @@ #include <utility> #include "base/basictypes.h" +#include "base/file_path.h" #include "googleurl/src/gurl.h" -typedef std::vector<std::pair<int, std::wstring> > FinalNameList; +typedef std::vector<std::pair<int, FilePath> > FinalNameList; typedef std::vector<int> SaveIDList; // This structure is used to handle and deliver some info @@ -29,7 +30,7 @@ struct SaveFileCreateInfo { SAVE_FILE_FROM_FILE }; - SaveFileCreateInfo(const std::wstring& path, + SaveFileCreateInfo(const FilePath& path, const GURL& url, SaveFileSource save_source, int32 save_id) @@ -47,7 +48,7 @@ struct SaveFileCreateInfo { // SaveItem fields. // The local file path of saved file. - std::wstring path; + FilePath path; // Original URL of the saved resource. GURL url; // Final URL of the saved resource since some URL might be redirected. diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 8c64d5f..ae84b8f 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1229,8 +1229,8 @@ void RenderViewHost::OnDidGetApplicationInfo( void RenderViewHost::GetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<GURL>& links, - const std::vector<std::wstring>& local_paths, - const std::wstring& local_directory_name) { + const std::vector<FilePath>& local_paths, + const FilePath& local_directory_name) { Send(new ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks( routing_id(), links, local_paths, local_directory_name)); } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 2f36219..15d0c6f 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -352,8 +352,8 @@ class RenderViewHost : public RenderWidgetHost { // contain all saved auxiliary files included all sub frames and resouces. void GetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<GURL>& links, - const std::vector<std::wstring>& local_paths, - const std::wstring& local_directory_name); + const std::vector<FilePath>& local_paths, + const FilePath& local_directory_name); // Notifies the RenderViewHost that a file has been chosen by the user from // an Open File dialog for the form. diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 3a63487..02a9a43 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -422,8 +422,8 @@ IPC_BEGIN_MESSAGES(View) // which contain all resource links that have local copy. IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, std::vector<GURL> /* urls that have local copy */, - std::vector<std::wstring> /* paths of local copy */, - std::wstring /* local directory path */) + std::vector<FilePath> /* paths of local copy */, + FilePath /* local directory path */) // Requests application info for the page. The renderer responds back with // ViewHostMsg_DidGetApplicationInfo. diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index a8adb2f..4fa5bdf 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2717,8 +2717,8 @@ void RenderView::OnGetAllSavableResourceLinksForCurrentPage( void RenderView::OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<GURL>& links, - const std::vector<std::wstring>& local_paths, - const std::wstring& local_directory_name) { + const std::vector<FilePath>& local_paths, + const FilePath& local_directory_name) { webkit_glue::DomSerializer dom_serializer(webview()->GetMainFrame(), true, this, diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 6cafaa6..59e2fad 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -445,8 +445,8 @@ class RenderView : public RenderWidget, void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<GURL>& links, - const std::vector<std::wstring>& local_paths, - const std::wstring& local_directory_name); + const std::vector<FilePath>& local_paths, + const FilePath& local_directory_name); void OnUploadFileRequest(const ViewMsg_UploadFile_Params& p); void OnFormFill(const FormData& form); void OnFillPasswordForm(const PasswordFormDomManager::FillData& form_data); diff --git a/webkit/glue/dom_serializer.cc b/webkit/glue/dom_serializer.cc index cb8d92e..d649f5d 100644 --- a/webkit/glue/dom_serializer.cc +++ b/webkit/glue/dom_serializer.cc @@ -148,7 +148,7 @@ DomSerializer::SerializeDomParam::SerializeDomParam( const GURL& current_frame_gurl, const WebCore::TextEncoding& text_encoding, WebCore::Document* doc, - const std::wstring& directory_name) + const FilePath& directory_name) : current_frame_gurl(current_frame_gurl), text_encoding(text_encoding), doc(doc), @@ -380,8 +380,8 @@ void DomSerializer::OpenTagToString(const WebCore::Element* element, LinkLocalPathMap::const_iterator it = local_links_.find(value); if (it != local_links_.end()) { // Replace the link when we have local files. - result += StdWStringToString(param->directory_name); - result += StdWStringToString(it->second); + result += FilePathStringToString(param->directory_name.value()); + result += FilePathStringToString(it->second.value()); } else { // If not found local path, replace it with absolute link. result += str_value; @@ -482,8 +482,8 @@ DomSerializer::DomSerializer(WebFrame* webframe, bool recursive_serialization, DomSerializerDelegate* delegate, const std::vector<GURL>& links, - const std::vector<std::wstring>& local_paths, - const std::wstring& local_directory_name) + const std::vector<FilePath>& local_paths, + const FilePath& local_directory_name) : delegate_(delegate), recursive_serialization_(recursive_serialization), frames_collected_(false), @@ -496,7 +496,7 @@ DomSerializer::DomSerializer(WebFrame* webframe, // Build local resources map. DCHECK(links.size() == local_paths.size()); std::vector<GURL>::const_iterator link_it = links.begin(); - std::vector<std::wstring>::const_iterator path_it = local_paths.begin(); + std::vector<FilePath>::const_iterator path_it = local_paths.begin(); for (; link_it != links.end(); ++link_it, ++path_it) { bool never_present = local_links_.insert( LinkLocalPathMap::value_type(link_it->spec(), *path_it)). @@ -576,7 +576,8 @@ bool DomSerializer::SerializeDom() { encoding.length() ? text_encoding : WebCore::UTF8Encoding(), current_doc, current_frame_gurl == main_page_gurl ? - local_directory_name_ : L"./"); + local_directory_name_ : + FilePath(FilePath::kCurrentDirectory)); // Process current document. WebCore::Element* root_element = current_doc->documentElement(); diff --git a/webkit/glue/dom_serializer.h b/webkit/glue/dom_serializer.h index b8073c1..a69082f 100644 --- a/webkit/glue/dom_serializer.h +++ b/webkit/glue/dom_serializer.h @@ -7,6 +7,7 @@ #include <string> +#include "base/file_path.h" #include "base/hash_tables.h" #include "googleurl/src/gurl.h" @@ -53,8 +54,8 @@ class DomSerializer { bool recursive_serialization, DomSerializerDelegate* delegate, const std::vector<GURL>& links, - const std::vector<std::wstring>& local_paths, - const std::wstring& local_directory_name); + const std::vector<FilePath>& local_paths, + const FilePath& local_directory_name); // Generate the MOTW declaration. static std::string GenerateMarkOfTheWebDeclaration(const GURL& url); @@ -67,7 +68,7 @@ class DomSerializer { WebFrameImpl* specified_webframeimpl_; // This hash_map is used to map resource URL of original link to its local // file path. - typedef base::hash_map<std::string, std::wstring> LinkLocalPathMap; + typedef base::hash_map<std::string, FilePath> LinkLocalPathMap; // local_links_ include all pair of local resource path and corresponding // original link. LinkLocalPathMap local_links_; @@ -83,7 +84,7 @@ class DomSerializer { // serialized or not; bool frames_collected_; // Local directory name of all local resource files. - const std::wstring& local_directory_name_; + const FilePath& local_directory_name_; // Vector for saving all frames which need to be serialized. std::vector<WebFrameImpl*> frames_; @@ -96,7 +97,7 @@ class DomSerializer { // Document object of current frame. WebCore::Document* doc; // Local directory name of all local resource files. - const std::wstring& directory_name; + const FilePath& directory_name; // Flag indicates current doc is html document or not. It's a cache value // of Document.isHTMLDocument(). @@ -118,7 +119,7 @@ class DomSerializer { const GURL& current_frame_gurl, const WebCore::TextEncoding& text_encoding, WebCore::Document* doc, - const std::wstring& directory_name); + const FilePath& directory_name); private: DISALLOW_EVIL_CONSTRUCTORS(SerializeDomParam); diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc index 317a374..c5c0072 100644 --- a/webkit/glue/dom_serializer_unittest.cc +++ b/webkit/glue/dom_serializer_unittest.cc @@ -44,7 +44,7 @@ class DomSerializerTests : public TestShellTest, public webkit_glue::DomSerializerDelegate { public: DomSerializerTests() - : local_directory_name_(L"./dummy_files/") { } + : local_directory_name_(FILE_PATH_LITERAL("./dummy_files/")) { } // DomSerializerDelegate. void DidSerializeDataForFrame(const GURL& frame_url, @@ -140,7 +140,7 @@ class DomSerializerTests : public TestShellTest, // Add input file URl to links_. links_.push_back(page_url); // Add dummy file path to local_path_. - local_paths_.push_back(std::wstring(L"c:\\dummy.htm")); + local_paths_.push_back(FilePath(FILE_PATH_LITERAL("c:\\dummy.htm"))); // Start serializing DOM. webkit_glue::DomSerializer dom_serializer(web_frame, recursive_serialization, this, links_, local_paths_, @@ -162,10 +162,10 @@ class DomSerializerTests : public TestShellTest, std::vector<GURL> links_; // The local_paths_ contain dummy corresponding local file paths of all saved // links, which matched links_ one by one. - std::vector<std::wstring> local_paths_; + std::vector<FilePath> local_paths_; // The local_directory_name_ is dummy relative path of directory which // contain all saved auxiliary files included all sub frames and resources. - const std::wstring local_directory_name_; + const FilePath local_directory_name_; protected: // testing::Test |