OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_UPDATE_OBSERVER_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_FILE_UPDATE_OBSERVER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace fileapi { |
| 11 |
| 12 class FileSystemURL; |
| 13 |
| 14 // An abstract interface to observe update operations. |
| 15 // |
| 16 // OnStartUpdate and OnEndUpdate are called once for each target url |
| 17 // before and after following operations regardless of whether the operation |
| 18 // is made recursively or not (i.e. StartUpdate() will be called only once |
| 19 // for destination url regardless of whether it is recursive copy or not): |
| 20 // CreateFile(), CreateDirectory(), |
| 21 // Copy() (destination only), |
| 22 // Move() (both for source and destination), |
| 23 // Remove(), Write(), Truncate(), TouchFile() |
| 24 // |
| 25 // OnUpdate() is called each time the |url| is updated but works only for |
| 26 // sandboxed files (where usage is tracked). |
| 27 class FileUpdateObserver { |
| 28 public: |
| 29 FileUpdateObserver() {} |
| 30 virtual ~FileUpdateObserver() {} |
| 31 |
| 32 virtual void OnStartUpdate(const FileSystemURL& url) = 0; |
| 33 virtual void OnUpdate(const FileSystemURL& url, int64 delta) = 0; |
| 34 virtual void OnEndUpdate(const FileSystemURL& url) = 0; |
| 35 |
| 36 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(FileUpdateObserver); |
| 38 }; |
| 39 |
| 40 } // namespace fileapi |
| 41 |
| 42 #endif // WEBKIT_BROWSER_FILEAPI_FILE_UPDATE_OBSERVER_H_ |
OLD | NEW |