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

Unified Diff: net/disk_cache/blockfile/file_posix.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/disk_cache/blockfile/file_posix.cc
diff --git a/net/disk_cache/blockfile/file_posix.cc b/net/disk_cache/blockfile/file_posix.cc
index c451aa3b9f11b4da6f15357ddb0075cbfa385b95..a003fab6bdbd7579153c3b15c05a01188075edc7 100644
--- a/net/disk_cache/blockfile/file_posix.cc
+++ b/net/disk_cache/blockfile/file_posix.cc
@@ -35,17 +35,15 @@ base::LazyInstance<FileWorkerPool>::Leaky s_worker_pool =
namespace disk_cache {
File::File(base::File file)
- : init_(true),
- mixed_(true),
- base_file_(file.Pass()) {
+ : init_(true), mixed_(true), base_file_(file.Pass()) {
}
bool File::Init(const base::FilePath& name) {
if (base_file_.IsValid())
return false;
- int flags = base::File::FLAG_OPEN | base::File::FLAG_READ |
- base::File::FLAG_WRITE;
+ int flags =
+ base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE;
base_file_.Initialize(name, flags);
return base_file_.IsValid();
}
@@ -72,13 +70,16 @@ bool File::Write(const void* buffer, size_t buffer_len, size_t offset) {
return false;
}
- int ret = base_file_.Write(offset, static_cast<const char*>(buffer),
- buffer_len);
+ int ret =
+ base_file_.Write(offset, static_cast<const char*>(buffer), buffer_len);
return (static_cast<size_t>(ret) == buffer_len);
}
-bool File::Read(void* buffer, size_t buffer_len, size_t offset,
- FileIOCallback* callback, bool* completed) {
+bool File::Read(void* buffer,
+ size_t buffer_len,
+ size_t offset,
+ FileIOCallback* callback,
+ bool* completed) {
DCHECK(base_file_.IsValid());
if (!callback) {
if (completed)
@@ -92,7 +93,8 @@ bool File::Read(void* buffer, size_t buffer_len, size_t offset,
}
base::PostTaskAndReplyWithResult(
- s_worker_pool.Pointer(), FROM_HERE,
+ s_worker_pool.Pointer(),
+ FROM_HERE,
base::Bind(&File::DoRead, this, buffer, buffer_len, offset),
base::Bind(&File::OnOperationComplete, this, callback));
@@ -100,8 +102,11 @@ bool File::Read(void* buffer, size_t buffer_len, size_t offset,
return true;
}
-bool File::Write(const void* buffer, size_t buffer_len, size_t offset,
- FileIOCallback* callback, bool* completed) {
+bool File::Write(const void* buffer,
+ size_t buffer_len,
+ size_t offset,
+ FileIOCallback* callback,
+ bool* completed) {
DCHECK(base_file_.IsValid());
if (!callback) {
if (completed)
@@ -115,7 +120,8 @@ bool File::Write(const void* buffer, size_t buffer_len, size_t offset,
}
base::PostTaskAndReplyWithResult(
- s_worker_pool.Pointer(), FROM_HERE,
+ s_worker_pool.Pointer(),
+ FROM_HERE,
base::Bind(&File::DoWrite, this, buffer, buffer_len, offset),
base::Bind(&File::OnOperationComplete, this, callback));
@@ -154,7 +160,6 @@ void File::WaitForPendingIO(int* num_pending_io) {
void File::DropPendingIO() {
}
-
File::~File() {
}

Powered by Google App Engine
This is Rietveld 408576698