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

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 jyasskin's comments Created 5 years, 3 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..3a8e6a9ea70f4897b3b4c75671e46dd4d847fcae 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp
@@ -26,9 +26,8 @@ void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth)
WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSupplement.release());
};
-WebBluetooth* BluetoothSupplement::from(ScriptState* scriptState)
+WebBluetooth* BluetoothSupplement::from(LocalDOMWindow* window)
{
- LocalDOMWindow* window = scriptState->domWindow();
if (window && window->frame()) {
BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(WillBeHeapSupplement<LocalFrame>::from(window->frame(), supplementName()));
if (supplement && supplement->m_bluetooth)
@@ -37,6 +36,16 @@ WebBluetooth* BluetoothSupplement::from(ScriptState* scriptState)
return Platform::current()->bluetooth();
}
+WebBluetooth* BluetoothSupplement::from(ScriptState* scriptState)
scheib 2015/10/01 22:05:23 Ordering, here or in .h should adjust: http://goog
ortuno 2015/10/03 04:03:04 Done.
+{
+ return BluetoothSupplement::from(scriptState->domWindow());
+}
+
+WebBluetooth* BluetoothSupplement::from(ExecutionContext* executionContext)
+{
+ return BluetoothSupplement::from(executionContext->executingWindow());
+}
+
DEFINE_TRACE(BluetoothSupplement)
{
WillBeHeapSupplement<LocalFrame>::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698