OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/files/file_enumerator.h" |
11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
12 #include "base/sha1.h" | 13 #include "base/sha1.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
15 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
17 | 18 |
18 namespace webkit { | 19 namespace webkit { |
19 namespace npapi { | 20 namespace npapi { |
20 | 21 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 199 } |
199 | 200 |
200 void PluginList::GetPluginsInDir( | 201 void PluginList::GetPluginsInDir( |
201 const base::FilePath& dir_path, std::vector<base::FilePath>* plugins) { | 202 const base::FilePath& dir_path, std::vector<base::FilePath>* plugins) { |
202 // See ScanPluginsDirectory near | 203 // See ScanPluginsDirectory near |
203 // http://mxr.mozilla.org/firefox/source/modules/plugin/base/src/nsPluginHostI
mpl.cpp#5052 | 204 // http://mxr.mozilla.org/firefox/source/modules/plugin/base/src/nsPluginHostI
mpl.cpp#5052 |
204 | 205 |
205 // Construct and stat a list of all filenames under consideration, for | 206 // Construct and stat a list of all filenames under consideration, for |
206 // later sorting by mtime. | 207 // later sorting by mtime. |
207 FileTimeList files; | 208 FileTimeList files; |
208 file_util::FileEnumerator enumerator(dir_path, | 209 base::FileEnumerator enumerator(dir_path, |
209 false, // not recursive | 210 false, // not recursive |
210 file_util::FileEnumerator::FILES); | 211 base::FileEnumerator::FILES); |
211 for (base::FilePath path = enumerator.Next(); !path.value().empty(); | 212 for (base::FilePath path = enumerator.Next(); !path.value().empty(); |
212 path = enumerator.Next()) { | 213 path = enumerator.Next()) { |
213 // Skip over Mozilla .xpt files. | 214 // Skip over Mozilla .xpt files. |
214 if (path.MatchesExtension(FILE_PATH_LITERAL(".xpt"))) | 215 if (path.MatchesExtension(FILE_PATH_LITERAL(".xpt"))) |
215 continue; | 216 continue; |
216 | 217 |
217 // Java doesn't like being loaded through a symlink, since it uses | 218 // Java doesn't like being loaded through a symlink, since it uses |
218 // its path to find dependent data files. | 219 // its path to find dependent data files. |
219 // MakeAbsoluteFilePath calls through to realpath(), which resolves | 220 // MakeAbsoluteFilePath calls through to realpath(), which resolves |
220 // symlinks. | 221 // symlinks. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 294 |
294 // TODO(evanm): prefer the newest version of flash, etc. here? | 295 // TODO(evanm): prefer the newest version of flash, etc. here? |
295 | 296 |
296 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); | 297 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); |
297 | 298 |
298 return true; | 299 return true; |
299 } | 300 } |
300 | 301 |
301 } // namespace npapi | 302 } // namespace npapi |
302 } // namespace webkit | 303 } // namespace webkit |
OLD | NEW |