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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp

Issue 2433773006: Remove ExecutionContext::activeDOMObjectsAreStopped()
Patch Set: Created 4 years, 2 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/presentation/PresentationRequest.h" 5 #include "modules/presentation/PresentationRequest.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 const AtomicString& eventType, 77 const AtomicString& eventType,
78 RegisteredEventListener& registeredListener) { 78 RegisteredEventListener& registeredListener) {
79 EventTargetWithInlineData::addedEventListener(eventType, registeredListener); 79 EventTargetWithInlineData::addedEventListener(eventType, registeredListener);
80 if (eventType == EventTypeNames::connectionavailable) 80 if (eventType == EventTypeNames::connectionavailable)
81 UseCounter::count( 81 UseCounter::count(
82 getExecutionContext(), 82 getExecutionContext(),
83 UseCounter::PresentationRequestConnectionAvailableEventListener); 83 UseCounter::PresentationRequestConnectionAvailableEventListener);
84 } 84 }
85 85
86 bool PresentationRequest::hasPendingActivity() const { 86 bool PresentationRequest::hasPendingActivity() const {
87 if (!getExecutionContext() || 87 if (!getExecutionContext())
88 getExecutionContext()->activeDOMObjectsAreStopped())
89 return false; 88 return false;
90 89
91 // Prevents garbage collecting of this object when not hold by another 90 // Prevents garbage collecting of this object when not hold by another
92 // object but still has listeners registered. 91 // object but still has listeners registered.
93 return hasEventListeners(); 92 return hasEventListeners();
94 } 93 }
95 94
96 ScriptPromise PresentationRequest::start(ScriptState* scriptState) { 95 ScriptPromise PresentationRequest::start(ScriptState* scriptState) {
97 Settings* contextSettings = settings(getExecutionContext()); 96 Settings* contextSettings = settings(getExecutionContext());
98 bool isUserGestureRequired = 97 bool isUserGestureRequired =
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ActiveDOMObject::trace(visitor); 182 ActiveDOMObject::trace(visitor);
184 } 183 }
185 184
186 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, 185 PresentationRequest::PresentationRequest(ExecutionContext* executionContext,
187 const KURL& url) 186 const KURL& url)
188 : ActiveScriptWrappable(this), 187 : ActiveScriptWrappable(this),
189 ActiveDOMObject(executionContext), 188 ActiveDOMObject(executionContext),
190 m_url(url) {} 189 m_url(url) {}
191 190
192 } // namespace blink 191 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698