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

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

Issue 376213002: DevTools: Make FrameConsole methods accept ConsoleMessage objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scriptFailedToParse
Patch Set: Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "core/fetch/ResourceLoader.h" 50 #include "core/fetch/ResourceLoader.h"
51 #include "core/frame/LocalDOMWindow.h" 51 #include "core/frame/LocalDOMWindow.h"
52 #include "core/frame/FrameHost.h" 52 #include "core/frame/FrameHost.h"
53 #include "core/frame/FrameView.h" 53 #include "core/frame/FrameView.h"
54 #include "core/frame/LocalFrame.h" 54 #include "core/frame/LocalFrame.h"
55 #include "core/frame/PinchViewport.h" 55 #include "core/frame/PinchViewport.h"
56 #include "core/frame/csp/ContentSecurityPolicy.h" 56 #include "core/frame/csp/ContentSecurityPolicy.h"
57 #include "core/html/HTMLFormElement.h" 57 #include "core/html/HTMLFormElement.h"
58 #include "core/html/HTMLFrameOwnerElement.h" 58 #include "core/html/HTMLFrameOwnerElement.h"
59 #include "core/html/parser/HTMLParserIdioms.h" 59 #include "core/html/parser/HTMLParserIdioms.h"
60 #include "core/inspector/ConsoleMessage.h"
60 #include "core/inspector/InspectorController.h" 61 #include "core/inspector/InspectorController.h"
61 #include "core/inspector/InspectorInstrumentation.h" 62 #include "core/inspector/InspectorInstrumentation.h"
62 #include "core/loader/DocumentLoadTiming.h" 63 #include "core/loader/DocumentLoadTiming.h"
63 #include "core/loader/DocumentLoader.h" 64 #include "core/loader/DocumentLoader.h"
64 #include "core/loader/FormState.h" 65 #include "core/loader/FormState.h"
65 #include "core/loader/FormSubmission.h" 66 #include "core/loader/FormSubmission.h"
66 #include "core/loader/FrameFetchContext.h" 67 #include "core/loader/FrameFetchContext.h"
67 #include "core/loader/FrameLoadRequest.h" 68 #include "core/loader/FrameLoadRequest.h"
68 #include "core/loader/FrameLoaderClient.h" 69 #include "core/loader/FrameLoaderClient.h"
69 #include "core/loader/ProgressTracker.h" 70 #include "core/loader/ProgressTracker.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 CString encodedSrcdoc = srcdoc.utf8(); 761 CString encodedSrcdoc = srcdoc.utf8();
761 return SubstituteData(SharedBuffer::create(encodedSrcdoc.data(), encodedSrcd oc.length()), "text/html", "UTF-8", KURL()); 762 return SubstituteData(SharedBuffer::create(encodedSrcdoc.data(), encodedSrcd oc.length()), "text/html", "UTF-8", KURL());
762 } 763 }
763 764
764 void FrameLoader::reportLocalLoadFailed(LocalFrame* frame, const String& url) 765 void FrameLoader::reportLocalLoadFailed(LocalFrame* frame, const String& url)
765 { 766 {
766 ASSERT(!url.isEmpty()); 767 ASSERT(!url.isEmpty());
767 if (!frame) 768 if (!frame)
768 return; 769 return;
769 770
770 frame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLeve l, "Not allowed to load local resource: " + url); 771 frame->document()->addConsoleMessage(ConsoleMessage::create(SecurityMessageS ource, ErrorMessageLevel, "Not allowed to load local resource: " + url));
771 } 772 }
772 773
773 // static 774 // static
774 ResourceRequest FrameLoader::requestFromHistoryItem(HistoryItem* item, ResourceR equestCachePolicy cachePolicy) 775 ResourceRequest FrameLoader::requestFromHistoryItem(HistoryItem* item, ResourceR equestCachePolicy cachePolicy)
775 { 776 {
776 RefPtr<FormData> formData = item->formData(); 777 RefPtr<FormData> formData = item->formData();
777 ResourceRequest request(item->url(), item->referrer()); 778 ResourceRequest request(item->url(), item->referrer());
778 request.setCachePolicy(cachePolicy); 779 request.setCachePolicy(cachePolicy);
779 if (formData) { 780 if (formData) {
780 request.setHTTPMethod("POST"); 781 request.setHTTPMethod("POST");
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 break; 1357 break;
1357 } 1358 }
1358 } 1359 }
1359 return false; 1360 return false;
1360 } 1361 }
1361 case XFrameOptionsDeny: 1362 case XFrameOptionsDeny:
1362 return true; 1363 return true;
1363 case XFrameOptionsAllowAll: 1364 case XFrameOptionsAllowAll:
1364 return false; 1365 return false;
1365 case XFrameOptionsConflict: 1366 case XFrameOptionsConflict:
1366 m_frame->document()->addConsoleMessageWithRequestIdentifier(JSMessageSou rce, ErrorMessageLevel, "Multiple 'X-Frame-Options' headers with conflicting val ues ('" + content + "') encountered when loading '" + url.elidedString() + "'. F alling back to 'DENY'.", requestIdentifier); 1367 m_frame->document()->addConsoleMessageWithRequestIdentifier(ConsoleMessa ge::create(JSMessageSource, ErrorMessageLevel, "Multiple 'X-Frame-Options' heade rs with conflicting values ('" + content + "') encountered when loading '" + url .elidedString() + "'. Falling back to 'DENY'.", requestIdentifier));
1367 return true; 1368 return true;
1368 case XFrameOptionsInvalid: 1369 case XFrameOptionsInvalid:
1369 m_frame->document()->addConsoleMessageWithRequestIdentifier(JSMessageSou rce, ErrorMessageLevel, "Invalid 'X-Frame-Options' header encountered when loadi ng '" + url.elidedString() + "': '" + content + "' is not a recognized directive . The header will be ignored.", requestIdentifier); 1370 m_frame->document()->addConsoleMessageWithRequestIdentifier(ConsoleMessa ge::create(JSMessageSource, ErrorMessageLevel, "Invalid 'X-Frame-Options' header encountered when loading '" + url.elidedString() + "': '" + content + "' is not a recognized directive. The header will be ignored.", requestIdentifier));
1370 return false; 1371 return false;
1371 default: 1372 default:
1372 ASSERT_NOT_REACHED(); 1373 ASSERT_NOT_REACHED();
1373 return false; 1374 return false;
1374 } 1375 }
1375 } 1376 }
1376 1377
1377 bool FrameLoader::shouldTreatURLAsSameAsCurrent(const KURL& url) const 1378 bool FrameLoader::shouldTreatURLAsSameAsCurrent(const KURL& url) const
1378 { 1379 {
1379 return m_currentItem && url == m_currentItem->url(); 1380 return m_currentItem && url == m_currentItem->url();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. 1449 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1449 Frame* parentFrame = m_frame->tree().parent(); 1450 Frame* parentFrame = m_frame->tree().parent();
1450 if (parentFrame && parentFrame->isLocalFrame()) 1451 if (parentFrame && parentFrame->isLocalFrame())
1451 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); 1452 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
1452 if (FrameOwner* frameOwner = m_frame->owner()) 1453 if (FrameOwner* frameOwner = m_frame->owner())
1453 flags |= frameOwner->sandboxFlags(); 1454 flags |= frameOwner->sandboxFlags();
1454 return flags; 1455 return flags;
1455 } 1456 }
1456 1457
1457 } // namespace WebCore 1458 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698