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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2343623002: Add a warning whenever link preloads are not used (Closed)
Patch Set: more comments Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 return false; 647 return false;
648 info->setInitiatorType(frame()->deprecatedLocalOwner()->localName()); 648 info->setInitiatorType(frame()->deprecatedLocalOwner()->localName());
649 return true; 649 return true;
650 } 650 }
651 651
652 void FrameFetchContext::sendImagePing(const KURL& url) 652 void FrameFetchContext::sendImagePing(const KURL& url)
653 { 653 {
654 PingLoader::loadImage(frame(), url); 654 PingLoader::loadImage(frame(), url);
655 } 655 }
656 656
657 void FrameFetchContext::addConsoleMessage(const String& message) const 657 void FrameFetchContext::addConsoleMessage(const String& message, LogMessageType messageType) const
658 { 658 {
659 MessageLevel level = ErrorMessageLevel;
Nate Chapin 2016/09/14 22:14:31 MessageLevel level = messageType == LogWarningMess
Yoav Weiss 2016/09/15 06:11:29 ok
660 if (messageType == LogWarningMessage)
661 level = WarningMessageLevel;
659 if (frame()->document()) 662 if (frame()->document())
660 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageS ource, ErrorMessageLevel, message)); 663 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageS ource, level, message));
661 } 664 }
662 665
663 SecurityOrigin* FrameFetchContext::getSecurityOrigin() const 666 SecurityOrigin* FrameFetchContext::getSecurityOrigin() const
664 { 667 {
665 return m_document ? m_document->getSecurityOrigin() : nullptr; 668 return m_document ? m_document->getSecurityOrigin() : nullptr;
666 } 669 }
667 670
668 void FrameFetchContext::upgradeInsecureRequest(ResourceRequest& resourceRequest) 671 void FrameFetchContext::upgradeInsecureRequest(ResourceRequest& resourceRequest)
669 { 672 {
670 frame()->loader().upgradeInsecureRequest(resourceRequest, m_document); 673 frame()->loader().upgradeInsecureRequest(resourceRequest, m_document);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 803 }
801 804
802 DEFINE_TRACE(FrameFetchContext) 805 DEFINE_TRACE(FrameFetchContext)
803 { 806 {
804 visitor->trace(m_document); 807 visitor->trace(m_document);
805 visitor->trace(m_documentLoader); 808 visitor->trace(m_documentLoader);
806 FetchContext::trace(visitor); 809 FetchContext::trace(visitor);
807 } 810 }
808 811
809 } // namespace blink 812 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698