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

Side by Side Diff: content/browser/storage_partition_impl_map.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 "content/browser/storage_partition_impl_map.h" 5 #include "content/browser/storage_partition_impl_map.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 // This function is still named BlockingGarbageCollect() because it does 283 // This function is still named BlockingGarbageCollect() because it does
284 // execute a few filesystem operations synchronously. 284 // execute a few filesystem operations synchronously.
285 void BlockingGarbageCollect( 285 void BlockingGarbageCollect(
286 const base::FilePath& storage_root, 286 const base::FilePath& storage_root,
287 const scoped_refptr<base::TaskRunner>& file_access_runner, 287 const scoped_refptr<base::TaskRunner>& file_access_runner,
288 scoped_ptr<base::hash_set<base::FilePath> > active_paths) { 288 scoped_ptr<base::hash_set<base::FilePath> > active_paths) {
289 CHECK(storage_root.IsAbsolute()); 289 CHECK(storage_root.IsAbsolute());
290 290
291 base::FileEnumerator enumerator(storage_root, false, kAllFileTypes); 291 base::FileEnumerator enumerator(storage_root, false, kAllFileTypes);
292 base::FilePath trash_directory; 292 base::FilePath trash_directory;
293 if (!file_util::CreateTemporaryDirInDir(storage_root, kTrashDirname, 293 if (!base::CreateTemporaryDirInDir(storage_root, kTrashDirname,
294 &trash_directory)) { 294 &trash_directory)) {
295 // Unable to continue without creating the trash directory so give up. 295 // Unable to continue without creating the trash directory so give up.
296 return; 296 return;
297 } 297 }
298 for (base::FilePath path = enumerator.Next(); !path.empty(); 298 for (base::FilePath path = enumerator.Next(); !path.empty();
299 path = enumerator.Next()) { 299 path = enumerator.Next()) {
300 if (active_paths->find(path) == active_paths->end() && 300 if (active_paths->find(path) == active_paths->end() &&
301 path != trash_directory) { 301 path != trash_directory) {
302 // Since |trash_directory| is unique for each run of this function there 302 // Since |trash_directory| is unique for each run of this function there
303 // can be no colllisions on the move. 303 // can be no colllisions on the move.
304 base::Move(path, trash_directory.Append(path.BaseName())); 304 base::Move(path, trash_directory.Append(path.BaseName()));
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 551
552 // We do not call InitializeURLRequestContext() for media contexts because, 552 // We do not call InitializeURLRequestContext() for media contexts because,
553 // other than the HTTP cache, the media contexts share the same backing 553 // other than the HTTP cache, the media contexts share the same backing
554 // objects as their associated "normal" request context. Thus, the previous 554 // objects as their associated "normal" request context. Thus, the previous
555 // call serves to initialize the media request context for this storage 555 // call serves to initialize the media request context for this storage
556 // partition as well. 556 // partition as well.
557 } 557 }
558 } 558 }
559 559
560 } // namespace content 560 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698