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

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

Issue 1035683003: Add metrics for 'upgrade-insecure-requests'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moar. Created 5 years, 9 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/frame/csp/ContentSecurityPolicy.cpp ('k') | no next file » | 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) 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // 642 //
643 // 1. Are for subresources (including nested frames). 643 // 1. Are for subresources (including nested frames).
644 // 2. Are form submissions. 644 // 2. Are form submissions.
645 // 3. Whose hosts are contained in the document's InsecureNavigationSet. 645 // 3. Whose hosts are contained in the document's InsecureNavigationSet.
646 const ResourceRequest& request = fetchRequest.resourceRequest(); 646 const ResourceRequest& request = fetchRequest.resourceRequest();
647 if (request.frameType() == WebURLRequest::FrameTypeNone 647 if (request.frameType() == WebURLRequest::FrameTypeNone
648 || request.frameType() == WebURLRequest::FrameTypeNested 648 || request.frameType() == WebURLRequest::FrameTypeNested
649 || request.requestContext() == WebURLRequest::RequestContextForm 649 || request.requestContext() == WebURLRequest::RequestContextForm
650 || (!url.host().isNull() && m_document->insecureNavigationsToUpgrade ()->contains(url.host().impl()->hash()))) 650 || (!url.host().isNull() && m_document->insecureNavigationsToUpgrade ()->contains(url.host().impl()->hash())))
651 { 651 {
652 UseCounter::count(m_document, UseCounter::UpgradeInsecureRequestsUpg radedRequest);
652 url.setProtocol("https"); 653 url.setProtocol("https");
653 if (url.port() == 80) 654 if (url.port() == 80)
654 url.setPort(443); 655 url.setPort(443);
655 fetchRequest.mutableResourceRequest().setURL(url); 656 fetchRequest.mutableResourceRequest().setURL(url);
656 } 657 }
657 } 658 }
658 } 659 }
659 660
660 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest) 661 void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest)
661 { 662 {
(...skipping 18 matching lines...) Expand all
680 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" ); 681 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" );
681 } 682 }
682 683
683 DEFINE_TRACE(FrameFetchContext) 684 DEFINE_TRACE(FrameFetchContext)
684 { 685 {
685 visitor->trace(m_document); 686 visitor->trace(m_document);
686 FetchContext::trace(visitor); 687 FetchContext::trace(visitor);
687 } 688 }
688 689
689 } // namespace blink 690 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698