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

Side by Side Diff: webkit/fileapi/file_system_test_helper.h

Issue 9372044: Refactor FileSystemOperation to take callback for each method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reflected kinuko's comments + Fixture for failing-Write -> Cancel pattern. Created 8 years, 10 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 | « webkit/fileapi/file_system_quota_unittest.cc ('k') | webkit/fileapi/file_system_test_helper.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 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_TEST_HELPER_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_TEST_HELPER_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_TEST_HELPER_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_TEST_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
15 #include "webkit/fileapi/file_system_types.h" 15 #include "webkit/fileapi/file_system_types.h"
16 #include "webkit/fileapi/file_system_util.h" 16 #include "webkit/fileapi/file_system_util.h"
17 #include "webkit/quota/quota_types.h" 17 #include "webkit/quota/quota_types.h"
18 18
19 namespace quota { 19 namespace quota {
20 class QuotaManagerProxy; 20 class QuotaManagerProxy;
21 } 21 }
22 22
23 class FilePath; 23 class FilePath;
24 24
25 namespace fileapi { 25 namespace fileapi {
26 26
27 class FileSystemCallbackDispatcher;
28 class FileSystemContext; 27 class FileSystemContext;
29 class FileSystemFileUtil; 28 class FileSystemFileUtil;
30 class FileSystemOperation; 29 class FileSystemOperation;
31 class FileSystemOperationContext; 30 class FileSystemOperationContext;
32 31
33 // Filesystem test helper class that encapsulates test environment for 32 // Filesystem test helper class that encapsulates test environment for
34 // a given {origin, type} pair. 33 // a given {origin, type} pair.
35 class FileSystemTestOriginHelper { 34 class FileSystemTestOriginHelper {
36 public: 35 public:
37 FileSystemTestOriginHelper(const GURL& origin, FileSystemType type); 36 FileSystemTestOriginHelper(const GURL& origin, FileSystemType type);
(...skipping 18 matching lines...) Expand all
56 FilePath GetLocalPathFromASCII(const std::string& path); 55 FilePath GetLocalPathFromASCII(const std::string& path);
57 GURL GetURLForPath(const FilePath& path) const; 56 GURL GetURLForPath(const FilePath& path) const;
58 FilePath GetUsageCachePath() const; 57 FilePath GetUsageCachePath() const;
59 58
60 int64 GetCachedOriginUsage() const; 59 int64 GetCachedOriginUsage() const;
61 bool RevokeUsageCache() const; 60 bool RevokeUsageCache() const;
62 61
63 // This doesn't work with OFSFU. 62 // This doesn't work with OFSFU.
64 int64 ComputeCurrentOriginUsage() const; 63 int64 ComputeCurrentOriginUsage() const;
65 64
66 FileSystemOperation* NewOperation( 65 FileSystemOperation* NewOperation();
67 FileSystemCallbackDispatcher* callback_dispatcher);
68 FileSystemOperationContext* NewOperationContext(); 66 FileSystemOperationContext* NewOperationContext();
69 67
70 FileSystemContext* file_system_context() const { 68 FileSystemContext* file_system_context() const {
71 return file_system_context_.get(); 69 return file_system_context_.get();
72 } 70 }
73 71
74 const GURL& origin() const { return origin_; } 72 const GURL& origin() const { return origin_; }
75 FileSystemType type() const { return type_; } 73 FileSystemType type() const { return type_; }
76 quota::StorageType storage_type() const { 74 quota::StorageType storage_type() const {
77 return FileSystemTypeToQuotaStorageType(type_); 75 return FileSystemTypeToQuotaStorageType(type_);
78 } 76 }
79 FileSystemFileUtil* file_util() { return file_util_; } 77 FileSystemFileUtil* file_util() { return file_util_; }
80 78
81 private: 79 private:
82 void InitializeOperationContext(FileSystemOperationContext* context); 80 void InitializeOperationContext(FileSystemOperationContext* context);
83 81
84 scoped_refptr<FileSystemContext> file_system_context_; 82 scoped_refptr<FileSystemContext> file_system_context_;
85 const GURL origin_; 83 const GURL origin_;
86 const FileSystemType type_; 84 const FileSystemType type_;
87 FileSystemFileUtil* file_util_; 85 FileSystemFileUtil* file_util_;
88 int64 initial_usage_size_; 86 int64 initial_usage_size_;
89 }; 87 };
90 88
91 } // namespace fileapi 89 } // namespace fileapi
92 90
93 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_TEST_HELPER_H_ 91 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_quota_unittest.cc ('k') | webkit/fileapi/file_system_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698