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

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

Issue 2108873002: Don't commit the blocked URL when a frame is blocked by XFrameOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return false; 349 return false;
350 return true; 350 return true;
351 } 351 }
352 352
353 void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo nse& response) 353 void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo nse& response)
354 { 354 {
355 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, ma inResourceIdentifier(), response, m_mainResource.get()); 355 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, ma inResourceIdentifier(), response, m_mainResource.get());
356 356
357 setWasBlockedAfterXFrameOptionsOrCSP(); 357 setWasBlockedAfterXFrameOptionsOrCSP();
358 358
359 // Pretend that this was an empty HTTP 200 response. 359 // Pretend that this was an empty HTTP 200 response. Don't reuse the
360 // original URL for the empty page (https://crbug.com/622385).
361 //
362 // TODO(mkwst): Remove this once XFO moves to the browser.
363 // https://crbug.com/555418.
360 clearMainResourceHandle(); 364 clearMainResourceHandle();
361 m_response = ResourceResponse(blankURL(), "text/html", 0, nullAtom, String() ); 365 KURL blockedURL = SecurityOrigin::urlWithUniqueSecurityOrigin();
366 m_originalRequest.setURL(blockedURL);
367 m_request.setURL(blockedURL);
368 m_redirectChain.removeLast();
369 appendRedirect(blockedURL);
370 m_response = ResourceResponse(blockedURL, "text/html", 0, nullAtom, String() );
362 finishedLoading(monotonicallyIncreasingTime()); 371 finishedLoading(monotonicallyIncreasingTime());
363 372
364 return; 373 return;
365 } 374 }
366 375
367 void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse & response, PassOwnPtr<WebDataConsumerHandle> handle) 376 void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse & response, PassOwnPtr<WebDataConsumerHandle> handle)
368 { 377 {
369 ASSERT_UNUSED(resource, m_mainResource == resource); 378 ASSERT_UNUSED(resource, m_mainResource == resource);
370 ASSERT_UNUSED(handle, !handle); 379 ASSERT_UNUSED(handle, !handle);
371 ASSERT(frame()); 380 ASSERT(frame());
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 { 694 {
686 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 695 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
687 if (!source.isNull()) 696 if (!source.isNull())
688 m_writer->appendReplacingData(source); 697 m_writer->appendReplacingData(source);
689 endWriting(m_writer.get()); 698 endWriting(m_writer.get());
690 } 699 }
691 700
692 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 701 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
693 702
694 } // namespace blink 703 } // namespace blink
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698