| 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 21 matching lines...) Expand all Loading... |
| 32 using ::testing::_; | 32 using ::testing::_; |
| 33 using content::BrowserThread; | 33 using content::BrowserThread; |
| 34 | 34 |
| 35 namespace content_settings { | 35 namespace content_settings { |
| 36 | 36 |
| 37 class DeadlockCheckerThread : public base::PlatformThread::Delegate { | 37 class DeadlockCheckerThread : public base::PlatformThread::Delegate { |
| 38 public: | 38 public: |
| 39 explicit DeadlockCheckerThread(PrefProvider* provider) | 39 explicit DeadlockCheckerThread(PrefProvider* provider) |
| 40 : provider_(provider) {} | 40 : provider_(provider) {} |
| 41 | 41 |
| 42 virtual void ThreadMain() { | 42 virtual void ThreadMain() OVERRIDE { |
| 43 bool got_lock = provider_->lock_.Try(); | 43 bool got_lock = provider_->lock_.Try(); |
| 44 EXPECT_TRUE(got_lock); | 44 EXPECT_TRUE(got_lock); |
| 45 if (got_lock) | 45 if (got_lock) |
| 46 provider_->lock_.Release(); | 46 provider_->lock_.Release(); |
| 47 } | 47 } |
| 48 private: | 48 private: |
| 49 PrefProvider* provider_; | 49 PrefProvider* provider_; |
| 50 DISALLOW_COPY_AND_ASSIGN(DeadlockCheckerThread); | 50 DISALLOW_COPY_AND_ASSIGN(DeadlockCheckerThread); |
| 51 }; | 51 }; |
| 52 | 52 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 DictionaryValue* mutable_settings = update.Get(); | 383 DictionaryValue* mutable_settings = update.Get(); |
| 384 mutable_settings->SetWithoutPathExpansion("www.example.com,*", | 384 mutable_settings->SetWithoutPathExpansion("www.example.com,*", |
| 385 new base::DictionaryValue()); | 385 new base::DictionaryValue()); |
| 386 } | 386 } |
| 387 EXPECT_TRUE(observer.notification_received()); | 387 EXPECT_TRUE(observer.notification_received()); |
| 388 | 388 |
| 389 provider.ShutdownOnUIThread(); | 389 provider.ShutdownOnUIThread(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace content_settings | 392 } // namespace content_settings |
| OLD | NEW |