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

Unified Diff: net/disk_cache/simple/simple_synchronous_entry.cc

Issue 2867693004: Snapshot of all changes to get jumbo in blink and content.
Patch Set: Exclude certain files from jumbo because of a Windows problem Created 3 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 | « net/disk_cache/simple/simple_index_file.cc ('k') | net/dns/dns_query.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_synchronous_entry.cc
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index 5b86b77d6c50200f70868df7c0236c8f578bb852..90eb17c0f254ce7a9ef2ccc8ac5a03ac622cb405 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -31,7 +31,6 @@
#include "net/disk_cache/simple/simple_util.h"
#include "third_party/zlib/zlib.h"
-using base::File;
using base::FilePath;
using base::Time;
@@ -89,9 +88,9 @@ bool CanOmitEmptyFile(int file_index) {
}
bool TruncatePath(const FilePath& filename_to_truncate) {
- File file_to_truncate;
- int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE |
- File::FLAG_SHARE_DELETE;
+ base::File file_to_truncate;
+ int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE |
+ base::File::FLAG_SHARE_DELETE;
file_to_truncate.Initialize(filename_to_truncate, flags);
if (!file_to_truncate.IsValid())
return false;
@@ -396,7 +395,7 @@ void SimpleSynchronousEntry::WriteData(const EntryOperationData& in_entry_op,
*out_result = net::ERR_CACHE_WRITE_FAILURE;
return;
}
- File::Error error;
+ base::File::Error error;
if (!MaybeCreateFile(file_index, FILE_REQUIRED, &error)) {
RecordWriteResult(cache_type_, SYNC_WRITE_RESULT_LAZY_CREATE_FAILURE);
Doom();
@@ -840,17 +839,17 @@ SimpleSynchronousEntry::~SimpleSynchronousEntry() {
bool SimpleSynchronousEntry::MaybeOpenFile(
int file_index,
- File::Error* out_error) {
+ base::File::Error* out_error) {
DCHECK(out_error);
FilePath filename = GetFilenameFromFileIndex(file_index);
- int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE |
- File::FLAG_SHARE_DELETE;
+ int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE |
+ base::File::FLAG_SHARE_DELETE;
files_[file_index].Initialize(filename, flags);
*out_error = files_[file_index].error_details();
if (CanOmitEmptyFile(file_index) && !files_[file_index].IsValid() &&
- *out_error == File::FILE_ERROR_NOT_FOUND) {
+ *out_error == base::File::FILE_ERROR_NOT_FOUND) {
empty_file_omitted_[file_index] = true;
return true;
}
@@ -861,7 +860,7 @@ bool SimpleSynchronousEntry::MaybeOpenFile(
bool SimpleSynchronousEntry::MaybeCreateFile(
int file_index,
FileRequired file_required,
- File::Error* out_error) {
+ base::File::Error* out_error) {
DCHECK(out_error);
if (CanOmitEmptyFile(file_index) && file_required == FILE_NOT_REQUIRED) {
@@ -870,8 +869,8 @@ bool SimpleSynchronousEntry::MaybeCreateFile(
}
FilePath filename = GetFilenameFromFileIndex(file_index);
- int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE |
- File::FLAG_SHARE_DELETE;
+ int flags = base::File::FLAG_CREATE | base::File::FLAG_READ | base::File::FLAG_WRITE |
+ base::File::FLAG_SHARE_DELETE;
files_[file_index].Initialize(filename, flags);
// It's possible that the creation failed because someone deleted the
@@ -879,7 +878,7 @@ bool SimpleSynchronousEntry::MaybeCreateFile(
// If so, we would keep failing for a while until periodic index snapshot
// re-creates the cache dir, so try to recover from it quickly here.
if (!files_[file_index].IsValid() &&
- files_[file_index].error_details() == File::FILE_ERROR_NOT_FOUND &&
+ files_[file_index].error_details() == base::File::FILE_ERROR_NOT_FOUND &&
!base::DirectoryExists(path_)) {
if (base::CreateDirectory(path_))
files_[file_index].Initialize(filename, flags);
@@ -893,7 +892,7 @@ bool SimpleSynchronousEntry::MaybeCreateFile(
bool SimpleSynchronousEntry::OpenFiles(SimpleEntryStat* out_entry_stat) {
for (int i = 0; i < kSimpleEntryFileCount; ++i) {
- File::Error error;
+ base::File::Error error;
if (!MaybeOpenFile(i, &error)) {
// TODO(juliatuttle,gavinp): Remove one each of these triplets of
// histograms. We can calculate the third as the sum or difference of the
@@ -928,7 +927,7 @@ bool SimpleSynchronousEntry::OpenFiles(SimpleEntryStat* out_entry_stat) {
continue;
}
- File::Info file_info;
+ base::File::Info file_info;
bool success = files_[i].GetInfo(&file_info);
base::Time file_last_modified;
if (!success) {
@@ -974,7 +973,7 @@ bool SimpleSynchronousEntry::OpenFiles(SimpleEntryStat* out_entry_stat) {
bool SimpleSynchronousEntry::CreateFiles(SimpleEntryStat* out_entry_stat) {
for (int i = 0; i < kSimpleEntryFileCount; ++i) {
- File::Error error;
+ base::File::Error error;
if (!MaybeCreateFile(i, FILE_NOT_REQUIRED, &error)) {
// TODO(juliatuttle,gavinp): Remove one each of these triplets of
// histograms. We can calculate the third as the sum or difference of the
@@ -1449,13 +1448,13 @@ bool SimpleSynchronousEntry::OpenSparseFileIfExists(
FilePath filename = path_.AppendASCII(
GetSparseFilenameFromEntryHash(entry_hash_));
- int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE |
- File::FLAG_SHARE_DELETE;
+ int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE |
+ base::File::FLAG_SHARE_DELETE;
sparse_file_.Initialize(filename, flags);
if (sparse_file_.IsValid())
return ScanSparseFile(out_sparse_data_size);
- return sparse_file_.error_details() == File::FILE_ERROR_NOT_FOUND;
+ return sparse_file_.error_details() == base::File::FILE_ERROR_NOT_FOUND;
}
bool SimpleSynchronousEntry::CreateSparseFile() {
@@ -1463,8 +1462,8 @@ bool SimpleSynchronousEntry::CreateSparseFile() {
FilePath filename = path_.AppendASCII(
GetSparseFilenameFromEntryHash(entry_hash_));
- int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE |
- File::FLAG_SHARE_DELETE;
+ int flags = base::File::FLAG_CREATE | base::File::FLAG_READ | base::File::FLAG_WRITE |
+ base::File::FLAG_SHARE_DELETE;
sparse_file_.Initialize(filename, flags);
if (!sparse_file_.IsValid())
return false;
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/dns/dns_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698