Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: content/common/plugin_list_win.cc

Issue 674073003: Only scan for correct architecture plugin binaries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/common/plugin_list.h" 5 #include "content/common/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/file_version_info.h" 10 #include "base/file_version_info.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 FindClose(find_handle); 355 FindClose(find_handle);
356 } 356 }
357 357
358 void PluginList::GetPluginPathsFromRegistry( 358 void PluginList::GetPluginPathsFromRegistry(
359 std::vector<base::FilePath>* plugins) { 359 std::vector<base::FilePath>* plugins) {
360 if (PluginList::plugins_discovery_disabled_) 360 if (PluginList::plugins_discovery_disabled_)
361 return; 361 return;
362 362
363 std::set<base::FilePath> plugin_dirs; 363 std::set<base::FilePath> plugin_dirs;
364 364
365 // Search for plugins from HKCU and HKLM. THis will only find plugins that
366 // are correctly registered in the correct WOW64 registry hive.
365 GetPluginsInRegistryDirectory(HKEY_CURRENT_USER, 367 GetPluginsInRegistryDirectory(HKEY_CURRENT_USER,
366 kRegistryMozillaPlugins, 368 kRegistryMozillaPlugins,
367 0, 369 0,
368 &plugin_dirs); 370 &plugin_dirs);
369 GetPluginsInRegistryDirectory(HKEY_LOCAL_MACHINE, 371 GetPluginsInRegistryDirectory(HKEY_LOCAL_MACHINE,
370 kRegistryMozillaPlugins, 372 kRegistryMozillaPlugins,
371 KEY_WOW64_64KEY, 373 0,
372 &plugin_dirs);
373 GetPluginsInRegistryDirectory(HKEY_LOCAL_MACHINE,
374 kRegistryMozillaPlugins,
375 KEY_WOW64_32KEY,
376 &plugin_dirs); 374 &plugin_dirs);
377 375
378 for (std::set<base::FilePath>::iterator i = plugin_dirs.begin(); 376 for (std::set<base::FilePath>::iterator i = plugin_dirs.begin();
379 i != plugin_dirs.end(); ++i) { 377 i != plugin_dirs.end(); ++i) {
380 plugins->push_back(*i); 378 plugins->push_back(*i);
381 } 379 }
382 } 380 }
383 381
384 bool PluginList::ShouldLoadPluginUsingPluginList( 382 bool PluginList::ShouldLoadPluginUsingPluginList(
385 const WebPluginInfo& info, 383 const WebPluginInfo& info,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 return false; 479 return false;
482 #else 480 #else
483 // The plugin in question could be a 64 bit plugin which we cannot load. 481 // The plugin in question could be a 64 bit plugin which we cannot load.
484 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) 482 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path)))
485 return false; 483 return false;
486 #endif 484 #endif
487 return true; 485 return true;
488 } 486 }
489 487
490 } // namespace content 488 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698