summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/sync/notifier/chrome_system_resources.cc8
-rw-r--r--chrome/browser/sync/notifier/chrome_system_resources_unittest.cc2
2 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/sync/notifier/chrome_system_resources.cc b/chrome/browser/sync/notifier/chrome_system_resources.cc
index 11ef0f0..2f851b6 100644
--- a/chrome/browser/sync/notifier/chrome_system_resources.cc
+++ b/chrome/browser/sync/notifier/chrome_system_resources.cc
@@ -64,17 +64,19 @@ void ChromeSystemResources::ScheduleImmediately(
MessageLoop::current()->PostTask(FROM_HERE, task_to_post);
}
-// The listener thread is just our current thread.
+// The listener thread is just our current thread (i.e., the
+// notifications thread).
void ChromeSystemResources::ScheduleOnListenerThread(
invalidation::Closure* task) {
DCHECK(non_thread_safe_.CalledOnValidThread());
ScheduleImmediately(task);
}
-// We're already on a separate thread, so always return true.
+// 'Internal thread' means 'not the listener thread'. Since the
+// listener thread is the notifications thread, always return false.
bool ChromeSystemResources::IsRunningOnInternalThread() {
DCHECK(non_thread_safe_.CalledOnValidThread());
- return true;
+ return false;
}
void ChromeSystemResources::Log(
diff --git a/chrome/browser/sync/notifier/chrome_system_resources_unittest.cc b/chrome/browser/sync/notifier/chrome_system_resources_unittest.cc
index 9e74fa1..0ee480b 100644
--- a/chrome/browser/sync/notifier/chrome_system_resources_unittest.cc
+++ b/chrome/browser/sync/notifier/chrome_system_resources_unittest.cc
@@ -100,7 +100,7 @@ TEST_F(ChromeSystemResourcesTest, ScheduleOnListenerThread) {
chrome_system_resources_.ScheduleOnListenerThread(
invalidation::NewPermanentCallback(
this, &ChromeSystemResourcesTest::IncrementCounter));
- EXPECT_TRUE(chrome_system_resources_.IsRunningOnInternalThread());
+ EXPECT_FALSE(chrome_system_resources_.IsRunningOnInternalThread());
EXPECT_EQ(0, counter_);
message_loop_.RunAllPending();
EXPECT_EQ(1, counter_);