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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h

Issue 875513006: Files.app: Implement md5 hashing over file streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 // This file provides file system related API functions. 5 // This file provides file system related API functions.
6 6
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_ H_ 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_ H_
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_ H_ 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYSTEM_ H_
9 9
10 #include <string> 10 #include <string>
(...skipping 14 matching lines...) Expand all
25 25
26 namespace file_manager { 26 namespace file_manager {
27 namespace util { 27 namespace util {
28 struct EntryDefinition; 28 struct EntryDefinition;
29 typedef std::vector<EntryDefinition> EntryDefinitionList; 29 typedef std::vector<EntryDefinition> EntryDefinitionList;
30 } // namespace util 30 } // namespace util
31 } // namespace file_manager 31 } // namespace file_manager
32 32
33 namespace drive { 33 namespace drive {
34 struct HashAndFilePath; 34 struct HashAndFilePath;
35 namespace util {
36 class FileStreamMd5Digester;
37 } // namespace util
35 } // namespace drive 38 } // namespace drive
36 39
37 namespace extensions { 40 namespace extensions {
38 41
39 // Implements the chrome.fileManagerPrivate.requestFileSystem method. 42 // Implements the chrome.fileManagerPrivate.requestFileSystem method.
40 class FileManagerPrivateRequestFileSystemFunction 43 class FileManagerPrivateRequestFileSystemFunction
41 : public LoggedAsyncExtensionFunction { 44 : public LoggedAsyncExtensionFunction {
42 public: 45 public:
43 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestFileSystem", 46 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestFileSystem",
44 FILEMANAGERPRIVATE_REQUESTFILESYSTEM) 47 FILEMANAGERPRIVATE_REQUESTFILESYSTEM)
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 bool RunAsync() override; 232 bool RunAsync() override;
230 233
231 private: 234 private:
232 void RunAsyncAfterConvertFileDefinitionListToEntryDefinitionList(scoped_ptr< 235 void RunAsyncAfterConvertFileDefinitionListToEntryDefinitionList(scoped_ptr<
233 file_manager::util::EntryDefinitionList> entry_definition_list); 236 file_manager::util::EntryDefinitionList> entry_definition_list);
234 }; 237 };
235 238
236 class FileManagerPrivateComputeChecksumFunction 239 class FileManagerPrivateComputeChecksumFunction
237 : public LoggedAsyncExtensionFunction { 240 : public LoggedAsyncExtensionFunction {
238 public: 241 public:
242 FileManagerPrivateComputeChecksumFunction();
239 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.computeChecksum", 243 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.computeChecksum",
240 FILEMANAGERPRIVATE_COMPUTECHECKSUM) 244 FILEMANAGERPRIVATE_COMPUTECHECKSUM)
241 245
242 protected: 246 protected:
243 ~FileManagerPrivateComputeChecksumFunction() override {} 247 ~FileManagerPrivateComputeChecksumFunction() override;
244 248
245 // AsyncExtensionFunction overrides. 249 // AsyncExtensionFunction overrides.
246 bool RunAsync() override; 250 bool RunAsync() override;
247 251
248 private: 252 private:
253 scoped_ptr<drive::util::FileStreamMd5Digester> digester_;
249 void Respond(const std::string& hash); 254 void Respond(const std::string& hash);
250 }; 255 };
251 256
252 // Implements the chrome.fileManagerPrivate.searchFilesByHashes method. 257 // Implements the chrome.fileManagerPrivate.searchFilesByHashes method.
253 class FileManagerPrivateSearchFilesByHashesFunction 258 class FileManagerPrivateSearchFilesByHashesFunction
254 : public LoggedAsyncExtensionFunction { 259 : public LoggedAsyncExtensionFunction {
255 public: 260 public:
256 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchFilesByHashes", 261 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchFilesByHashes",
257 FILEMANAGERPRIVATE_SEARCHFILESBYHASHES) 262 FILEMANAGERPRIVATE_SEARCHFILESBYHASHES)
258 263
259 protected: 264 protected:
260 ~FileManagerPrivateSearchFilesByHashesFunction() override {} 265 ~FileManagerPrivateSearchFilesByHashesFunction() override {}
261 266
262 private: 267 private:
263 // AsyncExtensionFunction overrides. 268 // AsyncExtensionFunction overrides.
264 bool RunAsync() override; 269 bool RunAsync() override;
265 270
266 // Sends a response with |results| to the extension. 271 // Sends a response with |results| to the extension.
267 void OnSearchByHashes(const std::set<std::string>& hashes, 272 void OnSearchByHashes(const std::set<std::string>& hashes,
268 drive::FileError error, 273 drive::FileError error,
269 const std::vector<drive::HashAndFilePath>& results); 274 const std::vector<drive::HashAndFilePath>& results);
270 }; 275 };
271 276
272 } // namespace extensions 277 } // namespace extensions
273 278
274 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYST EM_H_ 279 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYST EM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698