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