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

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: 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
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 if (!m_document) 578 if (!m_document)
584 return; 579 return;
585 580
586 KURL url = fetchRequest.resourceRequest().url(); 581 KURL url = fetchRequest.resourceRequest().url();
587 582
588 // Tack an 'HTTPS' header to outgoing navigational requests, as described in 583 // Tack an 'HTTPS' header to outgoing navigational requests, as described in
589 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect 584 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect
590 if (fetchRequest.resourceRequest().frameType() != WebURLRequest::FrameTypeNo ne) 585 if (fetchRequest.resourceRequest().frameType() != WebURLRequest::FrameTypeNo ne)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" ); 636 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" );
642 } 637 }
643 638
644 DEFINE_TRACE(FrameFetchContext) 639 DEFINE_TRACE(FrameFetchContext)
645 { 640 {
646 visitor->trace(m_document); 641 visitor->trace(m_document);
647 FetchContext::trace(visitor); 642 FetchContext::trace(visitor);
648 } 643 }
649 644
650 } // namespace blink 645 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698