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

Side by Side Diff: third_party/WebKit/Source/core/testing/NullExecutionContext.cpp

Issue 2823213002: Implement CanRequest in BaseFetchContext (Closed)
Patch Set: make it work with non-document Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/testing/NullExecutionContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11
11 namespace blink { 12 namespace blink {
12 13
13 namespace { 14 namespace {
14 15
15 class NullEventQueue final : public EventQueue { 16 class NullEventQueue final : public EventQueue {
16 public: 17 public:
17 NullEventQueue() {} 18 NullEventQueue() {}
18 ~NullEventQueue() override {} 19 ~NullEventQueue() override {}
19 bool EnqueueEvent(Event*) override { return true; } 20 bool EnqueueEvent(Event*) override { return true; }
(...skipping 18 matching lines...) Expand all
38 } 39 }
39 40
40 bool NullExecutionContext::IsSecureContext( 41 bool NullExecutionContext::IsSecureContext(
41 String& error_message, 42 String& error_message,
42 const SecureContextCheck privilege_context_check) const { 43 const SecureContextCheck privilege_context_check) const {
43 if (!is_secure_context_) 44 if (!is_secure_context_)
44 error_message = "A secure context is required"; 45 error_message = "A secure context is required";
45 return is_secure_context_; 46 return is_secure_context_;
46 } 47 }
47 48
49 void NullExecutionContext::SetUpSecurityContext() {
50 ContentSecurityPolicy* policy = ContentSecurityPolicy::Create();
51 SecurityContext::SetSecurityOrigin(SecurityOrigin::Create(dummy_url_));
52 policy->BindToExecutionContext(this);
53 SecurityContext::SetContentSecurityPolicy(policy);
54 }
55
48 } // namespace blink 56 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/NullExecutionContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698