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

Side by Side Diff: content/common/bluetooth/bluetooth_messages.h

Issue 885723002: bluetooth: Provide more device attributes in requestDevice reply. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-0
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Messages for Web Bluetooth API. 5 // Messages for Web Bluetooth API.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 // Web Bluetooth Security 8 // Web Bluetooth Security
9 // The security mechanisms of Bluetooth are described in the specification: 9 // The security mechanisms of Bluetooth are described in the specification:
10 // https://webbluetoothcg.github.io/web-bluetooth 10 // https://webbluetoothcg.github.io/web-bluetooth
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // and origin's allowed services list. 72 // and origin's allowed services list.
73 // 73 //
74 // Connect to the device. ([BLUETOOTH41] 3.G.6.2.1) If the connection fails, 74 // Connect to the device. ([BLUETOOTH41] 3.G.6.2.1) If the connection fails,
75 // reject the Promise with a NetworkError and abort these steps. 75 // reject the Promise with a NetworkError and abort these steps.
76 // 76 //
77 // Resolve the Promise with a BluetoothDevice instance representing the selected 77 // Resolve the Promise with a BluetoothDevice instance representing the selected
78 // device. 78 // device.
79 // """ 79 // """
80 80
81 #include "ipc/ipc_message_macros.h" 81 #include "ipc/ipc_message_macros.h"
82 #include "content/common/bluetooth/bluetooth_device.h"
82 #include "content/common/bluetooth/bluetooth_error.h" 83 #include "content/common/bluetooth/bluetooth_error.h"
83 84
84 #define IPC_MESSAGE_START BluetoothMsgStart 85 #define IPC_MESSAGE_START BluetoothMsgStart
85 86
87 IPC_ENUM_TRAITS_MAX_VALUE(
88 device::BluetoothDevice::VendorIDSource,
89 device::BluetoothDevice::VendorIDSource::VENDOR_ID_MAX_VALUE)
90
91 IPC_STRUCT_TRAITS_BEGIN(content::BluetoothDevice)
92 IPC_STRUCT_TRAITS_MEMBER(instance_id)
93 IPC_STRUCT_TRAITS_MEMBER(name)
94 IPC_STRUCT_TRAITS_MEMBER(device_class)
95 IPC_STRUCT_TRAITS_MEMBER(vendor_id_source)
96 IPC_STRUCT_TRAITS_MEMBER(vendor_id)
97 IPC_STRUCT_TRAITS_MEMBER(product_id)
98 IPC_STRUCT_TRAITS_MEMBER(product_version)
99 IPC_STRUCT_TRAITS_MEMBER(paired)
100 IPC_STRUCT_TRAITS_MEMBER(connected)
101 IPC_STRUCT_TRAITS_MEMBER(uuids)
102 IPC_STRUCT_TRAITS_END()
103
86 IPC_ENUM_TRAITS_MAX_VALUE(content::BluetoothError, 104 IPC_ENUM_TRAITS_MAX_VALUE(content::BluetoothError,
87 content::BluetoothError::ENUM_MAX_VALUE) 105 content::BluetoothError::ENUM_MAX_VALUE)
88 106
89 // Messages sent from the browser to the renderer. 107 // Messages sent from the browser to the renderer.
90 108
91 // Informs the renderer that the device request |request_id| succeeded. 109 // Informs the renderer that the device request |request_id| succeeded.
92 IPC_MESSAGE_CONTROL3(BluetoothMsg_RequestDeviceSuccess, 110 IPC_MESSAGE_CONTROL3(BluetoothMsg_RequestDeviceSuccess,
93 int /* thread_id */, 111 int /* thread_id */,
94 int /* request_id */, 112 int /* request_id */,
95 std::string /* device_instance_id */) 113 content::BluetoothDevice /* device */)
96 114
97 // Informs the renderer that the device request |request_id| failed. 115 // Informs the renderer that the device request |request_id| failed.
98 IPC_MESSAGE_CONTROL3(BluetoothMsg_RequestDeviceError, 116 IPC_MESSAGE_CONTROL3(BluetoothMsg_RequestDeviceError,
99 int /* thread_id */, 117 int /* thread_id */,
100 int /* request_id */, 118 int /* request_id */,
101 content::BluetoothError /* result */) 119 content::BluetoothError /* result */)
102 120
103 // Messages sent from the renderer to the browser. 121 // Messages sent from the renderer to the browser.
104 122
105 // Requests a bluetooth device from the browser. 123 // Requests a bluetooth device from the browser.
106 // TODO(scheib): UI to select and permit access to a device crbug.com/436280. 124 // TODO(scheib): UI to select and permit access to a device crbug.com/436280.
107 // This will include refactoring messages to be associated with an origin 125 // This will include refactoring messages to be associated with an origin
108 // and making this initial requestDevice call with an associated frame. 126 // and making this initial requestDevice call with an associated frame.
109 // This work is deferred to simplify initial prototype patches. 127 // This work is deferred to simplify initial prototype patches.
110 // The Bluetooth feature, and the BluetoothDispatcherHost are behind 128 // The Bluetooth feature, and the BluetoothDispatcherHost are behind
111 // the --enable-experimental-web-platform-features flag. 129 // the --enable-experimental-web-platform-features flag.
112 IPC_MESSAGE_CONTROL2(BluetoothHostMsg_RequestDevice, 130 IPC_MESSAGE_CONTROL2(BluetoothHostMsg_RequestDevice,
113 int /* thread_id */, 131 int /* thread_id */,
114 int /* request_id */) 132 int /* request_id */)
115 133
116 // Configures the mock data set in the browser used while under test. 134 // Configures the mock data set in the browser used while under test.
117 // TODO(scheib): Disable testing in non-test executables. crbug.com/436284. 135 // TODO(scheib): Disable testing in non-test executables. crbug.com/436284.
118 IPC_MESSAGE_CONTROL1(BluetoothHostMsg_SetBluetoothMockDataSetForTesting, 136 IPC_MESSAGE_CONTROL1(BluetoothHostMsg_SetBluetoothMockDataSetForTesting,
119 std::string /* name */) 137 std::string /* name */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698