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

Side by Side Diff: chrome/browser/sync/notifier/non_blocking_invalidation_notifier.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/icon_loader.cc ('k') | chrome/browser/sync/notifier/p2p_notifier.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sync/notifier/non_blocking_invalidation_notifier.h" 5 #include "chrome/browser/sync/notifier/non_blocking_invalidation_notifier.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/observer_list_threadsafe.h" 10 #include "base/observer_list_threadsafe.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 const std::string& state) { 134 const std::string& state) {
135 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); 135 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
136 observers_->Notify(&SyncNotifierObserver::StoreState, state); 136 observers_->Notify(&SyncNotifierObserver::StoreState, state);
137 } 137 }
138 138
139 NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier( 139 NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier(
140 const notifier::NotifierOptions& notifier_options, 140 const notifier::NotifierOptions& notifier_options,
141 const std::string& client_info) 141 const std::string& client_info)
142 : core_(new Core), 142 : core_(new Core),
143 parent_message_loop_proxy_( 143 parent_message_loop_proxy_(
144 base::MessageLoopProxy::CreateForCurrentThread()), 144 base::MessageLoopProxy::current()),
145 io_message_loop_proxy_(notifier_options.request_context_getter-> 145 io_message_loop_proxy_(notifier_options.request_context_getter->
146 GetIOMessageLoopProxy()) { 146 GetIOMessageLoopProxy()) {
147 if (!io_message_loop_proxy_->PostTask( 147 if (!io_message_loop_proxy_->PostTask(
148 FROM_HERE, 148 FROM_HERE,
149 NewRunnableMethod( 149 NewRunnableMethod(
150 core_.get(), 150 core_.get(),
151 &NonBlockingInvalidationNotifier::Core::Initialize, 151 &NonBlockingInvalidationNotifier::Core::Initialize,
152 notifier_options, client_info))) { 152 notifier_options, client_info))) {
153 NOTREACHED(); 153 NOTREACHED();
154 } 154 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 } 229 }
230 230
231 void NonBlockingInvalidationNotifier::SendNotification() { 231 void NonBlockingInvalidationNotifier::SendNotification() {
232 DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); 232 DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
233 // InvalidationClient doesn't implement SendNotification(), so no 233 // InvalidationClient doesn't implement SendNotification(), so no
234 // need to forward on the call. 234 // need to forward on the call.
235 } 235 }
236 236
237 } // namespace sync_notifier 237 } // namespace sync_notifier
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader.cc ('k') | chrome/browser/sync/notifier/p2p_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698