Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/browser/media_galleries/fileapi/media_file_system_backend.h

Issue 195923002: Add mechanism to auto mount file systems in response to a URL request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CrOS Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "webkit/browser/fileapi/file_system_backend.h" 10 #include "webkit/browser/fileapi/file_system_backend.h"
11 11
12 namespace base { 12 namespace base {
13 class SequencedTaskRunner; 13 class SequencedTaskRunner;
14 } 14 }
15 15
16 namespace net {
17 class URLRequest;
18 }
19
16 class MediaPathFilter; 20 class MediaPathFilter;
17 21
18 class DeviceMediaAsyncFileUtil; 22 class DeviceMediaAsyncFileUtil;
19 23
20 class MediaFileSystemBackend : public fileapi::FileSystemBackend { 24 class MediaFileSystemBackend : public fileapi::FileSystemBackend {
21 public: 25 public:
22 static const char kMediaTaskRunnerName[]; 26 static const char kMediaTaskRunnerName[];
23 27
24 MediaFileSystemBackend( 28 MediaFileSystemBackend(
25 const base::FilePath& profile_path, 29 const base::FilePath& profile_path,
26 base::SequencedTaskRunner* media_task_runner); 30 base::SequencedTaskRunner* media_task_runner);
27 virtual ~MediaFileSystemBackend(); 31 virtual ~MediaFileSystemBackend();
28 32
29 static bool CurrentlyOnMediaTaskRunnerThread(); 33 static bool CurrentlyOnMediaTaskRunnerThread();
30 static scoped_refptr<base::SequencedTaskRunner> MediaTaskRunner(); 34 static scoped_refptr<base::SequencedTaskRunner> MediaTaskRunner();
31 35
36 static bool AttemptAutoMountForURLRequest(
37 const net::URLRequest* url_request,
38 const fileapi::FileSystemURL& filesystem_url,
39 const std::string& storage_domain,
40 const base::Callback<void(base::File::Error result)>& callback);
41
32 // FileSystemBackend implementation. 42 // FileSystemBackend implementation.
33 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; 43 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE;
34 virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; 44 virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE;
35 virtual void ResolveURL(const fileapi::FileSystemURL& url, 45 virtual void ResolveURL(const fileapi::FileSystemURL& url,
36 fileapi::OpenFileSystemMode mode, 46 fileapi::OpenFileSystemMode mode,
37 const OpenFileSystemCallback& callback) OVERRIDE; 47 const OpenFileSystemCallback& callback) OVERRIDE;
38 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( 48 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil(
39 fileapi::FileSystemType type) OVERRIDE; 49 fileapi::FileSystemType type) OVERRIDE;
40 virtual fileapi::CopyOrMoveFileValidatorFactory* 50 virtual fileapi::CopyOrMoveFileValidatorFactory*
41 GetCopyOrMoveFileValidatorFactory( 51 GetCopyOrMoveFileValidatorFactory(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_; 85 scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_;
76 #endif // defined(OS_WIN) || defined(OS_MACOSX) 86 #endif // defined(OS_WIN) || defined(OS_MACOSX)
77 #if defined(OS_MACOSX) 87 #if defined(OS_MACOSX)
78 scoped_ptr<fileapi::AsyncFileUtil> iphoto_file_util_; 88 scoped_ptr<fileapi::AsyncFileUtil> iphoto_file_util_;
79 #endif // defined(OS_MACOSX) 89 #endif // defined(OS_MACOSX)
80 90
81 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend); 91 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend);
82 }; 92 };
83 93
84 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ 94 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698