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

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

Issue 2841293002: bluetooth: Add usecounter for gattserverdisconnected (Closed)
Patch Set: fix typo Created 3 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 74aca8e59d8a45045efd640bea9fe87fd03397b7..d59d491d850597b8ab050bb3c4aa2477e123f423 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
@@ -4,17 +4,19 @@
#include "modules/bluetooth/BluetoothDevice.h"
+#include <memory>
+#include <utility>
+
#include "bindings/core/v8/CallbackPromiseAdapter.h"
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMException.h"
#include "core/events/Event.h"
+#include "core/frame/UseCounter.h"
#include "modules/bluetooth/Bluetooth.h"
#include "modules/bluetooth/BluetoothAttributeInstanceMap.h"
#include "modules/bluetooth/BluetoothError.h"
#include "modules/bluetooth/BluetoothRemoteGATTServer.h"
-#include <memory>
-#include <utility>
namespace blink {
@@ -96,4 +98,15 @@ DEFINE_TRACE(BluetoothDevice) {
ContextLifecycleObserver::Trace(visitor);
}
+void BluetoothDevice::AddedEventListener(
+ const AtomicString& event_type,
+ RegisteredEventListener& registered_listener) {
+ EventTargetWithInlineData::AddedEventListener(event_type,
+ registered_listener);
+ if (event_type == EventTypeNames::gattserverdisconnected) {
+ UseCounter::Count(GetExecutionContext(),
+ UseCounter::kGATTServerDisconnectedEvent);
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698