native_media_file_util.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_
6c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
9868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "base/memory/weak_ptr.h"
10868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "webkit/browser/fileapi/async_file_util.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
12c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)namespace chrome {
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// This class handles native file system operations with media type filtering.
15868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// To support virtual file systems it implements the AsyncFileUtil interface
16868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// from scratch and provides synchronous override points.
17868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class NativeMediaFileUtil : public fileapi::AsyncFileUtil {
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NativeMediaFileUtil();
20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual ~NativeMediaFileUtil();
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Uses the MIME sniffer code, which actually looks into the file,
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // to determine if it is really a media file (to avoid exposing
24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // non-media files with a media file extension.)
25868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  static base::PlatformFileError IsMediaFile(const base::FilePath& path);
26868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // AsyncFileUtil overrides.
28868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool CreateOrOpen(
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
30c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& url,
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      int file_flags,
32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const CreateOrOpenCallback& callback) OVERRIDE;
33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool EnsureFileExists(
34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
36868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const EnsureFileExistsCallback& callback) OVERRIDE;
37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool CreateDirectory(
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
39868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
40868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool exclusive,
41868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool recursive,
42868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
43868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool GetFileInfo(
44868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
45868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
46868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const GetFileInfoCallback& callback) OVERRIDE;
47868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool ReadDirectory(
48868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
49868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
50868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const ReadDirectoryCallback& callback) OVERRIDE;
51868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool Touch(
52868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
53868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
54868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const base::Time& last_access_time,
55868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const base::Time& last_modified_time,
56868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
57868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool Truncate(
58868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
59868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
60868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      int64 length,
61868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
62868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool CopyFileLocal(
63868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
64868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& src_url,
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& dest_url,
66868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
67868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool MoveFileLocal(
68868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
69868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& src_url,
70868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& dest_url,
71868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
72868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool CopyInForeignFile(
73868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
74868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const base::FilePath& src_file_path,
75868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& dest_url,
76868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
77868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool DeleteFile(
78868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
79868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
80868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
81868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool DeleteDirectory(
82868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
83868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
84868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback) OVERRIDE;
85eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  virtual bool DeleteRecursively(
86eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
87eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      const fileapi::FileSystemURL& url,
88eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      const StatusCallback& callback) OVERRIDE;
89868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual bool CreateSnapshotFile(
90868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_ptr<fileapi::FileSystemOperationContext> context,
91868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
92868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const CreateSnapshotFileCallback& callback) OVERRIDE;
93868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
94868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) protected:
95868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void CreateDirectoryOnTaskRunnerThread(
96eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
97868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
98868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool exclusive,
99868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool recursive,
100868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback);
101868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void GetFileInfoOnTaskRunnerThread(
102eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
103868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
104868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const GetFileInfoCallback& callback);
105868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void ReadDirectoryOnTaskRunnerThread(
106eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
107c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& url,
108868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const ReadDirectoryCallback& callback);
109868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void CopyOrMoveFileLocalOnTaskRunnerThread(
110eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
111868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& src_url,
112868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& dest_url,
113868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool copy,
114868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback);
115868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void CopyInForeignFileOnTaskRunnerThread(
116eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
117868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const base::FilePath& src_file_path,
118868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& dest_url,
119868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback);
120868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void DeleteDirectoryOnTaskRunnerThread(
121eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
122868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
123868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const StatusCallback& callback);
124868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void CreateSnapshotFileOnTaskRunnerThread(
125eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      scoped_ptr<fileapi::FileSystemOperationContext> context,
126868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
127868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const CreateSnapshotFileCallback& callback);
128868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
129868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // The following methods should only be called on the task runner thread.
130868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
131868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Necessary for copy/move to succeed.
132868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError CreateDirectorySync(
133c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
134c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& url,
135868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool exclusive,
136868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool recursive);
137868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError CopyOrMoveFileSync(
138c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
139c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& src_url,
140c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& dest_url,
141868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      bool copy);
142868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError CopyInForeignFileSync(
143c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
144868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const base::FilePath& src_file_path,
145868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& dest_url);
146868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError GetFileInfoSync(
147c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
148c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& url,
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      base::PlatformFileInfo* file_info,
150868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      base::FilePath* platform_path);
151868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Called by GetFileInfoSync. Meant to be overridden by subclasses that
152868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // have special mappings from URLs to platform paths (virtual filesystems).
153868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError GetLocalFilePath(
154868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      fileapi::FileSystemOperationContext* context,
155868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& file_system_url,
156868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      base::FilePath* local_file_path);
157868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError ReadDirectorySync(
158868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      fileapi::FileSystemOperationContext* context,
159868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url,
160868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      EntryList* file_list);
161868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Necessary for move to succeed.
162868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError DeleteDirectorySync(
163868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      fileapi::FileSystemOperationContext* context,
164868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const fileapi::FileSystemURL& url);
165868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual base::PlatformFileError CreateSnapshotFileSync(
166a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
167a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)      const fileapi::FileSystemURL& url,
168a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)      base::PlatformFileInfo* file_info,
169868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      base::FilePath* platform_path,
170868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      scoped_refptr<webkit_blob::ShareableFileReference>* file_ref);
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
1732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Like GetLocalFilePath(), but always take media_path_filter() into
1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // consideration. If the media_path_filter() check fails, return
1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist.
1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  base::PlatformFileError GetFilteredLocalFilePath(
177c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
178c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& file_system_url,
1792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      base::FilePath* local_file_path);
1802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Like GetLocalFilePath(), but if the file does not exist, then return
1822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // |failure_error|.
1832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // If |local_file_path| is a file, then take media_path_filter() into
1842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // consideration.
1852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // If the media_path_filter() check fails, return |failure_error|.
1862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // If |local_file_path| is a directory, return PLATFORM_FILE_OK.
1872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory(
188c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      fileapi::FileSystemOperationContext* context,
189c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      const fileapi::FileSystemURL& file_system_url,
1902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      base::PlatformFileError failure_error,
1912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      base::FilePath* local_file_path);
1922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
193868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
194868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  base::WeakPtrFactory<NativeMediaFileUtil> weak_factory_;
195868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil);
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
199c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)}  // namespace chrome
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
201c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#endif  // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_
202