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

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

Issue 553423002: CSP: Use a specified frame for reporting 'frame-ancestors' violations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback, tests, and rebase. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 frame()->document()->addConsoleMessage(consoleMessage.release()); 462 frame()->document()->addConsoleMessage(consoleMessage.release());
463 463
464 cancelLoadAfterXFrameOptionsOrCSPDenied(response); 464 cancelLoadAfterXFrameOptionsOrCSPDenied(response);
465 return; 465 return;
466 } 466 }
467 } 467 }
468 468
469 m_contentSecurityPolicy = ContentSecurityPolicy::create(); 469 m_contentSecurityPolicy = ContentSecurityPolicy::create();
470 m_contentSecurityPolicy->setOverrideURLForSelf(response.url()); 470 m_contentSecurityPolicy->setOverrideURLForSelf(response.url());
471 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponseHead ers(response)); 471 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponseHead ers(response));
472 if (!m_contentSecurityPolicy->allowAncestors(m_frame)) { 472 if (!m_contentSecurityPolicy->allowAncestors(m_frame, response.url())) {
473 cancelLoadAfterXFrameOptionsOrCSPDenied(response); 473 cancelLoadAfterXFrameOptionsOrCSPDenied(response);
474 return; 474 return;
475 } 475 }
476 476
477 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading()); 477 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading());
478 478
479 m_response = response; 479 m_response = response;
480 480
481 if (isArchiveMIMEType(m_response.mimeType()) && m_mainResource->dataBufferin gPolicy() != BufferData) 481 if (isArchiveMIMEType(m_response.mimeType()) && m_mainResource->dataBufferin gPolicy() != BufferData)
482 m_mainResource->setDataBufferingPolicy(BufferData); 482 m_mainResource->setDataBufferingPolicy(BufferData);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 829 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
830 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 830 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
831 { 831 {
832 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true); 832 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true);
833 if (!source.isNull()) 833 if (!source.isNull())
834 m_writer->appendReplacingData(source); 834 m_writer->appendReplacingData(source);
835 endWriting(m_writer.get()); 835 endWriting(m_writer.get());
836 } 836 }
837 837
838 } // namespace blink 838 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698