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

Unified Diff: third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp

Issue 1758783002: Revert of Reduce ActiveDOMObjects from modules/mediastream/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp
index e26d64d2c5fc31a8d709006c3e507cd812bd3bb2..112d49387d54aa8b33939ef4291f7a2a00c87cce 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp
@@ -36,13 +36,19 @@
MediaDevicesRequest* MediaDevicesRequest::create(ScriptState* state, UserMediaController* controller)
{
- return new MediaDevicesRequest(state, controller);
+ MediaDevicesRequest* request = new MediaDevicesRequest(state, controller);
+ request->suspendIfNeeded();
+ return request;
}
MediaDevicesRequest::MediaDevicesRequest(ScriptState* state, UserMediaController* controller)
- : ContextLifecycleObserver(state->executionContext())
+ : ActiveDOMObject(state->executionContext())
, m_controller(controller)
, m_resolver(ScriptPromiseResolver::create(state))
+{
+}
+
+MediaDevicesRequest::~MediaDevicesRequest()
{
}
@@ -71,7 +77,7 @@
m_resolver->resolve(mediaDevices);
}
-void MediaDevicesRequest::contextDestroyed()
+void MediaDevicesRequest::stop()
{
m_controller.clear();
m_resolver.clear();
@@ -81,7 +87,7 @@
{
visitor->trace(m_controller);
visitor->trace(m_resolver);
- ContextLifecycleObserver::trace(visitor);
+ ActiveDOMObject::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698