Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/browser/chromeos/policy/cloud_external_data_store.cc

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/policy/cloud_external_data_store.h" 5 #include "chrome/browser/chromeos/policy/cloud_external_data_store.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
11 #include "base/sha1.h" 11 #include "base/sha1.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "chrome/browser/policy/cloud/resource_cache.h" 13 #include "components/policy/core/common/cloud/resource_cache.h"
14 14
15 namespace policy { 15 namespace policy {
16 16
17 namespace { 17 namespace {
18 18
19 // Encodes (policy, hash) into a single string. 19 // Encodes (policy, hash) into a single string.
20 std::string GetSubkey(const std::string& policy, const std::string& hash) { 20 std::string GetSubkey(const std::string& policy, const std::string& hash) {
21 DCHECK(!policy.empty()); 21 DCHECK(!policy.empty());
22 DCHECK(!hash.empty()); 22 DCHECK(!hash.empty());
23 return base::IntToString(policy.size()) + ":" + 23 return base::IntToString(policy.size()) + ":" +
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return true; 69 return true;
70 // If the data is larger than allowed or does not match the expected hash, 70 // If the data is larger than allowed or does not match the expected hash,
71 // delete the entry. 71 // delete the entry.
72 cache_->Delete(cache_key_, subkey); 72 cache_->Delete(cache_key_, subkey);
73 data->clear(); 73 data->clear();
74 } 74 }
75 return false; 75 return false;
76 } 76 }
77 77
78 } // namespace policy 78 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698