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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
13 #include "base/files/file_util_proxy.h" | 13 #include "base/files/file_util_proxy.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/platform_file.h" | |
17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
18 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
19 | 18 |
20 using base::Bind; | 19 using base::Bind; |
21 using base::Callback; | 20 using base::Callback; |
22 using base::FileEnumerator; | 21 using base::FileEnumerator; |
23 using base::FilePath; | 22 using base::FilePath; |
24 using base::Time; | 23 using base::Time; |
25 using base::TimeDelta; | 24 using base::TimeDelta; |
26 using base::TimeTicks; | 25 using base::TimeTicks; |
27 using base::PassPlatformFile; | 26 using base::PassPlatformFile; |
Lei Zhang
2014/05/13 01:17:40
Remove these two lines as well?
rvargas (doing something else)
2014/05/13 01:46:00
Nice catch. done.
| |
28 using base::PlatformFile; | 27 using base::PlatformFile; |
29 using content::BrowserThread; | 28 using content::BrowserThread; |
30 using std::map; | 29 using std::map; |
31 using std::set; | 30 using std::set; |
32 using std::string; | 31 using std::string; |
33 using std::vector; | 32 using std::vector; |
34 | 33 |
35 namespace { | 34 namespace { |
36 | 35 |
37 typedef int32 Trigram; | 36 typedef int32 Trigram; |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); | 489 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); |
491 vector<string> result; | 490 vector<string> result; |
492 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); | 491 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); |
493 vector<FilePath>::const_iterator it = file_paths.begin(); | 492 vector<FilePath>::const_iterator it = file_paths.begin(); |
494 for (; it != file_paths.end(); ++it) { | 493 for (; it != file_paths.end(); ++it) { |
495 if (path.IsParent(*it)) | 494 if (path.IsParent(*it)) |
496 result.push_back(it->AsUTF8Unsafe()); | 495 result.push_back(it->AsUTF8Unsafe()); |
497 } | 496 } |
498 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); | 497 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); |
499 } | 498 } |
OLD | NEW |