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

Side by Side Diff: chrome/browser/media_galleries/linux/mtp_device_task_helper.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 2013 The Chromium Authors. All rights reserved. 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 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_LINUX_MTP_DEVICE_TASK_HELPER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" 14 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h"
15 #include "device/media_transfer_protocol/mtp_file_entry.pb.h" 15 #include "device/media_transfer_protocol/mtp_file_entry.pb.h"
16 #include "webkit/browser/fileapi/async_file_util.h" 16 #include "storage/browser/fileapi/async_file_util.h"
17 17
18 class MTPReadFileWorker; 18 class MTPReadFileWorker;
19 struct SnapshotRequestInfo; 19 struct SnapshotRequestInfo;
20 20
21 // MTPDeviceTaskHelper dispatches the media transfer protocol (MTP) device 21 // MTPDeviceTaskHelper dispatches the media transfer protocol (MTP) device
22 // operation requests (such as GetFileInfo, ReadDirectory, CreateSnapshotFile, 22 // operation requests (such as GetFileInfo, ReadDirectory, CreateSnapshotFile,
23 // OpenStorage and CloseStorage) to the MediaTransferProtocolManager. 23 // OpenStorage and CloseStorage) to the MediaTransferProtocolManager.
24 // MTPDeviceTaskHelper lives on the UI thread. MTPDeviceTaskHelperMapService 24 // MTPDeviceTaskHelper lives on the UI thread. MTPDeviceTaskHelperMapService
25 // owns the MTPDeviceTaskHelper objects. MTPDeviceTaskHelper is instantiated per 25 // owns the MTPDeviceTaskHelper objects. MTPDeviceTaskHelper is instantiated per
26 // MTP device storage. 26 // MTP device storage.
27 class MTPDeviceTaskHelper { 27 class MTPDeviceTaskHelper {
28 public: 28 public:
29 typedef base::Callback<void(bool succeeded)> OpenStorageCallback; 29 typedef base::Callback<void(bool succeeded)> OpenStorageCallback;
30 30
31 typedef MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback 31 typedef MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback
32 GetFileInfoSuccessCallback; 32 GetFileInfoSuccessCallback;
33 33
34 // NOTE: The file names in the entry list have their file id appended at the 34 // NOTE: The file names in the entry list have their file id appended at the
35 // end. e.g. foo.jpg with file id 45 becomes foo.jpg,45. 35 // end. e.g. foo.jpg with file id 45 becomes foo.jpg,45.
36 typedef base::Callback<void(const fileapi::AsyncFileUtil::EntryList& entries, 36 typedef base::Callback<void(const storage::AsyncFileUtil::EntryList& entries,
37 bool has_more)> ReadDirectorySuccessCallback; 37 bool has_more)> ReadDirectorySuccessCallback;
38 38
39 typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; 39 typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback;
40 40
41 MTPDeviceTaskHelper(); 41 MTPDeviceTaskHelper();
42 ~MTPDeviceTaskHelper(); 42 ~MTPDeviceTaskHelper();
43 43
44 // Dispatches the request to the MediaTransferProtocolManager to open the MTP 44 // Dispatches the request to the MediaTransferProtocolManager to open the MTP
45 // storage for communication. 45 // storage for communication.
46 // 46 //
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Used to handle WriteDataInfoSnapshotFile request. 172 // Used to handle WriteDataInfoSnapshotFile request.
173 scoped_ptr<MTPReadFileWorker> read_file_worker_; 173 scoped_ptr<MTPReadFileWorker> read_file_worker_;
174 174
175 // For callbacks that may run after destruction. 175 // For callbacks that may run after destruction.
176 base::WeakPtrFactory<MTPDeviceTaskHelper> weak_ptr_factory_; 176 base::WeakPtrFactory<MTPDeviceTaskHelper> weak_ptr_factory_;
177 177
178 DISALLOW_COPY_AND_ASSIGN(MTPDeviceTaskHelper); 178 DISALLOW_COPY_AND_ASSIGN(MTPDeviceTaskHelper);
179 }; 179 };
180 180
181 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_H_ 181 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_TASK_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698