Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "net/reporting/reporting_cache.h" | |
| 10 #include "net/reporting/reporting_client.h" | |
| 11 #include "url/gurl.h" | |
| 12 #include "url/origin.h" | |
| 13 | |
| 14 namespace net { | |
| 15 | |
| 16 const ReportingClient* FindClientInCache(const ReportingCache* cache, | |
| 17 const url::Origin& origin, | |
| 18 const GURL& endpoint) { | |
| 19 std::vector<const ReportingClient*> clients; | |
| 20 cache->GetClients(&clients); | |
|
jkarlin
2017/03/17 15:07:03
Is a GetClientsForOriginAndEndpoint in order? Or i
Julia Tuttle
2017/03/21 18:41:03
It's only useful for testing; I'll switch to GetCl
| |
| 21 for (const ReportingClient* client : clients) { | |
| 22 if (client->origin == origin && client->endpoint == endpoint) | |
| 23 return client; | |
| 24 } | |
| 25 return nullptr; | |
| 26 } | |
| 27 | |
| 28 } // namespace net | |
| OLD | NEW |