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

Unified Diff: services/url_response_disk_cache/url_response_disk_cache_impl.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « services/python/content_handler/content_handler_main.cc ('k') | shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/url_response_disk_cache/url_response_disk_cache_impl.cc
diff --git a/services/url_response_disk_cache/url_response_disk_cache_impl.cc b/services/url_response_disk_cache/url_response_disk_cache_impl.cc
index 7cbca7c2dc1954a8ec7301b714e3428012cfb726..318a4693911d52f94c7049060e368ede596eacb6 100644
--- a/services/url_response_disk_cache/url_response_disk_cache_impl.cc
+++ b/services/url_response_disk_cache/url_response_disk_cache_impl.cc
@@ -237,7 +237,8 @@ std::vector<std::string> GetHeaderValues(const std::string& header_name,
// Returns whether the given |entry| is valid.
bool IsCacheEntryValid(const CacheEntryPtr& entry) {
- return entry && PathExists(base::FilePath(entry->response_body_path));
+ return entry &&
+ PathExists(base::FilePath::FromUTF8Unsafe(entry->response_body_path));
}
// Returns whether the given directory |entry| is valid and its content can be
@@ -285,7 +286,8 @@ void PruneCache(scoped_refptr<URLResponseDiskCacheDB> db,
iterator->GetNext(&key, &entry);
if (last_key && last_key->request_origin == key->request_origin &&
last_key->url == key->url) {
- base::FilePath entry_directory = base::FilePath(entry->entry_directory);
+ base::FilePath entry_directory =
+ base::FilePath::FromUTF8Unsafe(entry->entry_directory);
if (base::DeleteFile(entry_directory, true))
db->Delete(key.Clone());
}
@@ -390,10 +392,11 @@ void URLResponseDiskCacheImpl::Get(const String& url,
callback.Run(URLResponsePtr(), nullptr, nullptr);
return;
}
- callback.Run(entry->response.Pass(),
- PathToArray(base::FilePath(entry->response_body_path)),
- PathToArray(GetConsumerCacheDirectory(
- base::FilePath(entry->entry_directory))));
+ callback.Run(
+ entry->response.Pass(),
+ PathToArray(base::FilePath::FromUTF8Unsafe(entry->response_body_path)),
+ PathToArray(GetConsumerCacheDirectory(
+ base::FilePath::FromUTF8Unsafe(entry->entry_directory))));
UpdateLastInvalidation(db_, key.Pass(), base::Time::Now());
}
@@ -441,9 +444,9 @@ void URLResponseDiskCacheImpl::UpdateAndGetInternal(
CacheKeyPtr key;
CacheEntryPtr entry = db_->GetNewest(request_origin_, url, &key);
if (IsCacheEntryFresh(response, entry)) {
- callback.Run(
- base::FilePath(entry->response_body_path),
- GetConsumerCacheDirectory(base::FilePath(entry->entry_directory)));
+ callback.Run(base::FilePath::FromUTF8Unsafe(entry->response_body_path),
+ GetConsumerCacheDirectory(
+ base::FilePath::FromUTF8Unsafe(entry->entry_directory)));
UpdateLastInvalidation(db_, key.Pass(), base::Time::Max());
return;
}
« no previous file with comments | « services/python/content_handler/content_handler_main.cc ('k') | shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698