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

Unified Diff: chrome/browser/sync_file_system/local/local_file_change_tracker.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: chrome/browser/sync_file_system/local/local_file_change_tracker.cc
diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
index 4cb560e45405fa23fb692295164898a926554fc4..fdec181a00dca5ca6a08c047f5738f19e5ea0d19 100644
--- a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
+++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
@@ -16,16 +16,16 @@
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
-#include "webkit/browser/fileapi/file_system_context.h"
-#include "webkit/browser/fileapi/file_system_file_util.h"
-#include "webkit/browser/fileapi/file_system_operation_context.h"
-#include "webkit/common/fileapi/file_system_util.h"
+#include "storage/browser/fileapi/file_system_context.h"
+#include "storage/browser/fileapi/file_system_file_util.h"
+#include "storage/browser/fileapi/file_system_operation_context.h"
+#include "storage/common/fileapi/file_system_util.h"
-using fileapi::FileSystemContext;
-using fileapi::FileSystemFileUtil;
-using fileapi::FileSystemOperationContext;
-using fileapi::FileSystemURL;
-using fileapi::FileSystemURLSet;
+using storage::FileSystemContext;
+using storage::FileSystemFileUtil;
+using storage::FileSystemOperationContext;
+using storage::FileSystemURL;
+using storage::FileSystemURLSet;
namespace sync_file_system {
@@ -172,14 +172,14 @@ void LocalFileChangeTracker::ClearChangesForURL(const FileSystemURL& url) {
}
void LocalFileChangeTracker::CreateFreshMirrorForURL(
- const fileapi::FileSystemURL& url) {
+ const storage::FileSystemURL& url) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
DCHECK(!ContainsKey(mirror_changes_, url));
mirror_changes_[url] = ChangeInfo();
}
void LocalFileChangeTracker::RemoveMirrorAndCommitChangesForURL(
- const fileapi::FileSystemURL& url) {
+ const storage::FileSystemURL& url) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
FileChangeMap::iterator found = mirror_changes_.find(url);
if (found == mirror_changes_.end())
@@ -194,7 +194,7 @@ void LocalFileChangeTracker::RemoveMirrorAndCommitChangesForURL(
}
void LocalFileChangeTracker::ResetToMirrorAndCommitChangesForURL(
- const fileapi::FileSystemURL& url) {
+ const storage::FileSystemURL& url) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
FileChangeMap::iterator found = mirror_changes_.find(url);
if (found == mirror_changes_.end() || found->second.change_list.empty()) {
@@ -214,7 +214,7 @@ void LocalFileChangeTracker::ResetToMirrorAndCommitChangesForURL(
}
void LocalFileChangeTracker::DemoteChangesForURL(
- const fileapi::FileSystemURL& url) {
+ const storage::FileSystemURL& url) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
FileChangeMap::iterator found = changes_.find(url);
@@ -228,7 +228,7 @@ void LocalFileChangeTracker::DemoteChangesForURL(
}
void LocalFileChangeTracker::PromoteDemotedChangesForURL(
- const fileapi::FileSystemURL& url) {
+ const storage::FileSystemURL& url) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
FileChangeMap::iterator iter = demoted_changes_.find(url);
@@ -251,7 +251,7 @@ bool LocalFileChangeTracker::PromoteDemotedChanges() {
if (demoted_changes_.empty())
return false;
while (!demoted_changes_.empty()) {
- fileapi::FileSystemURL url = demoted_changes_.begin()->first;
+ storage::FileSystemURL url = demoted_changes_.begin()->first;
PromoteDemotedChangesForURL(url);
}
UpdateNumChanges();
@@ -270,14 +270,13 @@ SyncStatusCode LocalFileChangeTracker::Initialize(
return status;
}
-void LocalFileChangeTracker::ResetForFileSystem(
- const GURL& origin,
- fileapi::FileSystemType type) {
+void LocalFileChangeTracker::ResetForFileSystem(const GURL& origin,
+ storage::FileSystemType type) {
DCHECK(file_task_runner_->RunsTasksOnCurrentThread());
scoped_ptr<leveldb::WriteBatch> batch(new leveldb::WriteBatch);
for (FileChangeMap::iterator iter = changes_.begin();
iter != changes_.end();) {
- fileapi::FileSystemURL url = iter->first;
+ storage::FileSystemURL url = iter->first;
int change_seq = iter->second.change_seq;
// Advance |iter| before calling ResetForURL to avoid the iterator
// invalidation in it.
@@ -288,7 +287,7 @@ void LocalFileChangeTracker::ResetForFileSystem(
for (FileChangeMap::iterator iter = demoted_changes_.begin();
iter != demoted_changes_.end();) {
- fileapi::FileSystemURL url = iter->first;
+ storage::FileSystemURL url = iter->first;
int change_seq = iter->second.change_seq;
// Advance |iter| before calling ResetForURL to avoid the iterator
// invalidation in it.
@@ -364,7 +363,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges(
while (!dirty_files.empty()) {
const FileSystemURL url = dirty_files.front();
dirty_files.pop();
- DCHECK_EQ(url.type(), fileapi::kFileSystemTypeSyncable);
+ DCHECK_EQ(url.type(), storage::kFileSystemTypeSyncable);
switch (file_util->GetFileInfo(context.get(), url,
&file_info, &platform_path)) {
@@ -445,7 +444,7 @@ void LocalFileChangeTracker::RecordChangeToChangeMaps(
(*change_seqs)[info.change_seq] = url;
}
-void LocalFileChangeTracker::ResetForURL(const fileapi::FileSystemURL& url,
+void LocalFileChangeTracker::ResetForURL(const storage::FileSystemURL& url,
int change_seq,
leveldb::WriteBatch* batch) {
mirror_changes_.erase(url);
@@ -474,8 +473,8 @@ SyncStatusCode LocalFileChangeTracker::TrackerDB::Init(
if (db_.get() && db_status_ == SYNC_STATUS_OK)
return SYNC_STATUS_OK;
- std::string path = fileapi::FilePathToString(
- base_path_.Append(kDatabaseName));
+ std::string path =
+ storage::FilePathToString(base_path_.Append(kDatabaseName));
leveldb::Options options;
options.max_open_files = 0; // Use minimum.
options.create_if_missing = true;

Powered by Google App Engine
This is Rietveld 408576698