| OLD | NEW |
| 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_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_INDEXER_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_INDEXER_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_INDEXER_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_INDEXER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 15 | 16 |
| 16 class Profile; | 17 class Profile; |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class FilePath; | 20 class FilePath; |
| 20 class FileEnumerator; | 21 class FileEnumerator; |
| 21 class Time; | 22 class Time; |
| 22 } | 23 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 FileSystemIndexingJob(const base::FilePath& file_system_path, | 45 FileSystemIndexingJob(const base::FilePath& file_system_path, |
| 45 const TotalWorkCallback& total_work_callback, | 46 const TotalWorkCallback& total_work_callback, |
| 46 const WorkedCallback& worked_callback, | 47 const WorkedCallback& worked_callback, |
| 47 const DoneCallback& done_callback); | 48 const DoneCallback& done_callback); |
| 48 virtual ~FileSystemIndexingJob(); | 49 virtual ~FileSystemIndexingJob(); |
| 49 | 50 |
| 50 void Start(); | 51 void Start(); |
| 51 void StopOnFileThread(); | 52 void StopOnFileThread(); |
| 52 void CollectFilesToIndex(); | 53 void CollectFilesToIndex(); |
| 53 void IndexFiles(); | 54 void IndexFiles(); |
| 54 void StartFileIndexing(base::PlatformFileError error, | 55 void StartFileIndexing(base::File::Error error, |
| 55 base::PassPlatformFile pass_file, | 56 base::PassPlatformFile pass_file, |
| 56 bool); | 57 bool); |
| 57 void ReadFromFile(); | 58 void ReadFromFile(); |
| 58 void OnRead(base::PlatformFileError error, | 59 void OnRead(base::File::Error error, |
| 59 const char* data, | 60 const char* data, |
| 60 int bytes_read); | 61 int bytes_read); |
| 61 void FinishFileIndexing(bool success); | 62 void FinishFileIndexing(bool success); |
| 62 void CloseFile(); | 63 void CloseFile(); |
| 63 void CloseCallback(base::PlatformFileError error); | 64 void CloseCallback(base::File::Error error); |
| 64 void ReportWorked(); | 65 void ReportWorked(); |
| 65 | 66 |
| 66 base::FilePath file_system_path_; | 67 base::FilePath file_system_path_; |
| 67 TotalWorkCallback total_work_callback_; | 68 TotalWorkCallback total_work_callback_; |
| 68 WorkedCallback worked_callback_; | 69 WorkedCallback worked_callback_; |
| 69 DoneCallback done_callback_; | 70 DoneCallback done_callback_; |
| 70 scoped_ptr<base::FileEnumerator> file_enumerator_; | 71 scoped_ptr<base::FileEnumerator> file_enumerator_; |
| 71 typedef std::map<base::FilePath, base::Time> FilePathTimesMap; | 72 typedef std::map<base::FilePath, base::Time> FilePathTimesMap; |
| 72 FilePathTimesMap file_path_times_; | 73 FilePathTimesMap file_path_times_; |
| 73 FilePathTimesMap::const_iterator indexing_it_; | 74 FilePathTimesMap::const_iterator indexing_it_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 103 virtual ~DevToolsFileSystemIndexer(); | 104 virtual ~DevToolsFileSystemIndexer(); |
| 104 | 105 |
| 105 void SearchInPathOnFileThread(const std::string& file_system_path, | 106 void SearchInPathOnFileThread(const std::string& file_system_path, |
| 106 const std::string& query, | 107 const std::string& query, |
| 107 const SearchCallback& callback); | 108 const SearchCallback& callback); |
| 108 | 109 |
| 109 DISALLOW_COPY_AND_ASSIGN(DevToolsFileSystemIndexer); | 110 DISALLOW_COPY_AND_ASSIGN(DevToolsFileSystemIndexer); |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_INDEXER_H_ | 113 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_SYSTEM_INDEXER_H_ |
| OLD | NEW |