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

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

Issue 804163002: Revert 186849 "Bind Window focus ability to the ExecutionContext..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2250/
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } 127 SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
128 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } 128 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; }
129 void enforceSandboxFlags(SandboxFlags mask); 129 void enforceSandboxFlags(SandboxFlags mask);
130 130
131 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); 131 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier();
132 132
133 virtual EventTarget* errorEventTarget() = 0; 133 virtual EventTarget* errorEventTarget() = 0;
134 virtual EventQueue* eventQueue() const = 0; 134 virtual EventQueue* eventQueue() const = 0;
135 135
136 void allowWindowFocus();
137 void consumeWindowFocus();
138 bool isWindowFocusAllowed() const;
139
140 protected: 136 protected:
141 ExecutionContext(); 137 ExecutionContext();
142 virtual ~ExecutionContext(); 138 virtual ~ExecutionContext();
143 139
144 virtual const KURL& virtualURL() const = 0; 140 virtual const KURL& virtualURL() const = 0;
145 virtual KURL virtualCompleteURL(const String&) const = 0; 141 virtual KURL virtualCompleteURL(const String&) const = 0;
146 142
147 ContextLifecycleNotifier& lifecycleNotifier(); 143 ContextLifecycleNotifier& lifecycleNotifier();
148 144
149 private: 145 private:
(...skipping 24 matching lines...) Expand all
174 170
175 bool m_activeDOMObjectsAreSuspended; 171 bool m_activeDOMObjectsAreSuspended;
176 bool m_activeDOMObjectsAreStopped; 172 bool m_activeDOMObjectsAreStopped;
177 173
178 OwnPtrWillBeMember<PublicURLManager> m_publicURLManager; 174 OwnPtrWillBeMember<PublicURLManager> m_publicURLManager;
179 175
180 // The location of this member is important; to make sure contextDestroyed() notification on 176 // The location of this member is important; to make sure contextDestroyed() notification on
181 // ExecutionContext's members (notably m_timeouts) is called before they are destructed, 177 // ExecutionContext's members (notably m_timeouts) is called before they are destructed,
182 // m_lifecycleNotifer should be placed *after* such members. 178 // m_lifecycleNotifer should be placed *after* such members.
183 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; 179 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier;
184
185 // Counter that keeps track of how many window focus calls are allowed for
186 // this ExecutionContext. Callers are expected to call |allowWindowFocus()|
187 // and |consumeWindowFocus()| in order to increment and decrement the
188 // counter.
189 int m_windowFocusTokens;
190 }; 180 };
191 181
192 } // namespace blink 182 } // namespace blink
193 183
194 #endif // ExecutionContext_h 184 #endif // ExecutionContext_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698