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

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: 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
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 frame()->document()->addMessage(consoleMessage.release()); 470 frame()->document()->addMessage(consoleMessage.release());
471 471
472 cancelLoadAfterXFrameOptionsOrCSPDenied(response); 472 cancelLoadAfterXFrameOptionsOrCSPDenied(response);
473 return; 473 return;
474 } 474 }
475 } 475 }
476 476
477 m_contentSecurityPolicy = ContentSecurityPolicy::create(); 477 m_contentSecurityPolicy = ContentSecurityPolicy::create();
478 m_contentSecurityPolicy->setOverrideURLForSelf(response.url()); 478 m_contentSecurityPolicy->setOverrideURLForSelf(response.url());
479 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponseHead ers(response)); 479 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponseHead ers(response));
480 if (!m_contentSecurityPolicy->allowAncestors(m_frame)) { 480 if (!m_contentSecurityPolicy->allowAncestors(m_frame, response.url())) {
481 cancelLoadAfterXFrameOptionsOrCSPDenied(response); 481 cancelLoadAfterXFrameOptionsOrCSPDenied(response);
482 return; 482 return;
483 } 483 }
484 484
485 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading()); 485 ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading());
486 486
487 m_response = response; 487 m_response = response;
488 488
489 if (isArchiveMIMEType(m_response.mimeType()) && m_mainResource->dataBufferin gPolicy() != BufferData) 489 if (isArchiveMIMEType(m_response.mimeType()) && m_mainResource->dataBufferin gPolicy() != BufferData)
490 m_mainResource->setDataBufferingPolicy(BufferData); 490 m_mainResource->setDataBufferingPolicy(BufferData);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 837 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
838 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 838 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
839 { 839 {
840 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true); 840 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true);
841 if (!source.isNull()) 841 if (!source.isNull())
842 m_writer->appendReplacingData(source); 842 m_writer->appendReplacingData(source);
843 endWriting(m_writer.get()); 843 endWriting(m_writer.get());
844 } 844 }
845 845
846 } // namespace blink 846 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698