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

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

Issue 2282413002: Replaced PassRefPtr copies with moves in Source/core. (Closed)
Patch Set: rebased Created 4 years, 3 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 /* 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 request.setHTTPHeaderField(HTTPNames::Ping_From, AtomicString(frame->doc ument()->url().getString())); 464 request.setHTTPHeaderField(HTTPNames::Ping_From, AtomicString(frame->doc ument()->url().getString()));
465 465
466 sendPingCommon(frame, request, FetchInitiatorTypeNames::ping, AllowStoredCre dentials, false); 466 sendPingCommon(frame, request, FetchInitiatorTypeNames::ping, AllowStoredCre dentials, false);
467 } 467 }
468 468
469 void PingLoader::sendViolationReport(LocalFrame* frame, const KURL& reportURL, P assRefPtr<EncodedFormData> report, ViolationReportType type) 469 void PingLoader::sendViolationReport(LocalFrame* frame, const KURL& reportURL, P assRefPtr<EncodedFormData> report, ViolationReportType type)
470 { 470 {
471 ResourceRequest request(reportURL); 471 ResourceRequest request(reportURL);
472 request.setHTTPMethod(HTTPNames::POST); 472 request.setHTTPMethod(HTTPNames::POST);
473 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport ? "a pplication/csp-report" : "application/json"); 473 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport ? "a pplication/csp-report" : "application/json");
474 request.setHTTPBody(report); 474 request.setHTTPBody(std::move(report));
475 finishPingRequestInitialization(request, frame, WebURLRequest::RequestContex tPing); 475 finishPingRequestInitialization(request, frame, WebURLRequest::RequestContex tPing);
476 476
477 StoredCredentials credentialsAllowed = SecurityOrigin::create(reportURL)->is SameSchemeHostPort(frame->document()->getSecurityOrigin()) ? AllowStoredCredenti als : DoNotAllowStoredCredentials; 477 StoredCredentials credentialsAllowed = SecurityOrigin::create(reportURL)->is SameSchemeHostPort(frame->document()->getSecurityOrigin()) ? AllowStoredCredenti als : DoNotAllowStoredCredentials;
478 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport, cre dentialsAllowed, false); 478 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport, cre dentialsAllowed, false);
479 } 479 }
480 480
481 bool PingLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beacon URL, const String& data, int& payloadLength) 481 bool PingLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beacon URL, const String& data, int& payloadLength)
482 { 482 {
483 BeaconString beacon(data); 483 BeaconString beacon(data);
484 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 484 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
(...skipping 11 matching lines...) Expand all
496 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 496 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
497 } 497 }
498 498
499 bool PingLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beacon URL, Blob* data, int& payloadLength) 499 bool PingLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beacon URL, Blob* data, int& payloadLength)
500 { 500 {
501 BeaconBlob beacon(data); 501 BeaconBlob beacon(data);
502 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 502 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
503 } 503 }
504 504
505 } // namespace blink 505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698