summaryrefslogtreecommitdiffstats
path: root/chromium/sync/tools/null_invalidation_state_tracker.cc
blob: 68237595f49fbc87c0342c01681ac4002da13782 (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
52
53
54
55
56
57
58
59
// Copyright (c) 2012 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.

#include "sync/tools/null_invalidation_state_tracker.h"

#include "base/base64.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/task_runner.h"
#include "sync/notifier/invalidation_util.h"

namespace syncer {

NullInvalidationStateTracker::NullInvalidationStateTracker() {}
NullInvalidationStateTracker::~NullInvalidationStateTracker() {}

void NullInvalidationStateTracker::SetInvalidatorClientId(
    const std::string& data) {
  LOG(INFO) << "Setting invalidator client ID to: " << data;
}

std::string NullInvalidationStateTracker::GetInvalidatorClientId() const {
  // The caller of this function is probably looking for an ID it can use to
  // identify this client as the originator of some notifiable change.  It does
  // this so the invalidation server can prevent it from being notified of its
  // own changes.  This invalidation state tracker doesn't remember its ID, so
  // it can't support this feature.
  NOTREACHED() << "This state tracker does not support reflection-blocking";
  return std::string();
}

std::string NullInvalidationStateTracker::GetBootstrapData() const {
  return std::string();
}

void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) {
  std::string base64_data;
  base::Base64Encode(data, &base64_data);
  LOG(INFO) << "Setting bootstrap data to: " << base64_data;
}

void NullInvalidationStateTracker::Clear() {
  // We have no members to clear.
}

void NullInvalidationStateTracker::SetSavedInvalidations(
    const UnackedInvalidationsMap& states) {
  // Do nothing.
}

UnackedInvalidationsMap
NullInvalidationStateTracker::GetSavedInvalidations() const {
  return UnackedInvalidationsMap();
}

}  // namespace syncer