blob: 0d80b9a2b69763c57c522b5d69275d9e6b53bcd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_H_
#define CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_H_
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "sync/notifier/invalidator_state.h"
namespace base {
class DictionaryValue;
} // namespace base
namespace syncer {
class ObjectIdInvalidationMap;
}
namespace invalidation {
class InvalidationLoggerObserver;
class InvalidationLogger {
public:
// Pass through to any registered InvalidationLoggerObservers.
// We will do local logging here too.
void OnRegistration(const base::DictionaryValue& details);
void OnUnregistration(const base::DictionaryValue& details);
void OnStateChange(const syncer::InvalidatorState& newState);
void OnUpdateIds(const base::DictionaryValue& details);
void OnDebugMessage(const base::DictionaryValue& details);
void OnInvalidation(const syncer::ObjectIdInvalidationMap& details);
void EmitContent();
InvalidationLogger();
~InvalidationLogger();
void RegisterForDebug(InvalidationLoggerObserver* debug_observer);
void UnregisterForDebug(InvalidationLoggerObserver* debug_observer);
private:
void EmitState();
// The list of every observer currently listening for notifications.
ObserverList<InvalidationLoggerObserver> observer_list_;
// The last InvalidatorState updated by the InvalidatorService.
syncer::InvalidatorState last_invalidator_state_;
};
} // namespace invalidation
#endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_H_
|