| 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 #include "chrome/browser/devtools/devtools_file_system_indexer.h" | 5 #include "chrome/browser/devtools/devtools_file_system_indexer.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 using base::Callback; | 21 using base::Callback; |
| 22 using base::FileEnumerator; | 22 using base::FileEnumerator; |
| 23 using base::FilePath; | 23 using base::FilePath; |
| 24 using base::FileUtilProxy; | 24 using base::FileUtilProxy; |
| 25 using base::Time; | 25 using base::Time; |
| 26 using base::TimeDelta; | 26 using base::TimeDelta; |
| 27 using base::TimeTicks; | 27 using base::TimeTicks; |
| 28 using base::PassPlatformFile; | 28 using base::PassPlatformFile; |
| 29 using base::PlatformFile; | 29 using base::PlatformFile; |
| 30 using base::PlatformFileError; | 30 using base::PlatformFileError; |
| 31 using base::PlatformFileInfo; | |
| 32 using content::BrowserThread; | 31 using content::BrowserThread; |
| 33 using std::map; | 32 using std::map; |
| 34 using std::set; | 33 using std::set; |
| 35 using std::string; | 34 using std::string; |
| 36 using std::vector; | 35 using std::vector; |
| 37 | 36 |
| 38 namespace { | 37 namespace { |
| 39 | 38 |
| 40 typedef int32 Trigram; | 39 typedef int32 Trigram; |
| 41 typedef char TrigramChar; | 40 typedef char TrigramChar; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); | 503 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); |
| 505 vector<string> result; | 504 vector<string> result; |
| 506 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); | 505 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); |
| 507 vector<FilePath>::const_iterator it = file_paths.begin(); | 506 vector<FilePath>::const_iterator it = file_paths.begin(); |
| 508 for (; it != file_paths.end(); ++it) { | 507 for (; it != file_paths.end(); ++it) { |
| 509 if (path.IsParent(*it)) | 508 if (path.IsParent(*it)) |
| 510 result.push_back(it->AsUTF8Unsafe()); | 509 result.push_back(it->AsUTF8Unsafe()); |
| 511 } | 510 } |
| 512 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); | 511 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); |
| 513 } | 512 } |
| OLD | NEW |