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

Side by Side Diff: chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.cc

Issue 356713005: Rename ServerBoundCert => ChannelID to reflect the current name (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 months 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
(Empty)
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.
4
5 #include "chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.h"
6
7 #include "base/logging.h"
8
9 MockBrowsingDataChannelIDHelper::MockBrowsingDataChannelIDHelper()
10 : BrowsingDataChannelIDHelper() {}
11
12 MockBrowsingDataChannelIDHelper::
13 ~MockBrowsingDataChannelIDHelper() {}
14
15 void MockBrowsingDataChannelIDHelper::StartFetching(
16 const FetchResultCallback& callback) {
17 callback_ = callback;
18 }
19
20 void MockBrowsingDataChannelIDHelper::DeleteChannelID(
21 const std::string& server_id) {
22 CHECK(channel_ids_.find(server_id) != channel_ids_.end());
23 channel_ids_[server_id] = false;
24 }
25
26 void MockBrowsingDataChannelIDHelper::AddChannelIDSample(
27 const std::string& server_id) {
28 DCHECK(channel_ids_.find(server_id) == channel_ids_.end());
29 channel_id_list_.push_back(
30 net::ChannelIDStore::ChannelID(
31 server_id, base::Time(), base::Time(), "key", "cert"));
32 channel_ids_[server_id] = true;
33 }
34
35 void MockBrowsingDataChannelIDHelper::Notify() {
36 net::ChannelIDStore::ChannelIDList cert_list;
wtc 2014/07/01 19:50:49 cert_list => channel_id_list
Ryan Hamilton 2014/07/21 19:12:04 Done.
37 for (net::ChannelIDStore::ChannelIDList::iterator i =
38 channel_id_list_.begin();
39 i != channel_id_list_.end(); ++i) {
40 if (channel_ids_[i->server_identifier()])
41 cert_list.push_back(*i);
42 }
43 callback_.Run(cert_list);
44 }
45
46 void MockBrowsingDataChannelIDHelper::Reset() {
47 for (std::map<const std::string, bool>::iterator i =
48 channel_ids_.begin();
49 i != channel_ids_.end(); ++i)
50 i->second = true;
51 }
52
53 bool MockBrowsingDataChannelIDHelper::AllDeleted() {
54 for (std::map<const std::string, bool>::const_iterator i =
55 channel_ids_.begin();
56 i != channel_ids_.end(); ++i)
57 if (i->second)
58 return false;
59 return true;
60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698