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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.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
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
index cb2509f5d38ea658149e1a2d172856144f9a871a..9c7c35de669077161c8e4d9e1d8415d5cfeb0036 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
@@ -8,9 +8,7 @@
#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/page/Page.h"
#include "modules/bluetooth/BluetoothError.h"
#include "modules/bluetooth/BluetoothRemoteGATTService.h"
#include "modules/bluetooth/BluetoothSupplement.h"
@@ -19,11 +17,6 @@
#include "wtf/OwnPtr.h"
namespace blink {
-namespace {
-
-const char kPageHiddenError[] = "Connection is only allowed while the page is visible. This is a temporary measure until we are able to effectively communicate to the user that a page is connected to a device.";
-
-}
BluetoothRemoteGATTServer::BluetoothRemoteGATTServer(BluetoothDevice* device)
: m_device(device)
@@ -52,16 +45,7 @@ public:
if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped())
return;
m_device->gatt()->setConnected(true);
- if (!m_device->page()->isPageVisible()) {
- // TODO(ortuno): Allow connections when the tab is in the background.
- // This is a short term solution instead of implementing a tab indicator
- // for bluetooth connections.
- // https://crbug.com/579746
- m_device->disconnectGATTIfConnected();
- m_resolver->reject(DOMException::create(SecurityError, kPageHiddenError));
- } else {
- m_resolver->resolve(m_device->gatt());
- }
+ m_resolver->resolve(m_device->gatt());
}
void onError(const WebBluetoothError& e) override
@@ -77,14 +61,6 @@ private:
ScriptPromise BluetoothRemoteGATTServer::connect(ScriptState* scriptState)
{
- // TODO(ortuno): Allow connections when the tab is in the background.
- // This is a short term solution instead of implementing a tab indicator
- // for bluetooth connections.
- // https://crbug.com/579746
- if (!toDocument(scriptState->getExecutionContext())->page()->isPageVisible()) {
- return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(SecurityError, kPageHiddenError));
- }
-
WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState);
if (!webbluetooth)
return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError));
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698