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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return false; | 355 return false; |
356 return true; | 356 return true; |
357 } | 357 } |
358 | 358 |
359 void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo
nse& response) | 359 void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo
nse& response) |
360 { | 360 { |
361 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, ma
inResourceIdentifier(), response, m_mainResource.get()); | 361 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, ma
inResourceIdentifier(), response, m_mainResource.get()); |
362 | 362 |
363 setWasBlockedAfterXFrameOptionsOrCSP(); | 363 setWasBlockedAfterXFrameOptionsOrCSP(); |
364 | 364 |
365 // Pretend that this was an empty HTTP 200 response. | 365 // Pretend that this was an empty HTTP 200 response. Don't reuse the |
| 366 // original URL for the empty page (https://crbug.com/622385). |
| 367 // |
| 368 // TODO(mkwst): Remove this once XFO moves to the browser. |
| 369 // https://crbug.com/555418. |
366 clearMainResourceHandle(); | 370 clearMainResourceHandle(); |
367 m_response = ResourceResponse(blankURL(), "text/html", 0, nullAtom, String()
); | 371 KURL blockedURL = SecurityOrigin::urlWithUniqueSecurityOrigin(); |
| 372 m_originalRequest.setURL(blockedURL); |
| 373 m_request.setURL(blockedURL); |
| 374 m_redirectChain.removeLast(); |
| 375 appendRedirect(blockedURL); |
| 376 m_response = ResourceResponse(blockedURL, "text/html", 0, nullAtom, String()
); |
368 finishedLoading(monotonicallyIncreasingTime()); | 377 finishedLoading(monotonicallyIncreasingTime()); |
369 | 378 |
370 return; | 379 return; |
371 } | 380 } |
372 | 381 |
373 void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
& response, PassOwnPtr<WebDataConsumerHandle> handle) | 382 void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
& response, PassOwnPtr<WebDataConsumerHandle> handle) |
374 { | 383 { |
375 ASSERT_UNUSED(resource, m_mainResource == resource); | 384 ASSERT_UNUSED(resource, m_mainResource == resource); |
376 ASSERT_UNUSED(handle, !handle); | 385 ASSERT_UNUSED(handle, !handle); |
377 ASSERT(frame()); | 386 ASSERT(frame()); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 { | 711 { |
703 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); | 712 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); |
704 if (!source.isNull()) | 713 if (!source.isNull()) |
705 m_writer->appendReplacingData(source); | 714 m_writer->appendReplacingData(source); |
706 endWriting(m_writer.get()); | 715 endWriting(m_writer.get()); |
707 } | 716 } |
708 | 717 |
709 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 718 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
710 | 719 |
711 } // namespace blink | 720 } // namespace blink |
OLD | NEW |