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

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

Issue 2264503002: Clean up SecurityOrigin handling around CrossOriginAccessControl::handleRedirect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 return; 302 return;
303 303
304 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); 304 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest());
305 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse()); 305 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse());
306 306
307 DCHECK(!newRequest.isNull()); 307 DCHECK(!newRequest.isNull());
308 DCHECK(!redirectResponse.isNull()); 308 DCHECK(!redirectResponse.isNull());
309 309
310 String errorDescription; 310 String errorDescription;
311 ResourceLoaderOptions options; 311 ResourceLoaderOptions options;
312 // TODO(tyoshino): Save updated data in options.securityOrigin and pass it
313 // on the next time.
312 if (!CrossOriginAccessControl::handleRedirect(m_origin.get(), newRequest, re directResponse, AllowStoredCredentials, options, errorDescription)) { 314 if (!CrossOriginAccessControl::handleRedirect(m_origin.get(), newRequest, re directResponse, AllowStoredCredentials, options, errorDescription)) {
313 if (LocalFrame* localFrame = frame()) { 315 if (LocalFrame* localFrame = frame()) {
314 if (localFrame->document()) 316 if (localFrame->document())
315 localFrame->document()->addConsoleMessage(ConsoleMessage::create (JSMessageSource, ErrorMessageLevel, errorDescription)); 317 localFrame->document()->addConsoleMessage(ConsoleMessage::create (JSMessageSource, ErrorMessageLevel, errorDescription));
316 } 318 }
317 // Cancel the load and self destruct. 319 // Cancel the load and self destruct.
318 dispose(); 320 dispose();
319 // Signal WebURLLoader that the redirect musn't be followed. 321 // Signal WebURLLoader that the redirect musn't be followed.
320 passedNewRequest = WebURLRequest(); 322 passedNewRequest = WebURLRequest();
321 return; 323 return;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 496 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
495 } 497 }
496 498
497 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)
498 { 500 {
499 BeaconBlob beacon(data); 501 BeaconBlob beacon(data);
500 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 502 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
501 } 503 }
502 504
503 } // namespace blink 505 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/platform/exported/WebURLRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698