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

Unified Diff: chromeos/dbus/experimental_bluetooth_profile_service_provider.h

Issue 14487002: Bluetooth: Profile support for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Transfer out ownership of fd. Fix socket code Created 7 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: chromeos/dbus/experimental_bluetooth_profile_service_provider.h
diff --git a/chromeos/dbus/experimental_bluetooth_profile_service_provider.h b/chromeos/dbus/experimental_bluetooth_profile_service_provider.h
index 71e09d5771b11e34591873e5e1554dfc00f413b0..d22228e75f1dae5e99d7e25275a2d1254b06ec42 100644
--- a/chromeos/dbus/experimental_bluetooth_profile_service_provider.h
+++ b/chromeos/dbus/experimental_bluetooth_profile_service_provider.h
@@ -74,11 +74,15 @@ class CHROMEOS_EXPORT ExperimentalBluetoothProfileServiceProvider {
//
// A file descriptor for the connection socket is provided in |fd|, and
// details about the specific implementation of the profile in |options|.
- // The delegate should take the value and ownership
-
- // The file descriptor is owned by the delegate after this call so must be
- // cleaned up if the connection is cancelled or rejected, the |options|
- // structure is not so information out of it must be copied if required.
+ //
+ // IMPORTANT: Ownership of the file descriptor object |fd| is passed to
+ // the delegate by this call, so it must be deleted in all code paths
+ // including successful connnection or if the connection is cancelled or
+ // rejected. The delegate is responsible for checking the validity of |fd|
+ // on a thread where I/O is permitted before taking the value.
+ //
+ // Ownership of |options| is NOT passed so information out of it must be
+ // copied if required.
virtual void NewConnection(const dbus::ObjectPath& device_path,
dbus::FileDescriptor* fd,
const Options& options,

Powered by Google App Engine
This is Rietveld 408576698