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

Side by Side Diff: storage/browser/fileapi/transient_file_util.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « storage/browser/fileapi/transient_file_util.h ('k') | storage/browser/quota/OWNERS » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/fileapi/transient_file_util.h" 5 #include "storage/browser/fileapi/transient_file_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "webkit/browser/fileapi/file_system_operation_context.h" 11 #include "storage/browser/fileapi/file_system_operation_context.h"
12 #include "webkit/browser/fileapi/file_system_url.h" 12 #include "storage/browser/fileapi/file_system_url.h"
13 #include "webkit/browser/fileapi/isolated_context.h" 13 #include "storage/browser/fileapi/isolated_context.h"
14 14
15 using webkit_blob::ScopedFile; 15 using storage::ScopedFile;
16 16
17 namespace fileapi { 17 namespace storage {
18 18
19 namespace { 19 namespace {
20 20
21 void RevokeFileSystem(const std::string& filesystem_id, 21 void RevokeFileSystem(const std::string& filesystem_id,
22 const base::FilePath& /*path*/) { 22 const base::FilePath& /*path*/) {
23 IsolatedContext::GetInstance()->RevokeFileSystem(filesystem_id); 23 IsolatedContext::GetInstance()->RevokeFileSystem(filesystem_id);
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 27
28 ScopedFile TransientFileUtil::CreateSnapshotFile( 28 ScopedFile TransientFileUtil::CreateSnapshotFile(
29 FileSystemOperationContext* context, 29 FileSystemOperationContext* context,
30 const FileSystemURL& url, 30 const FileSystemURL& url,
31 base::File::Error* error, 31 base::File::Error* error,
32 base::File::Info* file_info, 32 base::File::Info* file_info,
33 base::FilePath* platform_path) { 33 base::FilePath* platform_path) {
34 DCHECK(file_info); 34 DCHECK(file_info);
35 *error = GetFileInfo(context, url, file_info, platform_path); 35 *error = GetFileInfo(context, url, file_info, platform_path);
36 if (*error == base::File::FILE_OK && file_info->is_directory) 36 if (*error == base::File::FILE_OK && file_info->is_directory)
37 *error = base::File::FILE_ERROR_NOT_A_FILE; 37 *error = base::File::FILE_ERROR_NOT_A_FILE;
38 if (*error != base::File::FILE_OK) 38 if (*error != base::File::FILE_OK)
39 return ScopedFile(); 39 return ScopedFile();
40 40
41 // Sets-up a transient filesystem. 41 // Sets-up a transient filesystem.
42 DCHECK(!platform_path->empty()); 42 DCHECK(!platform_path->empty());
43 DCHECK(!url.filesystem_id().empty()); 43 DCHECK(!url.filesystem_id().empty());
44 44
45 ScopedFile scoped_file( 45 ScopedFile scoped_file(
46 *platform_path, 46 *platform_path, ScopedFile::DELETE_ON_SCOPE_OUT, context->task_runner());
47 ScopedFile::DELETE_ON_SCOPE_OUT,
48 context->task_runner());
49 scoped_file.AddScopeOutCallback( 47 scoped_file.AddScopeOutCallback(
50 base::Bind(&RevokeFileSystem, url.filesystem_id()), NULL); 48 base::Bind(&RevokeFileSystem, url.filesystem_id()), NULL);
51 49
52 return scoped_file.Pass(); 50 return scoped_file.Pass();
53 } 51 }
54 52
55 } // namespace fileapi 53 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/fileapi/transient_file_util.h ('k') | storage/browser/quota/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698