| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/RemoteSecurityContext.h" | 5 #include "core/dom/RemoteSecurityContext.h" |
| 6 | 6 |
| 7 #include "core/frame/csp/ContentSecurityPolicy.h" | 7 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 8 #include "platform/weborigin/SecurityOrigin.h" | 8 #include "platform/weborigin/SecurityOrigin.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "platform/wtf/Assertions.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 RemoteSecurityContext::RemoteSecurityContext() : SecurityContext() { | 13 RemoteSecurityContext::RemoteSecurityContext() : SecurityContext() { |
| 14 // RemoteSecurityContext's origin is expected to stay uninitialized until | 14 // RemoteSecurityContext's origin is expected to stay uninitialized until |
| 15 // we set it using replicated origin data from the browser process. | 15 // we set it using replicated origin data from the browser process. |
| 16 DCHECK(!GetSecurityOrigin()); | 16 DCHECK(!GetSecurityOrigin()); |
| 17 | 17 |
| 18 // Start with a clean slate. | 18 // Start with a clean slate. |
| 19 SetContentSecurityPolicy(ContentSecurityPolicy::Create()); | 19 SetContentSecurityPolicy(ContentSecurityPolicy::Create()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 GetContentSecurityPolicy()->SetupSelf(*GetSecurityOrigin()); | 38 GetContentSecurityPolicy()->SetupSelf(*GetSecurityOrigin()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void RemoteSecurityContext::ResetReplicatedContentSecurityPolicy() { | 41 void RemoteSecurityContext::ResetReplicatedContentSecurityPolicy() { |
| 42 DCHECK(GetSecurityOrigin()); | 42 DCHECK(GetSecurityOrigin()); |
| 43 SetContentSecurityPolicy(ContentSecurityPolicy::Create()); | 43 SetContentSecurityPolicy(ContentSecurityPolicy::Create()); |
| 44 GetContentSecurityPolicy()->SetupSelf(*GetSecurityOrigin()); | 44 GetContentSecurityPolicy()->SetupSelf(*GetSecurityOrigin()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |