Bug 799452 - Patch 1: Send a system message to notify 'receiving file confirmation'. r=qdot, a=blocking-basecamp
authorEric Chou <echou@mozilla.com>
Wed, 17 Oct 2012 14:46:53 +0800
changeset 116134 f8e54204ce3fa5b49f7d6f69eb351402b2dfd261
parent 116133 137a3c517823d268795383cb269f4e08c8b9c6dc
child 116135 1c314c80b2d18985e3d470b996831b85b4779209
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot, blocking-basecamp
bugs799452
milestone18.0a2
Bug 799452 - Patch 1: Send a system message to notify 'receiving file confirmation'. r=qdot, a=blocking-basecamp
dom/bluetooth/BluetoothOppManager.cpp
dom/bluetooth/BluetoothOppManager.h
--- a/dom/bluetooth/BluetoothOppManager.cpp
+++ b/dom/bluetooth/BluetoothOppManager.cpp
@@ -677,8 +677,41 @@ void
 BluetoothOppManager::OnConnectError()
 {
 }
 
 void
 BluetoothOppManager::OnDisconnect()
 {
 }
+
+void
+BluetoothOppManager::ReceivingFileConfirmation(const nsString& aAddress,
+                                               const nsString& aFileName,
+                                               uint32_t aFileLength,
+                                               const nsString& aContentType)
+{
+  nsString type, name;
+  BluetoothValue v;
+  InfallibleTArray<BluetoothNamedValue> parameters;
+  type.AssignLiteral("bluetooth-opp-receiving-file-confirmation");
+
+  name.AssignLiteral("address");
+  v = aAddress;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  name.AssignLiteral("fileName");
+  v = aFileName;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  name.AssignLiteral("fileLength");
+  v = aFileLength;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  name.AssignLiteral("contentType");
+  v = aContentType;
+  parameters.AppendElement(BluetoothNamedValue(name, v));
+
+  if (!BroadcastSystemMessage(type, parameters)) {
+    NS_WARNING("Failed to broadcast [bluetooth-opp-receiving-file-confirmation]");
+    return;
+  }
+}
--- a/dom/bluetooth/BluetoothOppManager.h
+++ b/dom/bluetooth/BluetoothOppManager.h
@@ -71,16 +71,20 @@ private:
                             bool aReceived,
                             const nsString& aFileName,
                             uint32_t aFileLength,
                             const nsString& aContentType);
   void UpdateProgress(const nsString& aDeviceAddress,
                       bool aReceived,
                       uint32_t aProcessedLength,
                       uint32_t aFileLength);
+  void ReceivingFileConfirmation(const nsString& aAddress,
+                                 const nsString& aFileName,
+                                 uint32_t aFileLength,
+                                 const nsString& aContentType);
   void ReplyToConnect();
   void ReplyToDisconnect();
   void ReplyToPut(bool aFinal);
   virtual void OnConnectSuccess() MOZ_OVERRIDE;
   virtual void OnConnectError() MOZ_OVERRIDE;
   virtual void OnDisconnect() MOZ_OVERRIDE;
 
   bool mConnected;