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