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

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

Issue 866983004: Allow creating new windows from a notificationclick event in SW. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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 | « Source/core/dom/ExecutionContext.h ('k') | Source/core/dom/ScopedWindowFocusAllowedIndicator.h » ('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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 String m_sourceURL; 65 String m_sourceURL;
66 RefPtrWillBeMember<ScriptCallStack> m_callStack; 66 RefPtrWillBeMember<ScriptCallStack> m_callStack;
67 }; 67 };
68 68
69 ExecutionContext::ExecutionContext() 69 ExecutionContext::ExecutionContext()
70 : m_circularSequentialID(0) 70 : m_circularSequentialID(0)
71 , m_inDispatchErrorEvent(false) 71 , m_inDispatchErrorEvent(false)
72 , m_activeDOMObjectsAreSuspended(false) 72 , m_activeDOMObjectsAreSuspended(false)
73 , m_activeDOMObjectsAreStopped(false) 73 , m_activeDOMObjectsAreStopped(false)
74 , m_strictMixedContentCheckingEnforced(false) 74 , m_strictMixedContentCheckingEnforced(false)
75 , m_windowFocusTokens(0) 75 , m_windowInteractionTokens(0)
76 { 76 {
77 } 77 }
78 78
79 ExecutionContext::~ExecutionContext() 79 ExecutionContext::~ExecutionContext()
80 { 80 {
81 } 81 }
82 82
83 bool ExecutionContext::hasPendingActivity() 83 bool ExecutionContext::hasPendingActivity()
84 { 84 {
85 return lifecycleNotifier().hasPendingActivity(); 85 return lifecycleNotifier().hasPendingActivity();
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier() 219 ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier()
220 { 220 {
221 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont ext>::lifecycleNotifier()); 221 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont ext>::lifecycleNotifier());
222 } 222 }
223 223
224 bool ExecutionContext::isIteratingOverObservers() const 224 bool ExecutionContext::isIteratingOverObservers() const
225 { 225 {
226 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers( ); 226 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers( );
227 } 227 }
228 228
229 void ExecutionContext::allowWindowFocus() 229 void ExecutionContext::allowWindowInteraction()
230 { 230 {
231 ++m_windowFocusTokens; 231 ++m_windowInteractionTokens;
232 } 232 }
233 233
234 void ExecutionContext::consumeWindowFocus() 234 void ExecutionContext::consumeWindowInteraction()
235 { 235 {
236 if (m_windowFocusTokens == 0) 236 if (m_windowInteractionTokens == 0)
237 return; 237 return;
238 --m_windowFocusTokens; 238 --m_windowInteractionTokens;
239 } 239 }
240 240
241 bool ExecutionContext::isWindowFocusAllowed() const 241 bool ExecutionContext::isWindowInteractionAllowed() const
242 { 242 {
243 // FIXME: WindowFocusAllowedIndicator::windowFocusAllowed() is temporary, 243 // FIXME: WindowFocusAllowedIndicator::windowFocusAllowed() is temporary,
244 // it will be removed as soon as WebScopedWindowFocusAllowedIndicator will 244 // it will be removed as soon as WebScopedWindowFocusAllowedIndicator will
245 // be updated to not use WindowFocusAllowedIndicator. 245 // be updated to not use WindowFocusAllowedIndicator.
246 return m_windowFocusTokens > 0 || WindowFocusAllowedIndicator::windowFocusAl lowed(); 246 return m_windowInteractionTokens > 0 || WindowFocusAllowedIndicator::windowF ocusAllowed();
247 } 247 }
248 248
249 void ExecutionContext::trace(Visitor* visitor) 249 void ExecutionContext::trace(Visitor* visitor)
250 { 250 {
251 #if ENABLE(OILPAN) 251 #if ENABLE(OILPAN)
252 visitor->trace(m_pendingExceptions); 252 visitor->trace(m_pendingExceptions);
253 visitor->trace(m_publicURLManager); 253 visitor->trace(m_publicURLManager);
254 HeapSupplementable<ExecutionContext>::trace(visitor); 254 HeapSupplementable<ExecutionContext>::trace(visitor);
255 #endif 255 #endif
256 LifecycleContext<ExecutionContext>::trace(visitor); 256 LifecycleContext<ExecutionContext>::trace(visitor);
257 } 257 }
258 258
259 } // namespace blink 259 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/ExecutionContext.h ('k') | Source/core/dom/ScopedWindowFocusAllowedIndicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698