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
3 // found in the LICENSE file.
5 #include "sync/tools/null_invalidation_state_tracker.h"
7 #include "base/base64.h"
9 #include "base/callback.h"
10 #include "base/location.h"
11 #include "base/logging.h"
12 #include "base/task_runner.h"
13 #include "components/invalidation/public/invalidation_util.h"
17 NullInvalidationStateTracker::NullInvalidationStateTracker() {}
18 NullInvalidationStateTracker::~NullInvalidationStateTracker() {}
20 void NullInvalidationStateTracker::ClearAndSetNewClientId(
21 const std::string
& data
) {
22 LOG(INFO
) << "Setting invalidator client ID to: " << data
;
25 std::string
NullInvalidationStateTracker::GetInvalidatorClientId() const {
26 // The caller of this function is probably looking for an ID it can use to
27 // identify this client as the originator of some notifiable change. It does
28 // this so the invalidation server can prevent it from being notified of its
29 // own changes. This invalidation state tracker doesn't remember its ID, so
30 // it can't support this feature.
31 NOTREACHED() << "This state tracker does not support reflection-blocking";
35 std::string
NullInvalidationStateTracker::GetBootstrapData() const {
39 void NullInvalidationStateTracker::SetBootstrapData(const std::string
& data
) {
40 std::string base64_data
;
41 base::Base64Encode(data
, &base64_data
);
42 LOG(INFO
) << "Setting bootstrap data to: " << base64_data
;
45 void NullInvalidationStateTracker::Clear() {
46 // We have no members to clear.
49 void NullInvalidationStateTracker::SetSavedInvalidations(
50 const UnackedInvalidationsMap
& states
) {
54 UnackedInvalidationsMap
55 NullInvalidationStateTracker::GetSavedInvalidations() const {
56 return UnackedInvalidationsMap();