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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |