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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/script_request_incident.cc

Issue 845663004: Initial script request detector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-review cleanup Created 5 years, 11 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
(Empty)
1 // Copyright 2015 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 "chrome/browser/safe_browsing/incident_reporting/script_request_inciden t.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/safe_browsing/incident_reporting/incident_handler_util. h"
9 #include "chrome/common/safe_browsing/csd.pb.h"
10
11 namespace safe_browsing {
12
13 ScriptRequestIncident::ScriptRequestIncident(
14 scoped_ptr<ClientIncidentReport_IncidentData_ScriptRequestIncident>
15 script_request_incident) {
16 DCHECK(script_request_incident);
17 DCHECK(script_request_incident->has_script_hash());
18 // TODO(robertshield): Add inclusion of host domain.
19 payload()->set_allocated_script_request(script_request_incident.release());
20 }
21
22 ScriptRequestIncident::~ScriptRequestIncident() {
23 }
24
25 IncidentType ScriptRequestIncident::GetType() const {
26 return IncidentType::SCRIPT_REQUEST;
27 }
28
29 // Returns the sanitized path of the module.
grt (UTC plus 2) 2015/01/28 14:49:05 stale comment
robertshield 2015/01/28 22:20:33 Done.
30 std::string ScriptRequestIncident::GetKey() const {
31 return payload()->script_request().script_hash();
32 }
33
34 // Returns a digest computed over the payload.
35 uint32_t ScriptRequestIncident::ComputeDigest() const {
36 return HashMessage(payload()->script_request());
37 }
38
39 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698