Bug 1158081 - Patch (2/2): Simplify |BluetoothOppManager::SendObexData| function, r=tzimmermann
authorBen Tian <btian@mozilla.com>
Tue, 28 Apr 2015 11:12:35 +0800
changeset 241669 4c438af160679af4b1c21be083f0f494e1ca7e6f
parent 241668 8721fd2d3caedbe7646e7d5b5da100d0813ebb05
child 241670 27561f4e4910e5888a96791d0540a16d604384b0
push id28667
push userryanvm@gmail.com
push dateThu, 30 Apr 2015 17:35:13 +0000
treeherdermozilla-central@68490bfe736c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstzimmermann
bugs1158081
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1158081 - Patch (2/2): Simplify |BluetoothOppManager::SendObexData| function, r=tzimmermann
dom/bluetooth/bluedroid/BluetoothOppManager.cpp
dom/bluetooth/bluez/BluetoothOppManager.cpp
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
@@ -1395,24 +1395,22 @@ BluetoothOppManager::ReplyError(uint8_t 
   int index = 3;
 
   SendObexData(req, aError, index);
 }
 
 void
 BluetoothOppManager::SendObexData(uint8_t* aData, uint8_t aOpcode, int aSize)
 {
-  SetObexPacketInfo(aData, aOpcode, aSize);
-
   if (!mIsServer) {
     mLastCommand = aOpcode;
   }
 
-  UnixSocketRawData* s = new UnixSocketRawData(aData, aSize);
-  mSocket->SendSocketData(s);
+  SetObexPacketInfo(aData, aOpcode, aSize);
+  mSocket->SendSocketData(new UnixSocketRawData(aData, aSize));
 }
 
 void
 BluetoothOppManager::FileTransferComplete()
 {
   if (mSendTransferCompleteFlag) {
     return;
   }
--- a/dom/bluetooth/bluez/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothOppManager.cpp
@@ -1332,24 +1332,22 @@ BluetoothOppManager::ReplyError(uint8_t 
   int index = 3;
 
   SendObexData(req, aError, index);
 }
 
 void
 BluetoothOppManager::SendObexData(uint8_t* aData, uint8_t aOpcode, int aSize)
 {
-  SetObexPacketInfo(aData, aOpcode, aSize);
-
   if (!mIsServer) {
     mLastCommand = aOpcode;
   }
 
-  UnixSocketRawData* s = new UnixSocketRawData(aData, aSize);
-  mSocket->SendSocketData(s);
+  SetObexPacketInfo(aData, aOpcode, aSize);
+  mSocket->SendSocketData(new UnixSocketRawData(aData, aSize));
 }
 
 void
 BluetoothOppManager::FileTransferComplete()
 {
   if (mSendTransferCompleteFlag) {
     return;
   }