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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp

Issue 1334763002: bluetooth: Subscribe to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Address haraken's comments Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
index 4f445c117e729c9d62f51ff6398c3ae43c6d3b5d..c036489b43f60c4650ac857044995feca6a38c8d 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
@@ -28,7 +28,16 @@ void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth)
WebBluetooth* BluetoothSupplement::from(ScriptState* scriptState)
{
- LocalDOMWindow* window = scriptState->domWindow();
+ return BluetoothSupplement::from(scriptState->domWindow());
+}
+
+WebBluetooth* BluetoothSupplement::from(ExecutionContext* executionContext)
+{
+ return BluetoothSupplement::from(executionContext->executingWindow());
+}
+
+WebBluetooth* BluetoothSupplement::from(LocalDOMWindow* window)
+{
if (window && window->frame()) {
BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(WillBeHeapSupplement<LocalFrame>::from(window->frame(), supplementName()));
if (supplement && supplement->m_bluetooth)
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.h ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698