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

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

Issue 419203004: DevTools: wrapping arguments addConsoleMessage in ConsoleMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@wrap-not-all-console-args
Patch Set: Created 6 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
« no previous file with comments | « Source/core/html/parser/XSSAuditorDelegate.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('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) 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "core/loader/FrameLoader.h" 43 #include "core/loader/FrameLoader.h"
44 #include "core/loader/FrameLoaderClient.h" 44 #include "core/loader/FrameLoaderClient.h"
45 #include "core/loader/UniqueIdentifier.h" 45 #include "core/loader/UniqueIdentifier.h"
46 #include "core/loader/appcache/ApplicationCacheHost.h" 46 #include "core/loader/appcache/ApplicationCacheHost.h"
47 #include "core/frame/LocalDOMWindow.h" 47 #include "core/frame/LocalDOMWindow.h"
48 #include "core/frame/LocalFrame.h" 48 #include "core/frame/LocalFrame.h"
49 #include "core/frame/csp/ContentSecurityPolicy.h" 49 #include "core/frame/csp/ContentSecurityPolicy.h"
50 #include "core/page/FrameTree.h" 50 #include "core/page/FrameTree.h"
51 #include "core/page/Page.h" 51 #include "core/page/Page.h"
52 #include "core/frame/Settings.h" 52 #include "core/frame/Settings.h"
53 #include "core/inspector/ConsoleMessage.h"
53 #include "platform/Logging.h" 54 #include "platform/Logging.h"
54 #include "platform/UserGestureIndicator.h" 55 #include "platform/UserGestureIndicator.h"
55 #include "platform/mhtml/ArchiveResource.h" 56 #include "platform/mhtml/ArchiveResource.h"
56 #include "platform/mhtml/ArchiveResourceCollection.h" 57 #include "platform/mhtml/ArchiveResourceCollection.h"
57 #include "platform/mhtml/MHTMLArchive.h" 58 #include "platform/mhtml/MHTMLArchive.h"
58 #include "platform/plugins/PluginData.h" 59 #include "platform/plugins/PluginData.h"
59 #include "platform/weborigin/SchemeRegistry.h" 60 #include "platform/weborigin/SchemeRegistry.h"
60 #include "platform/weborigin/SecurityPolicy.h" 61 #include "platform/weborigin/SecurityPolicy.h"
61 #include "public/platform/Platform.h" 62 #include "public/platform/Platform.h"
62 #include "public/platform/WebMimeRegistry.h" 63 #include "public/platform/WebMimeRegistry.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", At omicString::ConstructFromLiteral)); 447 DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", At omicString::ConstructFromLiteral));
447 HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(xFrameOp tionHeader); 448 HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(xFrameOp tionHeader);
448 if (it != response.httpHeaderFields().end()) { 449 if (it != response.httpHeaderFields().end()) {
449 String content = it->value; 450 String content = it->value;
450 ASSERT(m_mainResource); 451 ASSERT(m_mainResource);
451 unsigned long identifier = mainResourceIdentifier(); 452 unsigned long identifier = mainResourceIdentifier();
452 ASSERT(identifier); 453 ASSERT(identifier);
453 if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response .url(), identifier)) { 454 if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response .url(), identifier)) {
454 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, identifier, response); 455 InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, this, identifier, response);
455 String message = "Refused to display '" + response.url().elidedStrin g() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; 456 String message = "Refused to display '" + response.url().elidedStrin g() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";
456 frame()->document()->addConsoleMessageWithRequestIdentifier(Security MessageSource, ErrorMessageLevel, message, identifier); 457 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(Secur ityMessageSource, ErrorMessageLevel, message);
458 consoleMessage->setRequestIdentifier(identifier);
459 frame()->document()->addMessage(consoleMessage.release());
457 frame()->document()->enforceSandboxFlags(SandboxOrigin); 460 frame()->document()->enforceSandboxFlags(SandboxOrigin);
458 if (FrameOwner* owner = frame()->owner()) 461 if (FrameOwner* owner = frame()->owner())
459 owner->dispatchLoad(); 462 owner->dispatchLoad();
460 463
461 // The load event might have detached this frame. In that case, the load will already have been cancelled during detach. 464 // The load event might have detached this frame. In that case, the load will already have been cancelled during detach.
462 if (frameLoader()) 465 if (frameLoader())
463 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u rl())); 466 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u rl()));
464 return; 467 return;
465 } 468 }
466 } 469 }
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 832 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
830 { 833 {
831 m_frame->loader().stopAllLoaders(); 834 m_frame->loader().stopAllLoaders();
832 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true); 835 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true);
833 if (!source.isNull()) 836 if (!source.isNull())
834 m_writer->appendReplacingData(source); 837 m_writer->appendReplacingData(source);
835 endWriting(m_writer.get()); 838 endWriting(m_writer.get());
836 } 839 }
837 840
838 } // namespace blink 841 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/parser/XSSAuditorDelegate.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698