summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/cloud/cloud_external_data_manager.cc
blob: 797ffd0d00071a009f5a709b81312cc555b17841 (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
// Copyright 2013 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 "chrome/browser/policy/cloud/cloud_external_data_manager.h"

#include "chrome/browser/policy/cloud/cloud_policy_store.h"
#include "net/url_request/url_request_context_getter.h"

namespace policy {

CloudExternalDataManager::MetadataEntry::MetadataEntry() {
}

CloudExternalDataManager::MetadataEntry::MetadataEntry(const std::string& url,
                                                       const std::string& hash)
    : url(url),
      hash(hash) {
}

bool CloudExternalDataManager::MetadataEntry::operator!=(
    const MetadataEntry& other) const {
  return url != other.url || hash != other.hash;
}

CloudExternalDataManager::CloudExternalDataManager() : policy_store_(NULL),
                                                       weak_factory_(this) {
}

CloudExternalDataManager::~CloudExternalDataManager() {
}

void CloudExternalDataManager::SetPolicyStore(CloudPolicyStore* policy_store) {
  weak_factory_.InvalidateWeakPtrs();
  policy_store_ = policy_store;
  if (policy_store_)
    policy_store_->SetExternalDataManager(weak_factory_.GetWeakPtr());
}

}  // namespace policy