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 "chrome/browser/content_settings/content_settings_pref_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 bool notification_received() const { | 73 bool notification_received() const { |
74 return notification_received_; | 74 return notification_received_; |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 void OnContentSettingsPatternPairsChanged() { | 78 void OnContentSettingsPatternPairsChanged() { |
79 // Check whether |provider_| holds its lock. For this, we need a | 79 // Check whether |provider_| holds its lock. For this, we need a |
80 // separate thread. | 80 // separate thread. |
81 DeadlockCheckerThread thread(provider_); | 81 DeadlockCheckerThread thread(provider_); |
82 base::PlatformThreadHandle handle = base::kNullThreadHandle; | 82 base::PlatformThreadHandle handle; |
83 ASSERT_TRUE(base::PlatformThread::Create(0, &thread, &handle)); | 83 ASSERT_TRUE(base::PlatformThread::Create(0, &thread, &handle)); |
84 base::PlatformThread::Join(handle); | 84 base::PlatformThread::Join(handle); |
85 notification_received_ = true; | 85 notification_received_ = true; |
86 } | 86 } |
87 | 87 |
88 PrefProvider* provider_; | 88 PrefProvider* provider_; |
89 PrefChangeRegistrar pref_change_registrar_; | 89 PrefChangeRegistrar pref_change_registrar_; |
90 bool notification_received_; | 90 bool notification_received_; |
91 DISALLOW_COPY_AND_ASSIGN(DeadlockCheckerObserver); | 91 DISALLOW_COPY_AND_ASSIGN(DeadlockCheckerObserver); |
92 }; | 92 }; |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 DictionaryValue* mutable_settings = update.Get(); | 435 DictionaryValue* mutable_settings = update.Get(); |
436 mutable_settings->SetWithoutPathExpansion("www.example.com,*", | 436 mutable_settings->SetWithoutPathExpansion("www.example.com,*", |
437 new base::DictionaryValue()); | 437 new base::DictionaryValue()); |
438 } | 438 } |
439 EXPECT_TRUE(observer.notification_received()); | 439 EXPECT_TRUE(observer.notification_received()); |
440 | 440 |
441 provider.ShutdownOnUIThread(); | 441 provider.ShutdownOnUIThread(); |
442 } | 442 } |
443 | 443 |
444 } // namespace content_settings | 444 } // namespace content_settings |
OLD | NEW |