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

Unified Diff: net/reporting/reporting_test_util.cc

Issue 2708503002: Reporting: Implement cache. (Closed)
Patch Set: Make requested changes. 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
« net/reporting/reporting_cache.h ('K') | « net/reporting/reporting_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5f59c449953353e774df7d718c3a31caf85dae9a
--- /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 "net/reporting/reporting_cache.h"
+#include "net/reporting/reporting_client.h"
+#include "url/gurl.h"
+#include "url/origin.h"
+
+namespace net {
+
+const ReportingClient* FindClientInCache(const ReportingCache* cache,
+ const url::Origin& origin,
+ const GURL& endpoint) {
+ std::vector<const ReportingClient*> clients;
+ cache->GetClients(&clients);
+ for (const ReportingClient* client : clients) {
+ if (client->origin == origin && client->endpoint == endpoint)
+ return client;
+ }
+ return nullptr;
+}
+
+} // namespace net
« net/reporting/reporting_cache.h ('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