OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ | 5 #ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ |
6 #define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ | 6 #define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 // Deletes thread-specific instance (if exists). For workers it deletes | 42 // Deletes thread-specific instance (if exists). For workers it deletes |
43 // itself in OnWorkerRunLoopStopped(), but for an instance created on the | 43 // itself in OnWorkerRunLoopStopped(), but for an instance created on the |
44 // main thread this method must be called. | 44 // main thread this method must be called. |
45 static void DeleteThreadSpecificInstance(); | 45 static void DeleteThreadSpecificInstance(); |
46 | 46 |
47 explicit WebFileSystemImpl(base::MessageLoopProxy* main_thread_loop); | 47 explicit WebFileSystemImpl(base::MessageLoopProxy* main_thread_loop); |
48 virtual ~WebFileSystemImpl(); | 48 virtual ~WebFileSystemImpl(); |
49 | 49 |
50 // WorkerTaskRunner::Observer implementation. | 50 // WorkerTaskRunner::Observer implementation. |
51 virtual void OnWorkerRunLoopStopped() OVERRIDE; | 51 virtual void OnWorkerRunLoopStopped() override; |
52 | 52 |
53 // WebFileSystem implementation. | 53 // WebFileSystem implementation. |
54 virtual void openFileSystem( | 54 virtual void openFileSystem( |
55 const blink::WebURL& storage_partition, | 55 const blink::WebURL& storage_partition, |
56 const blink::WebFileSystemType type, | 56 const blink::WebFileSystemType type, |
57 blink::WebFileSystemCallbacks); | 57 blink::WebFileSystemCallbacks); |
58 virtual void resolveURL( | 58 virtual void resolveURL( |
59 const blink::WebURL& filesystem_url, | 59 const blink::WebURL& filesystem_url, |
60 blink::WebFileSystemCallbacks) OVERRIDE; | 60 blink::WebFileSystemCallbacks) override; |
61 virtual void deleteFileSystem( | 61 virtual void deleteFileSystem( |
62 const blink::WebURL& storage_partition, | 62 const blink::WebURL& storage_partition, |
63 const blink::WebFileSystemType type, | 63 const blink::WebFileSystemType type, |
64 blink::WebFileSystemCallbacks); | 64 blink::WebFileSystemCallbacks); |
65 virtual void move( | 65 virtual void move( |
66 const blink::WebURL& src_path, | 66 const blink::WebURL& src_path, |
67 const blink::WebURL& dest_path, | 67 const blink::WebURL& dest_path, |
68 blink::WebFileSystemCallbacks) OVERRIDE; | 68 blink::WebFileSystemCallbacks) override; |
69 virtual void copy( | 69 virtual void copy( |
70 const blink::WebURL& src_path, | 70 const blink::WebURL& src_path, |
71 const blink::WebURL& dest_path, | 71 const blink::WebURL& dest_path, |
72 blink::WebFileSystemCallbacks) OVERRIDE; | 72 blink::WebFileSystemCallbacks) override; |
73 virtual void remove( | 73 virtual void remove( |
74 const blink::WebURL& path, | 74 const blink::WebURL& path, |
75 blink::WebFileSystemCallbacks) OVERRIDE; | 75 blink::WebFileSystemCallbacks) override; |
76 virtual void removeRecursively( | 76 virtual void removeRecursively( |
77 const blink::WebURL& path, | 77 const blink::WebURL& path, |
78 blink::WebFileSystemCallbacks) OVERRIDE; | 78 blink::WebFileSystemCallbacks) override; |
79 virtual void readMetadata( | 79 virtual void readMetadata( |
80 const blink::WebURL& path, | 80 const blink::WebURL& path, |
81 blink::WebFileSystemCallbacks) OVERRIDE; | 81 blink::WebFileSystemCallbacks) override; |
82 virtual void createFile( | 82 virtual void createFile( |
83 const blink::WebURL& path, | 83 const blink::WebURL& path, |
84 bool exclusive, | 84 bool exclusive, |
85 blink::WebFileSystemCallbacks) OVERRIDE; | 85 blink::WebFileSystemCallbacks) override; |
86 virtual void createDirectory( | 86 virtual void createDirectory( |
87 const blink::WebURL& path, | 87 const blink::WebURL& path, |
88 bool exclusive, | 88 bool exclusive, |
89 blink::WebFileSystemCallbacks) OVERRIDE; | 89 blink::WebFileSystemCallbacks) override; |
90 virtual void fileExists( | 90 virtual void fileExists( |
91 const blink::WebURL& path, | 91 const blink::WebURL& path, |
92 blink::WebFileSystemCallbacks) OVERRIDE; | 92 blink::WebFileSystemCallbacks) override; |
93 virtual void directoryExists( | 93 virtual void directoryExists( |
94 const blink::WebURL& path, | 94 const blink::WebURL& path, |
95 blink::WebFileSystemCallbacks) OVERRIDE; | 95 blink::WebFileSystemCallbacks) override; |
96 virtual int readDirectory( | 96 virtual int readDirectory( |
97 const blink::WebURL& path, | 97 const blink::WebURL& path, |
98 blink::WebFileSystemCallbacks) OVERRIDE; | 98 blink::WebFileSystemCallbacks) override; |
99 virtual void createFileWriter( | 99 virtual void createFileWriter( |
100 const blink::WebURL& path, | 100 const blink::WebURL& path, |
101 blink::WebFileWriterClient*, | 101 blink::WebFileWriterClient*, |
102 blink::WebFileSystemCallbacks) OVERRIDE; | 102 blink::WebFileSystemCallbacks) override; |
103 virtual void createSnapshotFileAndReadMetadata( | 103 virtual void createSnapshotFileAndReadMetadata( |
104 const blink::WebURL& path, | 104 const blink::WebURL& path, |
105 blink::WebFileSystemCallbacks); | 105 blink::WebFileSystemCallbacks); |
106 virtual bool waitForAdditionalResult(int callbacksId); | 106 virtual bool waitForAdditionalResult(int callbacksId); |
107 | 107 |
108 int RegisterCallbacks(const blink::WebFileSystemCallbacks& callbacks); | 108 int RegisterCallbacks(const blink::WebFileSystemCallbacks& callbacks); |
109 blink::WebFileSystemCallbacks GetCallbacks(int callbacks_id); | 109 blink::WebFileSystemCallbacks GetCallbacks(int callbacks_id); |
110 void UnregisterCallbacks(int callbacks_id); | 110 void UnregisterCallbacks(int callbacks_id); |
111 | 111 |
112 private: | 112 private: |
113 typedef std::map<int, blink::WebFileSystemCallbacks> CallbacksMap; | 113 typedef std::map<int, blink::WebFileSystemCallbacks> CallbacksMap; |
114 typedef std::map<int, scoped_refptr<WaitableCallbackResults> > | 114 typedef std::map<int, scoped_refptr<WaitableCallbackResults> > |
115 WaitableCallbackResultsMap; | 115 WaitableCallbackResultsMap; |
116 | 116 |
117 WaitableCallbackResults* MaybeCreateWaitableResults( | 117 WaitableCallbackResults* MaybeCreateWaitableResults( |
118 const blink::WebFileSystemCallbacks& callbacks, int callbacks_id); | 118 const blink::WebFileSystemCallbacks& callbacks, int callbacks_id); |
119 | 119 |
120 scoped_refptr<base::MessageLoopProxy> main_thread_loop_; | 120 scoped_refptr<base::MessageLoopProxy> main_thread_loop_; |
121 | 121 |
122 CallbacksMap callbacks_; | 122 CallbacksMap callbacks_; |
123 int next_callbacks_id_; | 123 int next_callbacks_id_; |
124 WaitableCallbackResultsMap waitable_results_; | 124 WaitableCallbackResultsMap waitable_results_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl); | 126 DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace content | 129 } // namespace content |
130 | 130 |
131 #endif // CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ | 131 #endif // CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ |
OLD | NEW |