OLD | NEW |
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_OPERATION_CONTEXT_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "webkit/fileapi/fileapi_export.h" | 11 #include "webkit/fileapi/fileapi_export.h" |
12 #include "webkit/fileapi/file_system_context.h" | 12 #include "webkit/fileapi/file_system_context.h" |
13 #include "webkit/fileapi/file_system_file_util.h" | 13 #include "webkit/fileapi/file_system_file_util.h" |
14 #include "webkit/fileapi/file_system_types.h" | 14 #include "webkit/fileapi/file_system_types.h" |
| 15 #include "webkit/fileapi/media/media_file_system_config.h" |
| 16 |
| 17 #if defined(SUPPORT_MEDIA_FILESYSTEM) |
| 18 #include "webkit/fileapi/media/media_device_interface_impl.h" |
| 19 #endif |
15 | 20 |
16 namespace base { | 21 namespace base { |
17 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
18 } | 23 } |
19 | 24 |
20 namespace fileapi { | 25 namespace fileapi { |
21 | 26 |
22 class FILEAPI_EXPORT_PRIVATE FileSystemOperationContext { | 27 class FILEAPI_EXPORT_PRIVATE FileSystemOperationContext { |
23 public: | 28 public: |
24 explicit FileSystemOperationContext(FileSystemContext* context); | 29 explicit FileSystemOperationContext(FileSystemContext* context); |
25 ~FileSystemOperationContext(); | 30 ~FileSystemOperationContext(); |
26 | 31 |
27 FileSystemContext* file_system_context() const { | 32 FileSystemContext* file_system_context() const { |
28 return file_system_context_.get(); | 33 return file_system_context_.get(); |
29 } | 34 } |
30 | 35 |
31 void set_allowed_bytes_growth(const int64& allowed_bytes_growth) { | 36 void set_allowed_bytes_growth(const int64& allowed_bytes_growth) { |
32 allowed_bytes_growth_ = allowed_bytes_growth; | 37 allowed_bytes_growth_ = allowed_bytes_growth; |
33 } | 38 } |
34 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } | 39 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } |
35 | 40 |
| 41 #if defined(SUPPORT_MEDIA_FILESYSTEM) |
| 42 void set_media_device(MediaDeviceInterfaceImpl* media_device) { |
| 43 media_device_ = media_device; |
| 44 } |
| 45 |
| 46 MediaDeviceInterfaceImpl* media_device() const { |
| 47 return media_device_.get(); |
| 48 } |
| 49 #endif |
| 50 |
36 base::SequencedTaskRunner* file_task_runner() const; | 51 base::SequencedTaskRunner* file_task_runner() const; |
37 | 52 |
38 private: | 53 private: |
39 scoped_refptr<FileSystemContext> file_system_context_; | 54 scoped_refptr<FileSystemContext> file_system_context_; |
40 | 55 |
41 int64 allowed_bytes_growth_; | 56 int64 allowed_bytes_growth_; |
| 57 |
| 58 #if defined(SUPPORT_MEDIA_FILESYSTEM) |
| 59 // Store the current media device. |
| 60 scoped_refptr<MediaDeviceInterfaceImpl> media_device_; |
| 61 #endif |
42 }; | 62 }; |
43 | 63 |
44 } // namespace fileapi | 64 } // namespace fileapi |
45 | 65 |
46 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ | 66 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ |
OLD | NEW |