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

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

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 years, 6 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/loader/FrameFetchContext.h ('k') | Source/core/loader/ImageLoader.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) 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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 { 566 {
567 if (frame()->document()) 567 if (frame()->document())
568 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageS ource, ErrorMessageLevel, message)); 568 frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageS ource, ErrorMessageLevel, message));
569 } 569 }
570 570
571 SecurityOrigin* FrameFetchContext::securityOrigin() const 571 SecurityOrigin* FrameFetchContext::securityOrigin() const
572 { 572 {
573 return m_document ? m_document->securityOrigin() : nullptr; 573 return m_document ? m_document->securityOrigin() : nullptr;
574 } 574 }
575 575
576 String FrameFetchContext::charset() const
577 {
578 return m_document ? m_document->charset().string() : String();
579 }
580
581 void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest) 576 void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest)
582 { 577 {
583 KURL url = fetchRequest.resourceRequest().url(); 578 KURL url = fetchRequest.resourceRequest().url();
584 579
585 // Tack an 'HTTPS' header to outgoing navigational requests, as described in 580 // Tack an 'HTTPS' header to outgoing navigational requests, as described in
586 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect 581 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect
587 if (fetchRequest.resourceRequest().frameType() != WebURLRequest::FrameTypeNo ne) 582 if (fetchRequest.resourceRequest().frameType() != WebURLRequest::FrameTypeNo ne)
588 fetchRequest.mutableResourceRequest().addHTTPHeaderField("HTTPS", "1"); 583 fetchRequest.mutableResourceRequest().addHTTPHeaderField("HTTPS", "1");
589 584
590 if (m_document && m_document->insecureRequestsPolicy() == SecurityContext::I nsecureRequestsUpgrade && url.protocolIs("http")) { 585 if (m_document && m_document->insecureRequestsPolicy() == SecurityContext::I nsecureRequestsUpgrade && url.protocolIs("http")) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" ); 633 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" );
639 } 634 }
640 635
641 DEFINE_TRACE(FrameFetchContext) 636 DEFINE_TRACE(FrameFetchContext)
642 { 637 {
643 visitor->trace(m_document); 638 visitor->trace(m_document);
644 FetchContext::trace(visitor); 639 FetchContext::trace(visitor);
645 } 640 }
646 641
647 } // namespace blink 642 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/loader/FrameFetchContext.h ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698