OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/reporting/reporting_delivery_agent.h" | 5 #include "net/reporting/reporting_delivery_agent.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 if (base::ContainsKey(pending_origin_groups_, origin_group)) | 129 if (base::ContainsKey(pending_origin_groups_, origin_group)) |
130 continue; | 130 continue; |
131 | 131 |
132 GURL endpoint_url; | 132 GURL endpoint_url; |
133 if (!endpoint_manager()->FindEndpointForOriginAndGroup( | 133 if (!endpoint_manager()->FindEndpointForOriginAndGroup( |
134 origin_group.first, origin_group.second, &endpoint_url)) { | 134 origin_group.first, origin_group.second, &endpoint_url)) { |
135 continue; | 135 continue; |
136 } | 136 } |
137 | 137 |
| 138 cache()->MarkClientUsed(origin_group.first, endpoint_url); |
| 139 |
138 endpoint_reports[endpoint_url].insert( | 140 endpoint_reports[endpoint_url].insert( |
139 endpoint_reports[endpoint_url].end(), it.second.begin(), | 141 endpoint_reports[endpoint_url].end(), it.second.begin(), |
140 it.second.end()); | 142 it.second.end()); |
141 pending_origin_groups_.insert(origin_group); | 143 pending_origin_groups_.insert(origin_group); |
142 } | 144 } |
143 | 145 |
144 // Start a delivery to each endpoint. | 146 // Start a delivery to each endpoint. |
145 for (auto& it : endpoint_reports) { | 147 for (auto& it : endpoint_reports) { |
146 const GURL& endpoint = it.first; | 148 const GURL& endpoint = it.first; |
147 const std::vector<const ReportingReport*>& reports = it.second; | 149 const std::vector<const ReportingReport*>& reports = it.second; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 209 |
208 // static | 210 // static |
209 std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create( | 211 std::unique_ptr<ReportingDeliveryAgent> ReportingDeliveryAgent::Create( |
210 ReportingContext* context) { | 212 ReportingContext* context) { |
211 return base::MakeUnique<ReportingDeliveryAgentImpl>(context); | 213 return base::MakeUnique<ReportingDeliveryAgentImpl>(context); |
212 } | 214 } |
213 | 215 |
214 ReportingDeliveryAgent::~ReportingDeliveryAgent() {} | 216 ReportingDeliveryAgent::~ReportingDeliveryAgent() {} |
215 | 217 |
216 } // namespace net | 218 } // namespace net |
OLD | NEW |