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

Side by Side Diff: third_party/WebKit/Source/core/dom/ExecutionContext.h

Issue 2805333002: Move ScriptState::getExecutionContext (Part 1) (Closed)
Patch Set: Rebase Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class SuspendableObject; 46 class SuspendableObject;
47 class ConsoleMessage; 47 class ConsoleMessage;
48 class DOMTimerCoordinator; 48 class DOMTimerCoordinator;
49 class ErrorEvent; 49 class ErrorEvent;
50 class EventQueue; 50 class EventQueue;
51 class EventTarget; 51 class EventTarget;
52 class ExecutionContextTask; 52 class ExecutionContextTask;
53 class LocalDOMWindow; 53 class LocalDOMWindow;
54 class PublicURLManager; 54 class PublicURLManager;
55 class SecurityOrigin; 55 class SecurityOrigin;
56 class ScriptState;
56 enum class TaskType : unsigned; 57 enum class TaskType : unsigned;
57 58
58 enum ReasonForCallingCanExecuteScripts { 59 enum ReasonForCallingCanExecuteScripts {
59 kAboutToExecuteScript, 60 kAboutToExecuteScript,
60 kNotAboutToExecuteScript 61 kNotAboutToExecuteScript
61 }; 62 };
62 63
63 class CORE_EXPORT ExecutionContext : public ContextLifecycleNotifier, 64 class CORE_EXPORT ExecutionContext : public ContextLifecycleNotifier,
64 public Supplementable<ExecutionContext> { 65 public Supplementable<ExecutionContext> {
65 WTF_MAKE_NONCOPYABLE(ExecutionContext); 66 WTF_MAKE_NONCOPYABLE(ExecutionContext);
66 67
67 public: 68 public:
68 DECLARE_VIRTUAL_TRACE(); 69 DECLARE_VIRTUAL_TRACE();
69 70
70 // Used to specify whether |isSecureContext| should walk the 71 // Used to specify whether |isSecureContext| should walk the
71 // ancestor tree to decide whether to restrict usage of a powerful 72 // ancestor tree to decide whether to restrict usage of a powerful
72 // feature. 73 // feature.
73 enum SecureContextCheck { 74 enum SecureContextCheck {
74 kStandardSecureContextCheck, 75 kStandardSecureContextCheck,
75 kWebCryptoSecureContextCheck 76 kWebCryptoSecureContextCheck
76 }; 77 };
77 78
79 static ExecutionContext* From(const ScriptState*);
80
78 virtual bool IsDocument() const { return false; } 81 virtual bool IsDocument() const { return false; }
79 virtual bool IsWorkerOrWorkletGlobalScope() const { return false; } 82 virtual bool IsWorkerOrWorkletGlobalScope() const { return false; }
80 virtual bool IsWorkerGlobalScope() const { return false; } 83 virtual bool IsWorkerGlobalScope() const { return false; }
81 virtual bool IsWorkletGlobalScope() const { return false; } 84 virtual bool IsWorkletGlobalScope() const { return false; }
82 virtual bool IsMainThreadWorkletGlobalScope() const { return false; } 85 virtual bool IsMainThreadWorkletGlobalScope() const { return false; }
83 virtual bool IsDedicatedWorkerGlobalScope() const { return false; } 86 virtual bool IsDedicatedWorkerGlobalScope() const { return false; }
84 virtual bool IsSharedWorkerGlobalScope() const { return false; } 87 virtual bool IsSharedWorkerGlobalScope() const { return false; }
85 virtual bool IsServiceWorkerGlobalScope() const { return false; } 88 virtual bool IsServiceWorkerGlobalScope() const { return false; }
86 virtual bool IsCompositorWorkerGlobalScope() const { return false; } 89 virtual bool IsCompositorWorkerGlobalScope() const { return false; }
87 virtual bool IsAnimationWorkletGlobalScope() const { return false; } 90 virtual bool IsAnimationWorkletGlobalScope() const { return false; }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to 217 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to
215 // increment and decrement the counter. 218 // increment and decrement the counter.
216 int window_interaction_tokens_; 219 int window_interaction_tokens_;
217 220
218 ReferrerPolicy referrer_policy_; 221 ReferrerPolicy referrer_policy_;
219 }; 222 };
220 223
221 } // namespace blink 224 } // namespace blink
222 225
223 #endif // ExecutionContext_h 226 #endif // ExecutionContext_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp ('k') | third_party/WebKit/Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698