| 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; | |
| 28 using base::PlatformFile; | |
| 29 using content::BrowserThread; | 26 using content::BrowserThread; |
| 30 using std::map; | 27 using std::map; |
| 31 using std::set; | 28 using std::set; |
| 32 using std::string; | 29 using std::string; |
| 33 using std::vector; | 30 using std::vector; |
| 34 | 31 |
| 35 namespace { | 32 namespace { |
| 36 | 33 |
| 37 typedef int32 Trigram; | 34 typedef int32 Trigram; |
| 38 typedef char TrigramChar; | 35 typedef char TrigramChar; |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); | 487 vector<FilePath> file_paths = g_trigram_index.Get().Search(query); |
| 491 vector<string> result; | 488 vector<string> result; |
| 492 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); | 489 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); |
| 493 vector<FilePath>::const_iterator it = file_paths.begin(); | 490 vector<FilePath>::const_iterator it = file_paths.begin(); |
| 494 for (; it != file_paths.end(); ++it) { | 491 for (; it != file_paths.end(); ++it) { |
| 495 if (path.IsParent(*it)) | 492 if (path.IsParent(*it)) |
| 496 result.push_back(it->AsUTF8Unsafe()); | 493 result.push_back(it->AsUTF8Unsafe()); |
| 497 } | 494 } |
| 498 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); | 495 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, Bind(callback, result)); |
| 499 } | 496 } |
| OLD | NEW |