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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 if (frameLoader()->isLoadingMainFrame()) | 472 if (frameLoader()->isLoadingMainFrame()) |
473 newRequest.setFirstPartyForCookies(newRequest.url()); | 473 newRequest.setFirstPartyForCookies(newRequest.url()); |
474 | 474 |
475 // If we're fielding a redirect in response to a POST, force a load from ori
gin, since | 475 // If we're fielding a redirect in response to a POST, force a load from ori
gin, since |
476 // this is a common site technique to return to a page viewing some data tha
t the POST | 476 // this is a common site technique to return to a page viewing some data tha
t the POST |
477 // just modified. | 477 // just modified. |
478 // Also, POST requests always load from origin, but this does not affect sub
resources. | 478 // Also, POST requests always load from origin, but this does not affect sub
resources. |
479 if (newRequest.cachePolicy() == UseProtocolCachePolicy && isPostOrRedirectAf
terPost(newRequest, redirectResponse)) | 479 if (newRequest.cachePolicy() == UseProtocolCachePolicy && isPostOrRedirectAf
terPost(newRequest, redirectResponse)) |
480 newRequest.setCachePolicy(ReloadIgnoringCacheData); | 480 newRequest.setCachePolicy(ReloadIgnoringCacheData); |
481 | 481 |
482 Frame* top = m_frame->tree()->top(); | 482 Frame* parent = m_frame->tree()->parent(); |
483 if (top) { | 483 if (parent) { |
484 if (!top->loader()->mixedContentChecker()->canDisplayInsecureContent(top
->document()->securityOrigin(), newRequest.url())) { | 484 if (!parent->loader()->mixedContentChecker()->canRunInsecureContent(pare
nt->document()->securityOrigin(), newRequest.url())) { |
485 cancelMainResourceLoad(ResourceError::cancelledError(newRequest.url(
))); | 485 cancelMainResourceLoad(ResourceError::cancelledError(newRequest.url(
))); |
486 return; | 486 return; |
487 } | 487 } |
488 } | 488 } |
489 | 489 |
490 setRequest(newRequest); | 490 setRequest(newRequest); |
491 | 491 |
492 if (redirectResponse.isNull()) | 492 if (redirectResponse.isNull()) |
493 return; | 493 return; |
494 | 494 |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 1073 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
1074 { | 1074 { |
1075 m_frame->loader()->stopAllLoaders(); | 1075 m_frame->loader()->stopAllLoaders(); |
1076 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); | 1076 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); |
1077 if (!source.isNull()) | 1077 if (!source.isNull()) |
1078 m_writer->appendReplacingData(source); | 1078 m_writer->appendReplacingData(source); |
1079 endWriting(m_writer.get()); | 1079 endWriting(m_writer.get()); |
1080 } | 1080 } |
1081 | 1081 |
1082 } // namespace WebCore | 1082 } // namespace WebCore |
OLD | NEW |