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

Side by Side Diff: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc

Issue 12741012: base: Support setting thread priorities generically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static initializers. Created 7 years, 7 months 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 | « base/threading/thread_restrictions.h ('k') | chrome/browser/printing/print_job.cc » ('j') | 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 "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
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
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
OLDNEW
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | chrome/browser/printing/print_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698