summaryrefslogtreecommitdiffstats
path: root/components/feedback
diff options
context:
space:
mode:
authorkrasin <krasin@google.com>2015-07-29 13:36:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-29 20:37:08 +0000
commite9d163d73d053658c728aaf14d350a398c947178 (patch)
tree03c26fa36a425d3411f290e2372f8d600428e32f /components/feedback
parent4064b2ef267555e9daf0d2d4ce3c2b39c3c7536e (diff)
downloadchromium_src-e9d163d73d053658c728aaf14d350a398c947178.zip
chromium_src-e9d163d73d053658c728aaf14d350a398c947178.tar.gz
chromium_src-e9d163d73d053658c728aaf14d350a398c947178.tar.bz2
CFI: Fix invalid cast 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 FeedbackUploaderTest initializes 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/513953 BUG=chromium:513953, chromium:457523 Review URL: https://codereview.chromium.org/1259703003 Cr-Commit-Position: refs/heads/master@{#340969}
Diffstat (limited to 'components/feedback')
-rw-r--r--components/feedback/DEPS1
-rw-r--r--components/feedback/feedback_uploader_unittest.cc4
2 files changed, 3 insertions, 2 deletions
diff --git a/components/feedback/DEPS b/components/feedback/DEPS
index 5acecfd..c88ff4e 100644
--- a/components/feedback/DEPS
+++ b/components/feedback/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"-content",
"+components/keyed_service",
+ "+components/pref_registry",
"+components/user_prefs",
"+components/variations",
"+content/public/browser",
diff --git a/components/feedback/feedback_uploader_unittest.cc b/components/feedback/feedback_uploader_unittest.cc
index bd74485..80bbb21 100644
--- a/components/feedback/feedback_uploader_unittest.cc
+++ b/components/feedback/feedback_uploader_unittest.cc
@@ -9,11 +9,11 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "base/prefs/testing_pref_service.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "components/feedback/feedback_uploader_chrome.h"
#include "components/feedback/feedback_uploader_factory.h"
+#include "components/pref_registry/testing_pref_service_syncable.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread.h"
@@ -45,7 +45,7 @@ class FeedbackUploaderTest : public testing::Test {
FeedbackUploaderTest()
: ui_thread_(content::BrowserThread::UI, &message_loop_),
context_(new content::TestBrowserContext()),
- prefs_(new TestingPrefServiceSimple()),
+ prefs_(new user_prefs::TestingPrefServiceSyncable()),
dispatched_reports_count_(0),
expected_reports_(0) {
user_prefs::UserPrefs::Set(context_.get(), prefs_.get());