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 "sync/notifier/sync_invalidation_listener.h" | 5 #include "sync/notifier/sync_invalidation_listener.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 namespace syncer { | 29 namespace syncer { |
30 | 30 |
31 SyncInvalidationListener::Delegate::~Delegate() {} | 31 SyncInvalidationListener::Delegate::~Delegate() {} |
32 | 32 |
33 SyncInvalidationListener::SyncInvalidationListener( | 33 SyncInvalidationListener::SyncInvalidationListener( |
34 base::TickClock* tick_clock, | 34 base::TickClock* tick_clock, |
35 scoped_ptr<notifier::PushClient> push_client) | 35 scoped_ptr<notifier::PushClient> push_client) |
36 : weak_ptr_factory_(this), | 36 : ack_tracker_(tick_clock, this), |
37 ack_tracker_(tick_clock, this), | |
38 push_client_(push_client.get()), | 37 push_client_(push_client.get()), |
39 sync_system_resources_(push_client.Pass(), this), | 38 sync_system_resources_(push_client.Pass(), this), |
40 delegate_(NULL), | 39 delegate_(NULL), |
41 ticl_state_(DEFAULT_INVALIDATION_ERROR), | 40 ticl_state_(DEFAULT_INVALIDATION_ERROR), |
42 push_client_state_(DEFAULT_INVALIDATION_ERROR) { | 41 push_client_state_(DEFAULT_INVALIDATION_ERROR), |
| 42 weak_ptr_factory_(this) { |
43 DCHECK(CalledOnValidThread()); | 43 DCHECK(CalledOnValidThread()); |
44 push_client_->AddObserver(this); | 44 push_client_->AddObserver(this); |
45 } | 45 } |
46 | 46 |
47 SyncInvalidationListener::~SyncInvalidationListener() { | 47 SyncInvalidationListener::~SyncInvalidationListener() { |
48 DCHECK(CalledOnValidThread()); | 48 DCHECK(CalledOnValidThread()); |
49 push_client_->RemoveObserver(this); | 49 push_client_->RemoveObserver(this); |
50 Stop(); | 50 Stop(); |
51 DCHECK(!delegate_); | 51 DCHECK(!delegate_); |
52 } | 52 } |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 EmitStateChange(); | 479 EmitStateChange(); |
480 } | 480 } |
481 | 481 |
482 void SyncInvalidationListener::OnIncomingNotification( | 482 void SyncInvalidationListener::OnIncomingNotification( |
483 const notifier::Notification& notification) { | 483 const notifier::Notification& notification) { |
484 DCHECK(CalledOnValidThread()); | 484 DCHECK(CalledOnValidThread()); |
485 // Do nothing, since this is already handled by |invalidation_client_|. | 485 // Do nothing, since this is already handled by |invalidation_client_|. |
486 } | 486 } |
487 | 487 |
488 } // namespace syncer | 488 } // namespace syncer |
OLD | NEW |