OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 369 } |
370 timing()->addRedirect(redirectResponse.url(), newRequest.url()); | 370 timing()->addRedirect(redirectResponse.url(), newRequest.url()); |
371 } | 371 } |
372 | 372 |
373 // If we're fielding a redirect in response to a POST, force a load from ori
gin, since | 373 // If we're fielding a redirect in response to a POST, force a load from ori
gin, since |
374 // this is a common site technique to return to a page viewing some data tha
t the POST | 374 // this is a common site technique to return to a page viewing some data tha
t the POST |
375 // just modified. | 375 // just modified. |
376 if (newRequest.cachePolicy() == UseProtocolCachePolicy && isRedirectAfterPos
t(newRequest, redirectResponse)) | 376 if (newRequest.cachePolicy() == UseProtocolCachePolicy && isRedirectAfterPos
t(newRequest, redirectResponse)) |
377 newRequest.setCachePolicy(ReloadBypassingCache); | 377 newRequest.setCachePolicy(ReloadBypassingCache); |
378 | 378 |
379 // If this is a sub-frame, check for mixed content blocking against the pare
nt frame. | |
380 if (Frame* parent = m_frame->tree().parent()) { | |
381 if (parent->isLocalFrame() && !toLocalFrame(parent)->loader().mixedConte
ntChecker()->canFrameInsecureContent(toLocalFrame(parent)->document()->securityO
rigin(), newRequest.url())) { | |
382 cancelMainResourceLoad(ResourceError::cancelledError(newRequest.url(
))); | |
383 return; | |
384 } | |
385 } | |
386 | |
387 m_request = newRequest; | 379 m_request = newRequest; |
388 | 380 |
389 if (redirectResponse.isNull()) | 381 if (redirectResponse.isNull()) |
390 return; | 382 return; |
391 | 383 |
392 appendRedirect(newRequest.url()); | 384 appendRedirect(newRequest.url()); |
393 frameLoader()->client()->dispatchDidReceiveServerRedirectForProvisionalLoad(
); | 385 frameLoader()->client()->dispatchDidReceiveServerRedirectForProvisionalLoad(
); |
394 if (!shouldContinueForNavigationPolicy(newRequest, CheckContentSecurityPolic
y)) | 386 if (!shouldContinueForNavigationPolicy(newRequest, CheckContentSecurityPolic
y)) |
395 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); | 387 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); |
396 } | 388 } |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() | 815 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() |
824 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) | 816 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) |
825 { | 817 { |
826 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true); | 818 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true); |
827 if (!source.isNull()) | 819 if (!source.isNull()) |
828 m_writer->appendReplacingData(source); | 820 m_writer->appendReplacingData(source); |
829 endWriting(m_writer.get()); | 821 endWriting(m_writer.get()); |
830 } | 822 } |
831 | 823 |
832 } // namespace blink | 824 } // namespace blink |
OLD | NEW |