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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 20890003: Limit console messages' automatic collection of parser state. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline "fast/frames/sandboxed-iframe-autofocus-denied.html" Created 7 years, 4 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/dom/Document.h ('k') | Source/core/dom/ScriptExecutionContext.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2671 double delay; 2671 double delay;
2672 String refreshUrl; 2672 String refreshUrl;
2673 if (parseHTTPRefresh(content, true, delay, refreshUrl)) { 2673 if (parseHTTPRefresh(content, true, delay, refreshUrl)) {
2674 if (refreshUrl.isEmpty()) 2674 if (refreshUrl.isEmpty())
2675 refreshUrl = m_url.string(); 2675 refreshUrl = m_url.string();
2676 else 2676 else
2677 refreshUrl = completeURL(refreshUrl).string(); 2677 refreshUrl = completeURL(refreshUrl).string();
2678 2678
2679 if (protocolIsJavaScript(refreshUrl)) { 2679 if (protocolIsJavaScript(refreshUrl)) {
2680 String message = "Refused to refresh " + m_url.elidedString() + " to a javascript: URL"; 2680 String message = "Refused to refresh " + m_url.elidedString() + " to a javascript: URL";
2681 addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message) ; 2681 addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, 0, ForceParserStateCollection);
2682 return; 2682 return;
2683 } 2683 }
2684 2684
2685 if (isSandboxed(SandboxAutomaticFeatures)) { 2685 if (isSandboxed(SandboxAutomaticFeatures)) {
2686 String message = "Refused to execute the redirect specified via '<me ta http-equiv='refresh' content='...'>'. The document is sandboxed, and the 'all ow-scripts' keyword is not set."; 2686 String message = "Refused to execute the redirect specified via '<me ta http-equiv='refresh' content='...'>'. The document is sandboxed, and the 'all ow-scripts' keyword is not set.";
2687 addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message) ; 2687 addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, 0, ForceParserStateCollection);
2688 return; 2688 return;
2689 } 2689 }
2690 2690
2691 frame->navigationScheduler()->scheduleRedirect(delay, refreshUrl); 2691 frame->navigationScheduler()->scheduleRedirect(delay, refreshUrl);
2692 } 2692 }
2693 } 2693 }
2694 2694
2695 void Document::processHttpEquivSetCookie(const String& content) 2695 void Document::processHttpEquivSetCookie(const String& content)
2696 { 2696 {
2697 // FIXME: make setCookie work on XML documents too; e.g. in case of <html:me ta .....> 2697 // FIXME: make setCookie work on XML documents too; e.g. in case of <html:me ta .....>
(...skipping 12 matching lines...) Expand all
2710 2710
2711 FrameLoader* frameLoader = frame->loader(); 2711 FrameLoader* frameLoader = frame->loader();
2712 unsigned long requestIdentifier = loader()->mainResourceIdentifier(); 2712 unsigned long requestIdentifier = loader()->mainResourceIdentifier();
2713 if (frameLoader->shouldInterruptLoadForXFrameOptions(content, url(), request Identifier)) { 2713 if (frameLoader->shouldInterruptLoadForXFrameOptions(content, url(), request Identifier)) {
2714 String message = "Refused to display '" + url().elidedString() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; 2714 String message = "Refused to display '" + url().elidedString() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";
2715 frameLoader->stopAllLoaders(); 2715 frameLoader->stopAllLoaders();
2716 // Stopping the loader isn't enough, as we're already parsing the docume nt; to honor the header's 2716 // Stopping the loader isn't enough, as we're already parsing the docume nt; to honor the header's
2717 // intent, we must navigate away from the possibly partially-rendered do cument to a location that 2717 // intent, we must navigate away from the possibly partially-rendered do cument to a location that
2718 // doesn't inherit the parent's SecurityOrigin. 2718 // doesn't inherit the parent's SecurityOrigin.
2719 frame->navigationScheduler()->scheduleLocationChange(securityOrigin(), S ecurityOrigin::urlWithUniqueSecurityOrigin(), String()); 2719 frame->navigationScheduler()->scheduleLocationChange(securityOrigin(), S ecurityOrigin::urlWithUniqueSecurityOrigin(), String());
2720 addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, req uestIdentifier); 2720 addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, req uestIdentifier, ForceParserStateCollection);
2721 } 2721 }
2722 } 2722 }
2723 2723
2724 // Though isspace() considers \t and \v to be whitespace, Win IE doesn't. 2724 // Though isspace() considers \t and \v to be whitespace, Win IE doesn't.
2725 static bool isSeparator(UChar c) 2725 static bool isSeparator(UChar c)
2726 { 2726 {
2727 return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == ' ,' || c == '\0'; 2727 return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == ' ,' || c == '\0';
2728 } 2728 }
2729 2729
2730 void Document::processArguments(const String& features, void* data, ArgumentsCal lback callback) 2730 void Document::processArguments(const String& features, void* data, ArgumentsCal lback callback)
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after
4401 { 4401 {
4402 if (equalIgnoringCase(dnsPrefetchControl, "on") && !m_haveExplicitlyDisabled DNSPrefetch) { 4402 if (equalIgnoringCase(dnsPrefetchControl, "on") && !m_haveExplicitlyDisabled DNSPrefetch) {
4403 m_isDNSPrefetchEnabled = true; 4403 m_isDNSPrefetchEnabled = true;
4404 return; 4404 return;
4405 } 4405 }
4406 4406
4407 m_isDNSPrefetchEnabled = false; 4407 m_isDNSPrefetchEnabled = false;
4408 m_haveExplicitlyDisabledDNSPrefetch = true; 4408 m_haveExplicitlyDisabledDNSPrefetch = true;
4409 } 4409 }
4410 4410
4411 void Document::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier) 4411 void Document::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier, ParserStateCollectionDisposit ion parserStateDisposition)
4412 { 4412 {
4413 if (!isContextThread()) { 4413 if (!isContextThread()) {
4414 postTask(AddConsoleMessageTask::create(source, level, message)); 4414 postTask(AddConsoleMessageTask::create(source, level, message));
4415 return; 4415 return;
4416 } 4416 }
4417 4417
4418 if (Page* page = this->page()) 4418 if (Page* page = this->page())
4419 page->console()->addMessage(source, level, message, requestIdentifier, t his); 4419 page->console()->addMessage(source, level, message, requestIdentifier, t his, parserStateDisposition);
4420 } 4420 }
4421 4421
4422 void Document::addMessage(MessageSource source, MessageLevel level, const String & message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt ack> callStack, ScriptState* state, unsigned long requestIdentifier) 4422 void Document::addMessage(MessageSource source, MessageLevel level, const String & message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt ack> callStack, ScriptState* state, unsigned long requestIdentifier)
4423 { 4423 {
4424 if (!isContextThread()) { 4424 if (!isContextThread()) {
4425 postTask(AddConsoleMessageTask::create(source, level, message)); 4425 postTask(AddConsoleMessageTask::create(source, level, message));
4426 return; 4426 return;
4427 } 4427 }
4428 4428
4429 if (Page* page = this->page()) 4429 if (Page* page = this->page())
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
5087 { 5087 {
5088 return DocumentLifecycleNotifier::create(this); 5088 return DocumentLifecycleNotifier::create(this);
5089 } 5089 }
5090 5090
5091 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5091 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5092 { 5092 {
5093 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5093 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5094 } 5094 }
5095 5095
5096 } // namespace WebCore 5096 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/ScriptExecutionContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698