diff options
author | krasin <krasin@google.com> | 2015-07-28 12:04:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-28 19:04:46 +0000 |
commit | bb63c0a004cbfe727f5715d254fecd3cab8d715d (patch) | |
tree | f3d72ad47b014c633537e727c8bb54891ebee198 | |
parent | ecd29751cb2b004ba30281ba582b004d40443b1b (diff) | |
download | chromium_src-bb63c0a004cbfe727f5715d254fecd3cab8d715d.zip chromium_src-bb63c0a004cbfe727f5715d254fecd3cab8d715d.tar.gz chromium_src-bb63c0a004cbfe727f5715d254fecd3cab8d715d.tar.bz2 |
CFI: fix invalid casts to PrefRegistrySyncable.
This bug was found by Control Flow Integrity check, see
https://sites.google.com/a/chromium.org/dev/developers/testing/control-flow-integrity
There's a number of tests which initialize prefs registry with PrefRegistrySimple,
which then could be incorrectly casted to its subclass PrefRegistrySyncable. The solution is to initialize prefs registry with PrefRegistrySyncable.
See more details in http://crbug.com/513816
BUG=chromium:513816,chromium:457523
Review URL: https://codereview.chromium.org/1252873008
Cr-Commit-Position: refs/heads/master@{#340740}
-rw-r--r-- | extensions/BUILD.gn | 1 | ||||
-rw-r--r-- | extensions/browser/api_unittest.h | 4 | ||||
-rw-r--r-- | extensions/extensions.gyp | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn index fca8f94..c64f5b1 100644 --- a/extensions/BUILD.gn +++ b/extensions/BUILD.gn @@ -83,6 +83,7 @@ source_set("test_support") { "//base", "//base:prefs_test_support", "//components/guest_view/browser:test_support", + "//components/pref_registry:test_support", "//content/public/common", "//content/test:test_support", "//extensions/browser", diff --git a/extensions/browser/api_unittest.h b/extensions/browser/api_unittest.h index dcb09fa..4e31c32 100644 --- a/extensions/browser/api_unittest.h +++ b/extensions/browser/api_unittest.h @@ -9,7 +9,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "base/prefs/testing_pref_service.h" +#include "components/pref_registry/testing_pref_service_syncable.h" #include "extensions/browser/extensions_test.h" namespace base { @@ -89,7 +89,7 @@ class ApiUnitTest : public ExtensionsTest { scoped_ptr<content::NotificationService> notification_service_; scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; - TestingPrefServiceSimple testing_pref_service_; + user_prefs::TestingPrefServiceSyncable testing_pref_service_; // The WebContents used to associate a RenderViewHost with API function calls, // or null. diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp index 7fb6d57..ec9c663 100644 --- a/extensions/extensions.gyp +++ b/extensions/extensions.gyp @@ -248,6 +248,7 @@ 'dependencies': [ '../base/base.gyp:base', '../base/base.gyp:base_prefs_test_support', + '../components/components.gyp:pref_registry_test_support', '../components/components.gyp:user_prefs', '../content/content.gyp:content_browser', '../content/content.gyp:content_common', |