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

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

Issue 185393012: Change media galleries to external file system type to add toURL support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac/Win compile 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 <string>
9
10 #include "base/callback.h"
11 #include "base/files/file.h"
Lei Zhang 2014/03/20 00:46:26 base/files/file_path.h
vandebo (ex-Chrome) 2014/03/20 18:08:53 Done.
8 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
10 #include "webkit/browser/fileapi/file_system_backend.h" 15 #include "webkit/browser/fileapi/file_system_backend.h"
11 16
12 namespace base { 17 namespace base {
13 class SequencedTaskRunner; 18 class SequencedTaskRunner;
14 } 19 }
15 20
21 namespace fileapi {
22 class FileSystemURL;
23 }
24
16 namespace net { 25 namespace net {
17 class URLRequest; 26 class URLRequest;
18 } 27 }
19 28
20 class MediaPathFilter; 29 class MediaPathFilter;
21 30 class Profile;
Lei Zhang 2014/03/20 00:46:26 not needed?
vandebo (ex-Chrome) 2014/03/20 18:08:53 Done.
22 class DeviceMediaAsyncFileUtil; 31 class DeviceMediaAsyncFileUtil;
23 32
24 class MediaFileSystemBackend : public fileapi::FileSystemBackend { 33 class MediaFileSystemBackend : public fileapi::FileSystemBackend {
25 public: 34 public:
26 static const char kMediaTaskRunnerName[]; 35 static const char kMediaTaskRunnerName[];
27 36
28 MediaFileSystemBackend( 37 MediaFileSystemBackend(
29 const base::FilePath& profile_path, 38 const base::FilePath& profile_path,
30 base::SequencedTaskRunner* media_task_runner); 39 base::SequencedTaskRunner* media_task_runner);
31 virtual ~MediaFileSystemBackend(); 40 virtual ~MediaFileSystemBackend();
32 41
33 static bool CurrentlyOnMediaTaskRunnerThread(); 42 static bool CurrentlyOnMediaTaskRunnerThread();
34 static scoped_refptr<base::SequencedTaskRunner> MediaTaskRunner(); 43 static scoped_refptr<base::SequencedTaskRunner> MediaTaskRunner();
35 44
45 static std::string ConstructMountName(const base::FilePath& profile_path,
Lei Zhang 2014/03/20 00:46:26 Can you document the behavior w.r.t. |pref_id| ?
vandebo (ex-Chrome) 2014/03/20 18:08:53 Not sure what you mean specifically wrt to pref_id
Lei Zhang 2014/03/20 21:37:53 The special case of pref_id = kInvalidMediaGallery
46 const std::string& extension_id,
47 MediaGalleryPrefId pref_id);
48
36 static bool AttemptAutoMountForURLRequest( 49 static bool AttemptAutoMountForURLRequest(
37 const net::URLRequest* url_request, 50 const net::URLRequest* url_request,
38 const fileapi::FileSystemURL& filesystem_url, 51 const fileapi::FileSystemURL& filesystem_url,
39 const std::string& storage_domain, 52 const std::string& storage_domain,
40 const base::Callback<void(base::File::Error result)>& callback); 53 const base::Callback<void(base::File::Error result)>& callback);
41 54
42 // FileSystemBackend implementation. 55 // FileSystemBackend implementation.
43 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; 56 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE;
44 virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; 57 virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE;
45 virtual void ResolveURL(const fileapi::FileSystemURL& url, 58 virtual void ResolveURL(const fileapi::FileSystemURL& url,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_; 98 scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_;
86 #endif // defined(OS_WIN) || defined(OS_MACOSX) 99 #endif // defined(OS_WIN) || defined(OS_MACOSX)
87 #if defined(OS_MACOSX) 100 #if defined(OS_MACOSX)
88 scoped_ptr<fileapi::AsyncFileUtil> iphoto_file_util_; 101 scoped_ptr<fileapi::AsyncFileUtil> iphoto_file_util_;
89 #endif // defined(OS_MACOSX) 102 #endif // defined(OS_MACOSX)
90 103
91 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend); 104 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend);
92 }; 105 };
93 106
94 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_ 107 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698