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

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

Issue 1859463002: bluetooth: Remove disconnect when page hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jyasskin's comments Created 4 years, 8 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/BluetoothDevice.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
index 57585d5790b2e8c6de06b4eb55c6bb7f6d75bf60..eccadad46ac0a59969ee59a37b99a40087bfedcc 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
@@ -8,10 +8,8 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMException.h"
-#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/events/Event.h"
-#include "core/page/PageVisibilityState.h"
#include "modules/bluetooth/BluetoothError.h"
#include "modules/bluetooth/BluetoothRemoteGATTServer.h"
#include "modules/bluetooth/BluetoothSupplement.h"
@@ -21,10 +19,8 @@ namespace blink {
BluetoothDevice::BluetoothDevice(ExecutionContext* context, PassOwnPtr<WebBluetoothDevice> webDevice)
: ActiveDOMObject(context)
- , PageLifecycleObserver(toDocument(context)->page())
, m_webDevice(webDevice)
- , m_adData(BluetoothAdvertisingData::create(m_webDevice->txPower,
- m_webDevice->rssi))
+ , m_adData(BluetoothAdvertisingData::create(m_webDevice->txPower, m_webDevice->rssi))
, m_gatt(BluetoothRemoteGATTServer::create(this))
{
// See example in Source/platform/heap/ThreadState.h
@@ -49,13 +45,6 @@ void BluetoothDevice::stop()
disconnectGATTIfConnected();
}
-void BluetoothDevice::pageVisibilityChanged()
-{
- if (!page()->isPageVisible() && disconnectGATTIfConnected()) {
- dispatchEvent(Event::create(EventTypeNames::gattserverdisconnected));
- }
-}
-
bool BluetoothDevice::disconnectGATTIfConnected()
{
if (m_gatt->connected()) {
@@ -80,7 +69,6 @@ DEFINE_TRACE(BluetoothDevice)
{
RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothDevice>::trace(visitor);
ActiveDOMObject::trace(visitor);
- PageLifecycleObserver::trace(visitor);
visitor->trace(m_adData);
visitor->trace(m_gatt);
}

Powered by Google App Engine
This is Rietveld 408576698