| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 std::vector<webkit::WebPluginInfo>* plugins) { | 383 std::vector<webkit::WebPluginInfo>* plugins) { |
| 384 // Version check | 384 // Version check |
| 385 for (size_t j = 0; j < plugins->size(); ++j) { | 385 for (size_t j = 0; j < plugins->size(); ++j) { |
| 386 base::FilePath::StringType plugin1 = | 386 base::FilePath::StringType plugin1 = |
| 387 StringToLowerASCII((*plugins)[j].path.BaseName().value()); | 387 StringToLowerASCII((*plugins)[j].path.BaseName().value()); |
| 388 base::FilePath::StringType plugin2 = | 388 base::FilePath::StringType plugin2 = |
| 389 StringToLowerASCII(info.path.BaseName().value()); | 389 StringToLowerASCII(info.path.BaseName().value()); |
| 390 if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) || | 390 if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) || |
| 391 (plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) || | 391 (plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) || |
| 392 (plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) { | 392 (plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) { |
| 393 if (!IsNewerVersion((*plugins)[j].version, info.version)) | 393 if (IsNewerVersion(info.version, (*plugins)[j].version)) |
| 394 return false; // We have loaded a plugin whose version is newer. | 394 return false; // We have loaded a plugin whose version is newer. |
| 395 plugins->erase(plugins->begin() + j); | 395 plugins->erase(plugins->begin() + j); |
| 396 break; | 396 break; |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 | 399 |
| 400 // The checks below only apply to NPAPI plugins. | 400 // The checks below only apply to NPAPI plugins. |
| 401 if (info.type != WebPluginInfo::PLUGIN_TYPE_NPAPI) | 401 if (info.type != WebPluginInfo::PLUGIN_TYPE_NPAPI) |
| 402 return true; | 402 return true; |
| 403 | 403 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 // The plugin in question could be a 64 bit plugin which we cannot load. | 466 // The plugin in question could be a 64 bit plugin which we cannot load. |
| 467 base::FilePath plugin_path(info.path); | 467 base::FilePath plugin_path(info.path); |
| 468 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) | 468 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) |
| 469 return false; | 469 return false; |
| 470 #endif | 470 #endif |
| 471 return true; | 471 return true; |
| 472 } | 472 } |
| 473 | 473 |
| 474 } // namespace npapi | 474 } // namespace npapi |
| 475 } // namespace webkit | 475 } // namespace webkit |
| OLD | NEW |