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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: net/reporting/reporting_test_util.cc
diff --git a/net/reporting/reporting_test_util.cc b/net/reporting/reporting_test_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c9b53840ab377692c23332673e8b1e17349e2b7c
--- /dev/null
+++ b/net/reporting/reporting_test_util.cc
@@ -0,0 +1,28 @@
+// Copyright 2017 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 "net/reporting/reporting_test_util.h"
+
+#include <vector>
+
+#include "url/gurl.h"
+#include "url/origin.h"
+
+namespace net {
+
+using Client = ReportingCache::Client;
+
+const Client* FindClientInCache(const ReportingCache* cache,
+ const url::Origin& origin,
+ const GURL& endpoint) {
+ std::vector<const Client*> clients;
+ cache->GetClients(&clients);
+ for (const Client* client : clients) {
+ if (client->origin == origin && client->endpoint == endpoint)
+ return client;
+ }
+ return nullptr;
+}
+
+} // namespace net
« 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