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

Unified Diff: storage/browser/fileapi/recursive_operation_delegate.cc

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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: storage/browser/fileapi/recursive_operation_delegate.cc
diff --git a/webkit/browser/fileapi/recursive_operation_delegate.cc b/storage/browser/fileapi/recursive_operation_delegate.cc
similarity index 81%
rename from webkit/browser/fileapi/recursive_operation_delegate.cc
rename to storage/browser/fileapi/recursive_operation_delegate.cc
index d1d85e0d85a6526a9ef873fb7b266f9d512eb143..1f38abb2d9ff4625244c543460bbb35af018c7df 100644
--- a/webkit/browser/fileapi/recursive_operation_delegate.cc
+++ b/storage/browser/fileapi/recursive_operation_delegate.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/browser/fileapi/recursive_operation_delegate.h"
+#include "storage/browser/fileapi/recursive_operation_delegate.h"
#include "base/bind.h"
-#include "webkit/browser/fileapi/file_system_context.h"
-#include "webkit/browser/fileapi/file_system_operation_runner.h"
+#include "storage/browser/fileapi/file_system_context.h"
+#include "storage/browser/fileapi/file_system_operation_runner.h"
-namespace fileapi {
+namespace storage {
namespace {
// Don't start too many inflight operations.
@@ -41,8 +41,8 @@ void RecursiveOperationDelegate::StartRecursiveOperation(
++inflight_operations_;
ProcessFile(
root,
- base::Bind(&RecursiveOperationDelegate::DidTryProcessFile,
- AsWeakPtr(), root));
+ base::Bind(
+ &RecursiveOperationDelegate::DidTryProcessFile, AsWeakPtr(), root));
}
FileSystemOperationRunner* RecursiveOperationDelegate::operation_runner() {
@@ -52,9 +52,8 @@ FileSystemOperationRunner* RecursiveOperationDelegate::operation_runner() {
void RecursiveOperationDelegate::OnCancel() {
}
-void RecursiveOperationDelegate::DidTryProcessFile(
- const FileSystemURL& root,
- base::File::Error error) {
+void RecursiveOperationDelegate::DidTryProcessFile(const FileSystemURL& root,
+ base::File::Error error) {
DCHECK(pending_directory_stack_.empty());
DCHECK(pending_files_.empty());
DCHECK_EQ(1, inflight_operations_);
@@ -79,14 +78,12 @@ void RecursiveOperationDelegate::ProcessNextDirectory() {
const FileSystemURL& url = pending_directory_stack_.top().front();
++inflight_operations_;
- ProcessDirectory(
- url,
- base::Bind(
- &RecursiveOperationDelegate::DidProcessDirectory, AsWeakPtr()));
+ ProcessDirectory(url,
+ base::Bind(&RecursiveOperationDelegate::DidProcessDirectory,
+ AsWeakPtr()));
}
-void RecursiveOperationDelegate::DidProcessDirectory(
- base::File::Error error) {
+void RecursiveOperationDelegate::DidProcessDirectory(base::File::Error error) {
DCHECK(pending_files_.empty());
DCHECK(!pending_directory_stack_.empty());
DCHECK(!pending_directory_stack_.top().empty());
@@ -102,15 +99,14 @@ void RecursiveOperationDelegate::DidProcessDirectory(
pending_directory_stack_.push(std::queue<FileSystemURL>());
operation_runner()->ReadDirectory(
parent,
- base::Bind(&RecursiveOperationDelegate::DidReadDirectory,
- AsWeakPtr(), parent));
+ base::Bind(
+ &RecursiveOperationDelegate::DidReadDirectory, AsWeakPtr(), parent));
}
-void RecursiveOperationDelegate::DidReadDirectory(
- const FileSystemURL& parent,
- base::File::Error error,
- const FileEntryList& entries,
- bool has_more) {
+void RecursiveOperationDelegate::DidReadDirectory(const FileSystemURL& parent,
+ base::File::Error error,
+ const FileEntryList& entries,
+ bool has_more) {
DCHECK(!pending_directory_stack_.empty());
DCHECK_EQ(0, inflight_operations_);
@@ -158,15 +154,15 @@ void RecursiveOperationDelegate::ProcessPendingFiles() {
current_message_loop->PostTask(
FROM_HERE,
base::Bind(&RecursiveOperationDelegate::ProcessFile,
- AsWeakPtr(), pending_files_.front(),
+ AsWeakPtr(),
+ pending_files_.front(),
base::Bind(&RecursiveOperationDelegate::DidProcessFile,
AsWeakPtr())));
pending_files_.pop();
}
}
-void RecursiveOperationDelegate::DidProcessFile(
- base::File::Error error) {
+void RecursiveOperationDelegate::DidProcessFile(base::File::Error error) {
--inflight_operations_;
if (error != base::File::FILE_OK) {
// If an error occurs, invoke Done immediately (even if there remain
@@ -236,4 +232,4 @@ void RecursiveOperationDelegate::Done(base::File::Error error) {
}
}
-} // namespace fileapi
+} // namespace storage
« no previous file with comments | « storage/browser/fileapi/recursive_operation_delegate.h ('k') | storage/browser/fileapi/remove_operation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698