| OLD | NEW |
| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 const KURL& reportURL, | 521 const KURL& reportURL, |
| 522 PassRefPtr<EncodedFormData> report, | 522 PassRefPtr<EncodedFormData> report, |
| 523 ViolationReportType type) { | 523 ViolationReportType type) { |
| 524 ResourceRequest request(reportURL); | 524 ResourceRequest request(reportURL); |
| 525 request.setHTTPMethod(HTTPNames::POST); | 525 request.setHTTPMethod(HTTPNames::POST); |
| 526 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport | 526 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport |
| 527 ? "application/csp-report" | 527 ? "application/csp-report" |
| 528 : "application/json"); | 528 : "application/json"); |
| 529 request.setHTTPBody(std::move(report)); | 529 request.setHTTPBody(std::move(report)); |
| 530 finishPingRequestInitialization(request, frame, | 530 finishPingRequestInitialization(request, frame, |
| 531 WebURLRequest::RequestContextPing); | 531 WebURLRequest::RequestContextCSPReport); |
| 532 | 532 |
| 533 StoredCredentials credentialsAllowed = | 533 StoredCredentials credentialsAllowed = |
| 534 SecurityOrigin::create(reportURL)->isSameSchemeHostPort( | 534 SecurityOrigin::create(reportURL)->isSameSchemeHostPort( |
| 535 frame->document()->getSecurityOrigin()) | 535 frame->document()->getSecurityOrigin()) |
| 536 ? AllowStoredCredentials | 536 ? AllowStoredCredentials |
| 537 : DoNotAllowStoredCredentials; | 537 : DoNotAllowStoredCredentials; |
| 538 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport, | 538 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport, |
| 539 credentialsAllowed, false); | 539 credentialsAllowed, false); |
| 540 } | 540 } |
| 541 | 541 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 569 bool PingLoader::sendBeacon(LocalFrame* frame, | 569 bool PingLoader::sendBeacon(LocalFrame* frame, |
| 570 int allowance, | 570 int allowance, |
| 571 const KURL& beaconURL, | 571 const KURL& beaconURL, |
| 572 Blob* data, | 572 Blob* data, |
| 573 int& payloadLength) { | 573 int& payloadLength) { |
| 574 BeaconBlob beacon(data); | 574 BeaconBlob beacon(data); |
| 575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
| 576 } | 576 } |
| 577 | 577 |
| 578 } // namespace blink | 578 } // namespace blink |
| OLD | NEW |