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

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

Issue 2646383002: Use a new Supplement constructor for (Worker)Navigator supplements (Closed)
Patch Set: temp Created 3 years, 11 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/NavigatorUserMedia.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.cpp b/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.cpp
index cd445bc25ae25873ed159c02538007a6d2fe563d..083e6802c3d946a8051fa5f228d65f531c75df8d 100644
--- a/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.cpp
@@ -12,8 +12,10 @@
namespace blink {
-NavigatorUserMedia::NavigatorUserMedia(ExecutionContext* context)
- : m_mediaDevices(MediaDevices::create(context)) {}
+NavigatorUserMedia::NavigatorUserMedia(Navigator& navigator)
+ : Supplement<Navigator>(navigator),
+ m_mediaDevices(MediaDevices::create(
+ navigator.frame() ? navigator.frame()->document() : nullptr)) {}
const char* NavigatorUserMedia::supplementName() {
return "NavigatorUserMedia";
@@ -23,9 +25,7 @@ NavigatorUserMedia& NavigatorUserMedia::from(Navigator& navigator) {
NavigatorUserMedia* supplement = static_cast<NavigatorUserMedia*>(
Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- ExecutionContext* context =
- navigator.frame() ? navigator.frame()->document() : nullptr;
- supplement = new NavigatorUserMedia(context);
+ supplement = new NavigatorUserMedia(navigator);
provideTo(navigator, supplementName(), supplement);
}
return *supplement;

Powered by Google App Engine
This is Rietveld 408576698