| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |