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

Side by Side Diff: webkit/browser/database/database_tracker.cc

Issue 18383003: Move DeleteAfterReboot and Move to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/memory_watcher/memory_watcher.cc ('k') | webkit/browser/fileapi/native_file_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/browser/database/database_tracker.h" 5 #include "webkit/browser/database/database_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 file_util::CreateTemporaryDirInDir(db_dir_, 407 file_util::CreateTemporaryDirInDir(db_dir_,
408 kTemporaryDirectoryPrefix, 408 kTemporaryDirectoryPrefix,
409 &new_origin_dir); 409 &new_origin_dir);
410 base::FileEnumerator databases( 410 base::FileEnumerator databases(
411 origin_dir, 411 origin_dir,
412 false, 412 false,
413 base::FileEnumerator::FILES); 413 base::FileEnumerator::FILES);
414 for (base::FilePath database = databases.Next(); !database.empty(); 414 for (base::FilePath database = databases.Next(); !database.empty();
415 database = databases.Next()) { 415 database = databases.Next()) {
416 base::FilePath new_file = new_origin_dir.Append(database.BaseName()); 416 base::FilePath new_file = new_origin_dir.Append(database.BaseName());
417 file_util::Move(database, new_file); 417 base::Move(database, new_file);
418 } 418 }
419 base::Delete(origin_dir, true); 419 base::Delete(origin_dir, true);
420 base::Delete(new_origin_dir, true); // might fail on windows. 420 base::Delete(new_origin_dir, true); // might fail on windows.
421 421
422 databases_table_->DeleteOriginIdentifier(origin_identifier); 422 databases_table_->DeleteOriginIdentifier(origin_identifier);
423 423
424 if (quota_manager_proxy_.get() && deleted_size) { 424 if (quota_manager_proxy_.get() && deleted_size) {
425 quota_manager_proxy_->NotifyStorageModified( 425 quota_manager_proxy_->NotifyStorageModified(
426 quota::QuotaClient::kDatabase, 426 quota::QuotaClient::kDatabase,
427 webkit_database::GetOriginFromIdentifier(origin_identifier), 427 webkit_database::GetOriginFromIdentifier(origin_identifier),
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 if (!db_tracker_thread_->BelongsToCurrentThread()) { 865 if (!db_tracker_thread_->BelongsToCurrentThread()) {
866 db_tracker_thread_->PostTask( 866 db_tracker_thread_->PostTask(
867 FROM_HERE, 867 FROM_HERE,
868 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this)); 868 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this));
869 return; 869 return;
870 } 870 }
871 force_keep_session_state_ = true; 871 force_keep_session_state_ = true;
872 } 872 }
873 873
874 } // namespace webkit_database 874 } // namespace webkit_database
OLDNEW
« no previous file with comments | « tools/memory_watcher/memory_watcher.cc ('k') | webkit/browser/fileapi/native_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698