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

Side by Side Diff: net/reporting/reporting_test_util.cc

Issue 2708503002: Reporting: Implement cache. (Closed)
Patch Set: rebase Created 3 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2017 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 "net/reporting/reporting_test_util.h"
6
7 #include <vector>
8
9 #include "url/gurl.h"
10 #include "url/origin.h"
11
12 namespace net {
13
14 using Client = ReportingCache::Client;
15
16 const Client* FindClientInCache(const ReportingCache* cache,
17 const url::Origin& origin,
18 const GURL& endpoint) {
19 std::vector<const Client*> clients;
20 cache->GetClients(&clients);
21 for (const Client* client : clients) {
22 if (client->origin == origin && client->endpoint == endpoint)
23 return client;
24 }
25 return nullptr;
26 }
27
28 } // namespace net
OLDNEW
« net/reporting/reporting_cache_unittest.cc ('K') | « net/reporting/reporting_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698