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/testing/NullExecutionContext.h" | 5 #include "core/testing/NullExecutionContext.h" |
6 | 6 |
7 #include "core/dom/ExecutionContextTask.h" | 7 #include "core/dom/ExecutionContextTask.h" |
8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
9 #include "core/frame/DOMTimer.h" | 9 #include "core/frame/DOMTimer.h" |
10 #include "core/frame/csp/ContentSecurityPolicy.h" | 10 #include "core/frame/csp/ContentSecurityPolicy.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 bool NullExecutionContext::IsSecureContext( | 41 bool NullExecutionContext::IsSecureContext( |
42 String& error_message, | 42 String& error_message, |
43 const SecureContextCheck privilege_context_check) const { | 43 const SecureContextCheck privilege_context_check) const { |
44 if (!is_secure_context_) | 44 if (!is_secure_context_) |
45 error_message = "A secure context is required"; | 45 error_message = "A secure context is required"; |
46 return is_secure_context_; | 46 return is_secure_context_; |
47 } | 47 } |
48 | 48 |
49 void NullExecutionContext::SetUpSecurityContext() { | 49 void NullExecutionContext::SetUpSecurityContext() { |
50 ContentSecurityPolicy* policy = ContentSecurityPolicy::Create(); | 50 ContentSecurityPolicy* policy = ContentSecurityPolicy::Create(); |
51 SecurityContext::SetSecurityOrigin(SecurityOrigin::Create(dummy_url_)); | 51 SecurityContext::SetSecurityOrigin(SecurityOrigin::Create(url_)); |
52 policy->BindToExecutionContext(this); | 52 policy->BindToExecutionContext(this); |
53 SecurityContext::SetContentSecurityPolicy(policy); | 53 SecurityContext::SetContentSecurityPolicy(policy); |
54 } | 54 } |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
OLD | NEW |