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