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" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 false, // not recursive | 209 false, // not recursive |
210 file_util::FileEnumerator::FILES); | 210 file_util::FileEnumerator::FILES); |
211 for (base::FilePath path = enumerator.Next(); !path.value().empty(); | 211 for (base::FilePath path = enumerator.Next(); !path.value().empty(); |
212 path = enumerator.Next()) { | 212 path = enumerator.Next()) { |
213 // Skip over Mozilla .xpt files. | 213 // Skip over Mozilla .xpt files. |
214 if (path.MatchesExtension(FILE_PATH_LITERAL(".xpt"))) | 214 if (path.MatchesExtension(FILE_PATH_LITERAL(".xpt"))) |
215 continue; | 215 continue; |
216 | 216 |
217 // 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 |
218 // its path to find dependent data files. | 218 // its path to find dependent data files. |
219 // file_util::AbsolutePath calls through to realpath(), which resolves | 219 // AsAbsolute calls through to realpath(), which resolves symlinks. |
220 // symlinks. | 220 base::FilePath orig_path = path.AsAbsolute(); |
221 base::FilePath orig_path = path; | |
222 file_util::AbsolutePath(&path); | |
223 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 221 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
224 << "Resolved " << orig_path.value() << " -> " << path.value(); | 222 << "Resolved " << orig_path.value() << " -> " << path.value(); |
225 | 223 |
226 if (std::find(plugins->begin(), plugins->end(), path) != plugins->end()) { | 224 if (std::find(plugins->begin(), plugins->end(), path) != plugins->end()) { |
227 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 225 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
228 << "Skipping duplicate instance of " << path.value(); | 226 << "Skipping duplicate instance of " << path.value(); |
229 continue; | 227 continue; |
230 } | 228 } |
231 | 229 |
232 if (IsBlacklistedPlugin(path)) { | 230 if (IsBlacklistedPlugin(path)) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 292 |
295 // TODO(evanm): prefer the newest version of flash, etc. here? | 293 // TODO(evanm): prefer the newest version of flash, etc. here? |
296 | 294 |
297 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); | 295 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); |
298 | 296 |
299 return true; | 297 return true; |
300 } | 298 } |
301 | 299 |
302 } // namespace npapi | 300 } // namespace npapi |
303 } // namespace webkit | 301 } // namespace webkit |
OLD | NEW |