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

Side by Side Diff: chrome/browser/safe_browsing/permission_reporter.cc

Issue 2743563006: Componentize safe_browsing [+1]: move protos to component
Patch Set: fix remaining proto references 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/safe_browsing/permission_reporter.h" 5 #include "chrome/browser/safe_browsing/permission_reporter.h"
6 6
7 #include <functional> 7 #include <functional>
8 8
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/time/default_clock.h" 11 #include "base/time/default_clock.h"
12 #include "chrome/browser/permissions/permission_request.h" 12 #include "chrome/browser/permissions/permission_request.h"
13 #include "chrome/common/safe_browsing/permission_report.pb.h" 13 #include "components/safe_browsing/common/permission_report.pb.h"
14 #include "components/variations/active_field_trials.h" 14 #include "components/variations/active_field_trials.h"
15 #include "net/url_request/report_sender.h" 15 #include "net/url_request/report_sender.h"
16 16
17 namespace safe_browsing { 17 namespace safe_browsing {
18 18
19 namespace { 19 namespace {
20 // URL to upload permission action reports. 20 // URL to upload permission action reports.
21 const char kPermissionActionReportingUploadUrl[] = 21 const char kPermissionActionReportingUploadUrl[] =
22 "https://safebrowsing.googleusercontent.com/safebrowsing/clientreport/" 22 "https://safebrowsing.googleusercontent.com/safebrowsing/clientreport/"
23 "chrome-permissions"; 23 "chrome-permissions";
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 if (log.size() < kMaximumReportsPerOriginPerPermissionPerMinute) { 218 if (log.size() < kMaximumReportsPerOriginPerPermissionPerMinute) {
219 log.push(current_time); 219 log.push(current_time);
220 return false; 220 return false;
221 } else { 221 } else {
222 return true; 222 return true;
223 } 223 }
224 } 224 }
225 225
226 } // namespace safe_browsing 226 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698