Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: ios/chrome/browser/reading_list/url_downloader.cc

Issue 2339373002: Prevent error in file path (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/url_downloader.cc
diff --git a/ios/chrome/browser/reading_list/url_downloader.cc b/ios/chrome/browser/reading_list/url_downloader.cc
index 8fabad8fb593f55f1e1adbae48f39e5e36e60cec..a13f218b0d751a305f7ebdc0339a5054d7041f01 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -166,8 +166,9 @@ void URLDownloader::DistillerCallback(
URLDownloader::SuccessState URLDownloader::SaveDistilledHTML(
const GURL& url,
- std::vector<dom_distiller::DistillerViewerInterface::ImageInfo> images,
- std::string html) {
+ const std::vector<dom_distiller::DistillerViewerInterface::ImageInfo>&
+ images,
+ const std::string& html) {
if (CreateOfflineURLDirectory(url)) {
return SaveHTMLForURL(SaveAndReplaceImagesInHTML(url, html, images), url)
? DOWNLOAD_SUCCESS
@@ -177,16 +178,16 @@ URLDownloader::SuccessState URLDownloader::SaveDistilledHTML(
}
base::FilePath URLDownloader::OfflineDirectoryPath() {
- return base_directory_.Append(kOfflineDirectory);
+ return base_directory_.Append(FILE_PATH_LITERAL(kOfflineDirectory));
}
base::FilePath URLDownloader::OfflineURLDirectoryPath(const GURL& url) {
std::string hash = base::MD5String(url.spec());
- return OfflineDirectoryPath().Append(hash);
+ return OfflineDirectoryPath().AppendASCII(hash);
}
base::FilePath URLDownloader::OfflineURLPagePath(const GURL& url) {
- return OfflineURLDirectoryPath(url).Append("page.html");
+ return OfflineURLDirectoryPath(url).Append(FILE_PATH_LITERAL("page.html"));
}
bool URLDownloader::CreateOfflineURLDirectory(const GURL& url) {
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698