| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google, Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "core/dom/DOMStringList.h" | 31 #include "core/dom/DOMStringList.h" |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/dom/Element.h" | 33 #include "core/dom/Element.h" |
| 34 #include "core/dom/SandboxFlags.h" | 34 #include "core/dom/SandboxFlags.h" |
| 35 #include "core/dom/TaskRunnerHelper.h" | 35 #include "core/dom/TaskRunnerHelper.h" |
| 36 #include "core/events/EventQueue.h" | 36 #include "core/events/EventQueue.h" |
| 37 #include "core/events/SecurityPolicyViolationEvent.h" | 37 #include "core/events/SecurityPolicyViolationEvent.h" |
| 38 #include "core/frame/FrameClient.h" | 38 #include "core/frame/FrameClient.h" |
| 39 #include "core/frame/LocalDOMWindow.h" | 39 #include "core/frame/LocalDOMWindow.h" |
| 40 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
| 41 #include "core/frame/LocalFrameClient.h" |
| 41 #include "core/frame/UseCounter.h" | 42 #include "core/frame/UseCounter.h" |
| 42 #include "core/frame/csp/CSPDirectiveList.h" | 43 #include "core/frame/csp/CSPDirectiveList.h" |
| 43 #include "core/frame/csp/CSPSource.h" | 44 #include "core/frame/csp/CSPSource.h" |
| 44 #include "core/frame/csp/MediaListDirective.h" | 45 #include "core/frame/csp/MediaListDirective.h" |
| 45 #include "core/frame/csp/SourceListDirective.h" | 46 #include "core/frame/csp/SourceListDirective.h" |
| 46 #include "core/html/HTMLScriptElement.h" | 47 #include "core/html/HTMLScriptElement.h" |
| 47 #include "core/inspector/ConsoleMessage.h" | 48 #include "core/inspector/ConsoleMessage.h" |
| 48 #include "core/inspector/InspectorInstrumentation.h" | 49 #include "core/inspector/InspectorInstrumentation.h" |
| 49 #include "core/loader/DocumentLoader.h" | 50 #include "core/loader/DocumentLoader.h" |
| 50 #include "core/loader/FrameLoaderClient.h" | |
| 51 #include "core/loader/PingLoader.h" | 51 #include "core/loader/PingLoader.h" |
| 52 #include "core/workers/WorkerGlobalScope.h" | 52 #include "core/workers/WorkerGlobalScope.h" |
| 53 #include "platform/RuntimeEnabledFeatures.h" | 53 #include "platform/RuntimeEnabledFeatures.h" |
| 54 #include "platform/json/JSONValues.h" | 54 #include "platform/json/JSONValues.h" |
| 55 #include "platform/loader/fetch/IntegrityMetadata.h" | 55 #include "platform/loader/fetch/IntegrityMetadata.h" |
| 56 #include "platform/network/ContentSecurityPolicyParsers.h" | 56 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 57 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" | 57 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" |
| 58 #include "platform/network/EncodedFormData.h" | 58 #include "platform/network/EncodedFormData.h" |
| 59 #include "platform/network/ResourceRequest.h" | 59 #include "platform/network/ResourceRequest.h" |
| 60 #include "platform/network/ResourceResponse.h" | 60 #include "platform/network/ResourceResponse.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 m_policies.push_back(policy.release()); | 319 m_policies.push_back(policy.release()); |
| 320 | 320 |
| 321 // Skip the comma, and begin the next header from the current position. | 321 // Skip the comma, and begin the next header from the current position. |
| 322 ASSERT(position == end || *position == ','); | 322 ASSERT(position == end || *position == ','); |
| 323 skipExactly<UChar>(position, end, ','); | 323 skipExactly<UChar>(position, end, ','); |
| 324 begin = position; | 324 begin = position; |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 | 327 |
| 328 void ContentSecurityPolicy::reportAccumulatedHeaders( | 328 void ContentSecurityPolicy::reportAccumulatedHeaders( |
| 329 FrameLoaderClient* client) const { | 329 LocalFrameClient* client) const { |
| 330 // Notify the embedder about headers that have accumulated before the | 330 // Notify the embedder about headers that have accumulated before the |
| 331 // navigation got committed. See comments in | 331 // navigation got committed. See comments in |
| 332 // addAndReportPolicyFromHeaderValue for more details and context. | 332 // addAndReportPolicyFromHeaderValue for more details and context. |
| 333 DCHECK(client); | 333 DCHECK(client); |
| 334 for (const auto& policy : m_policies) { | 334 for (const auto& policy : m_policies) { |
| 335 client->didAddContentSecurityPolicy( | 335 client->didAddContentSecurityPolicy( |
| 336 policy->header(), policy->headerType(), policy->headerSource(), | 336 policy->header(), policy->headerType(), policy->headerSource(), |
| 337 {policy->exposeForNavigationalChecks()}); | 337 {policy->exposeForNavigationalChecks()}); |
| 338 } | 338 } |
| 339 } | 339 } |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 CSPDirectiveListVector otherVector; | 1628 CSPDirectiveListVector otherVector; |
| 1629 for (const auto& policy : other.m_policies) { | 1629 for (const auto& policy : other.m_policies) { |
| 1630 if (!policy->isReportOnly()) | 1630 if (!policy->isReportOnly()) |
| 1631 otherVector.push_back(policy); | 1631 otherVector.push_back(policy); |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 return m_policies[0]->subsumes(otherVector); | 1634 return m_policies[0]->subsumes(otherVector); |
| 1635 } | 1635 } |
| 1636 | 1636 |
| 1637 } // namespace blink | 1637 } // namespace blink |
| OLD | NEW |