OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_USAGE_TRACKER_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_TRACKER_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_TRACKER_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_TRACKER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
17 #include "webkit/fileapi/file_system_types.h" | 17 #include "webkit/fileapi/file_system_types.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class MessageLoopProxy; | 22 class MessageLoopProxy; |
23 } | 23 } |
24 | 24 |
25 namespace fileapi { | 25 namespace fileapi { |
26 | 26 |
27 // Owned by the SandboxedFileSystemContext, which is a per-profile | 27 // Owned by the FileSystemContext, which is a per-profile instance, and has the |
28 // instance, and has the same lifetime as the SandboxedFileSystemContext. | 28 // same lifetime as the FileSystemContext. It's going to be created and |
29 // It's going to be created and destroyed on the IO thread in chrome. | 29 // destroyed on the IO thread in chrome. (The destruction on the same thread |
30 // (The destruction on the same thread where it is created was guaranteed | 30 // where it is created was guaranteed by its owner, FileSystemContext.) |
31 // by its owner, SandboxedFileSystemContext.) | |
32 class FileSystemUsageTracker { | 31 class FileSystemUsageTracker { |
33 public: | 32 public: |
34 FileSystemUsageTracker( | 33 FileSystemUsageTracker( |
35 scoped_refptr<base::MessageLoopProxy> file_message_loop, | 34 scoped_refptr<base::MessageLoopProxy> file_message_loop, |
36 const FilePath& profile_path, | 35 const FilePath& profile_path, |
37 bool is_incognito); | 36 bool is_incognito); |
38 ~FileSystemUsageTracker(); | 37 ~FileSystemUsageTracker(); |
39 | 38 |
40 // Get the amount of data stored in the filesystem specified by | 39 // Get the amount of data stored in the filesystem specified by |
41 // |origin_url| and |type|. | 40 // |origin_url| and |type|. |
(...skipping 20 matching lines...) Expand all Loading... |
62 typedef std::list<GetUsageCallback*> PendingCallbackList; | 61 typedef std::list<GetUsageCallback*> PendingCallbackList; |
63 typedef std::map<std::string, PendingCallbackList> PendingUsageCallbackMap; | 62 typedef std::map<std::string, PendingCallbackList> PendingUsageCallbackMap; |
64 PendingUsageCallbackMap pending_usage_callbacks_; | 63 PendingUsageCallbackMap pending_usage_callbacks_; |
65 | 64 |
66 DISALLOW_COPY_AND_ASSIGN(FileSystemUsageTracker); | 65 DISALLOW_COPY_AND_ASSIGN(FileSystemUsageTracker); |
67 }; | 66 }; |
68 | 67 |
69 } // namespace fileapi | 68 } // namespace fileapi |
70 | 69 |
71 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_TRACKER_H_ | 70 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_TRACKER_H_ |
OLD | NEW |