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

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: Address feedback. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_file_system.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 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 13 matching lines...) Expand all
24 } // namespace storage 24 } // namespace storage
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 namespace util {
35 class FileStreamMd5Digester;
36 } // namespace util
34 struct HashAndFilePath; 37 struct HashAndFilePath;
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",
(...skipping 185 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();
243
239 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.computeChecksum", 244 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.computeChecksum",
240 FILEMANAGERPRIVATE_COMPUTECHECKSUM) 245 FILEMANAGERPRIVATE_COMPUTECHECKSUM)
241 246
242 protected: 247 protected:
243 ~FileManagerPrivateComputeChecksumFunction() override {} 248 ~FileManagerPrivateComputeChecksumFunction() override;
244 249
245 // AsyncExtensionFunction overrides. 250 // AsyncExtensionFunction overrides.
246 bool RunAsync() override; 251 bool RunAsync() override;
247 252
248 private: 253 private:
254 scoped_ptr<drive::util::FileStreamMd5Digester> digester_;
255
249 void Respond(const std::string& hash); 256 void Respond(const std::string& hash);
250 }; 257 };
251 258
252 // Implements the chrome.fileManagerPrivate.searchFilesByHashes method. 259 // Implements the chrome.fileManagerPrivate.searchFilesByHashes method.
253 class FileManagerPrivateSearchFilesByHashesFunction 260 class FileManagerPrivateSearchFilesByHashesFunction
254 : public LoggedAsyncExtensionFunction { 261 : public LoggedAsyncExtensionFunction {
255 public: 262 public:
256 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchFilesByHashes", 263 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchFilesByHashes",
257 FILEMANAGERPRIVATE_SEARCHFILESBYHASHES) 264 FILEMANAGERPRIVATE_SEARCHFILESBYHASHES)
258 265
259 protected: 266 protected:
260 ~FileManagerPrivateSearchFilesByHashesFunction() override {} 267 ~FileManagerPrivateSearchFilesByHashesFunction() override {}
261 268
262 private: 269 private:
263 // AsyncExtensionFunction overrides. 270 // AsyncExtensionFunction overrides.
264 bool RunAsync() override; 271 bool RunAsync() override;
265 272
266 // Sends a response with |results| to the extension. 273 // Sends a response with |results| to the extension.
267 void OnSearchByHashes(const std::set<std::string>& hashes, 274 void OnSearchByHashes(const std::set<std::string>& hashes,
268 drive::FileError error, 275 drive::FileError error,
269 const std::vector<drive::HashAndFilePath>& results); 276 const std::vector<drive::HashAndFilePath>& results);
270 }; 277 };
271 278
272 } // namespace extensions 279 } // namespace extensions
273 280
274 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYST EM_H_ 281 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_FILE_SYST EM_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698