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

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

Issue 377383002: Media Galleries: Access MTP devices by file ids rather than file paths. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MTP_DEVICE_ASYNC_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 typedef base::Callback< 42 typedef base::Callback<
43 void(const base::File::Info& file_info, 43 void(const base::File::Info& file_info,
44 const base::FilePath& local_path)> CreateSnapshotFileSuccessCallback; 44 const base::FilePath& local_path)> CreateSnapshotFileSuccessCallback;
45 45
46 // A callback to be called when ReadBytes method call succeeds. 46 // A callback to be called when ReadBytes method call succeeds.
47 typedef base::Callback< 47 typedef base::Callback<
48 void(const base::File::Info& file_info, 48 void(const base::File::Info& file_info,
49 int bytes_read)> ReadBytesSuccessCallback; 49 int bytes_read)> ReadBytesSuccessCallback;
50 50
51 struct ReadBytesRequest { 51 struct ReadBytesRequest {
52 ReadBytesRequest(const std::string& device_file_relative_path, 52 ReadBytesRequest(uint32 file_id,
53 net::IOBuffer* buf, int64 offset, int buf_len, 53 net::IOBuffer* buf, int64 offset, int buf_len,
54 const ReadBytesSuccessCallback& success_callback, 54 const ReadBytesSuccessCallback& success_callback,
55 const ErrorCallback& error_callback); 55 const ErrorCallback& error_callback);
56 ~ReadBytesRequest(); 56 ~ReadBytesRequest();
57 57
58 std::string device_file_relative_path; 58 uint32 file_id;
59 scoped_refptr<net::IOBuffer> buf; 59 scoped_refptr<net::IOBuffer> buf;
60 int64 offset; 60 int64 offset;
61 int buf_len; 61 int buf_len;
62 ReadBytesSuccessCallback success_callback; 62 ReadBytesSuccessCallback success_callback;
63 ErrorCallback error_callback; 63 ErrorCallback error_callback;
64 }; 64 };
65 65
66 // Gets information about the given |file_path| and invokes the appropriate 66 // Gets information about the given |file_path| and invokes the appropriate
67 // callback asynchronously when complete. 67 // callback asynchronously when complete.
68 virtual void GetFileInfo( 68 virtual void GetFileInfo(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 }; 114 };
115 115
116 typedef base::Callback<void(MTPDeviceAsyncDelegate*)> 116 typedef base::Callback<void(MTPDeviceAsyncDelegate*)>
117 CreateMTPDeviceAsyncDelegateCallback; 117 CreateMTPDeviceAsyncDelegateCallback;
118 118
119 void CreateMTPDeviceAsyncDelegate( 119 void CreateMTPDeviceAsyncDelegate(
120 const base::FilePath::StringType& device_location, 120 const base::FilePath::StringType& device_location,
121 const CreateMTPDeviceAsyncDelegateCallback& callback); 121 const CreateMTPDeviceAsyncDelegateCallback& callback);
122 122
123 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ 123 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698