Closed Bug 844705 Opened 11 years ago Closed 11 years ago

[b2g-bluetooth] Should send socket data in main thread

Categories

(Core :: DOM: Device Interfaces, defect)

21 Branch
ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22
blocking-b2g tef+
Tracking Status
firefox21 --- wontfix
firefox22 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: gyeh, Assigned: gyeh)

References

Details

Attachments

(5 files, 4 obsolete files)

After reading file from input stream (in a non-main thread), we should go back to main thread and then send put packet since SendSocketData() should be called in main thread.
Assignee: nobody → gyeh
Attachment #717741 - Flags: review?(echou)
Comment on attachment 717741 [details] [diff] [review]
Patch 1(v1): Should send socket data in main thread

Review of attachment 717741 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.
Attachment #717741 - Flags: review?(echou) → review+
Try run for c02e596339cb is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=c02e596339cb
Results (out of 14 total builds):
    success: 14
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/gyeh@mozilla.com-c02e596339cb
Try run for 67782e6565d5 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=67782e6565d5
Results (out of 18 total builds):
    success: 17
    warnings: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/gyeh@mozilla.com-67782e6565d5
https://hg.mozilla.org/mozilla-central/rev/b0e002cb8693
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Why did the nsAutoArrayPtr go away? Looks like you'll leak if Read() fails.
Let's reopen it and fix it with a new patch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #718334 - Flags: review?(echou)
Attachment #718334 - Flags: feedback?(Ms2ger)
Comment on attachment 718334 [details] [diff] [review]
Patch 1(v2): Should send socket data in main thread

Review of attachment 718334 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks.

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +160,5 @@
>      MOZ_ASSERT(!NS_IsMainThread());
>  
>      uint32_t numRead;
> +    nsAutoArrayPtr<char> buf;
> +    buf = new char[mAvailablePacketSize];

You could also do

nsAutoArrayPtr<char> buf(new char[mAvailablePacketSize]);
Attachment #718334 - Flags: feedback?(Ms2ger) → feedback+
Attachment #718334 - Flags: review?(echou) → review+
https://hg.mozilla.org/mozilla-central/rev/94a4a675601e
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Requesting tef+ because this blocks 851046, see reasoning in https://bugzilla.mozilla.org/show_bug.cgi?id=851046#c50
blocking-b2g: --- → tef?
blocking-b2g: tef? → tef+
This is the b2g18-specific patch.
Backed out for build bustage.
https://hg.mozilla.org/releases/mozilla-b2g18/rev/24b27125d907
https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/89b4f2ae8807

https://tbpl.mozilla.org/php/getParsedLog.php?id=21542033&tree=Mozilla-B2g18_v1_0_1

/builds/slave/m-b18H1-ics_a7_g-d-00000000000/build/dom/bluetooth/BluetoothOppManager.cpp: In member function 'virtual nsresult SendSocketDataTask::Run()':
/builds/slave/m-b18H1-ics_a7_g-d-00000000000/build/dom/bluetooth/BluetoothOppManager.cpp:136: error: no matching function for call to 'mozilla::dom::bluetooth::BluetoothOppManager::SendPutRequest(nsAutoArrayPtr<unsigned char>&, uint32_t&)'
/builds/slave/m-b18H1-ics_a7_g-d-00000000000/build/dom/bluetooth/BluetoothOppManager.h:66: note: candidates are: void mozilla::dom::bluetooth::BluetoothOppManager::SendPutRequest(mozilla::ipc::UnixSocketImpl*, uint8_t*, int)
/builds/slave/m-b18H1-ics_a7_g-d-00000000000/build/dom/bluetooth/BluetoothOppManager.cpp: In member function 'virtual void ReadFileTask::Run()':
/builds/slave/m-b18H1-ics_a7_g-d-00000000000/build/dom/bluetooth/BluetoothOppManager.cpp:184: error: 'class nsAutoArrayPtr<char>' has no member named 'forgot'
/builds/slave/m-b18H1-ics_a7_g-d-00000000000/build/dom/bluetooth/BluetoothOppManager.cpp:187: error: return-statement with a value, in function returning 'void'
make[6]: *** [BluetoothOppManager.o] Error 1
Eric/gina: Why did the b2g18 patch need changes? The m-c patch came in cleanly if 845148 was backed out first (Which I forgot to add a patch to do here). Was there other things in it I was missing?
Comment on attachment 734743 [details] [diff] [review]
b2g18 patch 1: revert bug 845148

Adding revert patch just in case it is needed. If not, just r- and ignore me. However, we don't take it, we'll need to update the patches in 851046 because it doesn't expect the UnixSocketImpl* parameter in ReadFileTask.
Attachment #734743 - Flags: review?(echou)
Comment on attachment 734743 [details] [diff] [review]
b2g18 patch 1: revert bug 845148

Review of attachment 734743 [details] [diff] [review]:
-----------------------------------------------------------------

Please leave the first two hunks from UnixSocket.cpp out when you check this in, as they're still correct (leaving them shouldn't cause any more conflicts, either). So the only change to UnixSocket.cpp should be the removal of RawSendSocketData.
Attachment #734743 - Flags: review?(mrbkap) → review+
Already r+'d by mrbkap, updated with his nits.
Attachment #734743 - Attachment is obsolete: true
Attachment #734743 - Flags: review?(echou)
Attachment #734840 - Flags: review?(echou)
Attachment #734840 - Attachment description: b2g18 patch 1 (v2): revert bug 845148 → b2g18 patch 1 (v2): revert bug 845148; r=mrbkap
Adding a comment so we know why mReadFileThread came back. r=mrbkap via IRC.
Attachment #734840 - Flags: review?(echou) → review+
Attachment #734349 - Attachment is obsolete: true
Attachment #717798 - Attachment is obsolete: true
Attachment #734349 [details] [diff] shouldn't have been obsoleted. It still needs to be fixed and landed. 

I realize that probably wasn't obvious. This whole thing is a serious mess. :|
Attachment #734349 - Attachment is obsolete: false
Attachment #717798 - Attachment description: Final patch, Should send socket data in main thread, r=echou → m-c: Final patch, Should send socket data in main thread r=echou
Attachment #717798 - Attachment is obsolete: false
Attachment #718334 - Attachment is obsolete: true
Attachment #734349 - Attachment description: Final patch for b2g-18 branch, r=echou → b2g18 Patch 3 (v1): Should send socket data in main thread, r=echou
Fixing from forgot to forget. r=echou stands, plus r=me
Attachment #734349 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: