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

Side by Side Diff: third_party/WebKit/Source/core/loader/PingLoader.cpp

Issue 2694833003: Revert of Tag CSP violation reports as CSP reports, not as ping (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « extensions/common/api/web_request.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 const KURL& reportURL, 503 const KURL& reportURL,
504 PassRefPtr<EncodedFormData> report, 504 PassRefPtr<EncodedFormData> report,
505 ViolationReportType type) { 505 ViolationReportType type) {
506 ResourceRequest request(reportURL); 506 ResourceRequest request(reportURL);
507 request.setHTTPMethod(HTTPNames::POST); 507 request.setHTTPMethod(HTTPNames::POST);
508 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport 508 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport
509 ? "application/csp-report" 509 ? "application/csp-report"
510 : "application/json"); 510 : "application/json");
511 request.setHTTPBody(std::move(report)); 511 request.setHTTPBody(std::move(report));
512 finishPingRequestInitialization(request, frame, 512 finishPingRequestInitialization(request, frame,
513 WebURLRequest::RequestContextCSPReport); 513 WebURLRequest::RequestContextPing);
514 514
515 StoredCredentials credentialsAllowed = 515 StoredCredentials credentialsAllowed =
516 SecurityOrigin::create(reportURL)->isSameSchemeHostPort( 516 SecurityOrigin::create(reportURL)->isSameSchemeHostPort(
517 frame->document()->getSecurityOrigin()) 517 frame->document()->getSecurityOrigin())
518 ? AllowStoredCredentials 518 ? AllowStoredCredentials
519 : DoNotAllowStoredCredentials; 519 : DoNotAllowStoredCredentials;
520 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport, 520 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport,
521 credentialsAllowed, false); 521 credentialsAllowed, false);
522 } 522 }
523 523
(...skipping 27 matching lines...) Expand all
551 bool PingLoader::sendBeacon(LocalFrame* frame, 551 bool PingLoader::sendBeacon(LocalFrame* frame,
552 int allowance, 552 int allowance,
553 const KURL& beaconURL, 553 const KURL& beaconURL,
554 Blob* data, 554 Blob* data,
555 int& payloadLength) { 555 int& payloadLength) {
556 BeaconBlob beacon(data); 556 BeaconBlob beacon(data);
557 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 557 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
558 } 558 }
559 559
560 } // namespace blink 560 } // namespace blink
OLDNEW
« no previous file with comments | « extensions/common/api/web_request.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698