Closed Bug 895325 Opened 6 years ago Closed 6 years ago

[Bluetooth][Cleanup] Revise BluetoothOppManager constructor and BluetoothOppManager::Get()

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ben.tian, Assigned: ben.tian)

Details

(Whiteboard: [fixed-in-birch])

Attachments

(2 files)

- Remove Init() in BluetoothOppManager constructor because BluetoothOppManager::Get() does it.
- Revise BluetoothOppManager::Get() function according to BluetoothHfpManager::Get().
- Rename variable 'sInstance' in BluetoothOppManager to 'sBluetoothOppManager'
- Rename all static 'g*' variables to 's*' ones.
- Remove Init() in BluetoothOppManager constructor because BluetoothOppManager::Get() does it.
- Revise BluetoothOppManager::Get() function according to BluetoothHfpManager::Get().
- Rename variable 'sInstance' in BluetoothOppManager to 'sBluetoothOppManager'
- Rename all static 'g*' variables to 's*' ones.
Attachment #777669 - Flags: review?(echou)
Comment on attachment 777669 [details] [diff] [review]
Patch 1: v1:  Revise opp consctructor and Get()

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

r=me with nits addressed. Besides, please remember to revise your patch title before checking it in. Thanks for cleaning up.

::: dom/bluetooth/BluetoothA2dpManager.cpp
@@ +100,5 @@
>  BluetoothA2dpManager::Get()
>  {
>    MOZ_ASSERT(NS_IsMainThread());
>  
>    // If we already exist, exit early

nit: s/we/sBluetoothA2dpManager

::: dom/bluetooth/BluetoothHfpManager.cpp
@@ +433,5 @@
>  BluetoothHfpManager::Get()
>  {
>    MOZ_ASSERT(NS_IsMainThread());
>  
>    // If we already exist, exit early

nit: s/we/sBluetoothHfpManager

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +209,5 @@
>  BluetoothOppManager::Get()
>  {
>    MOZ_ASSERT(NS_IsMainThread());
>  
> +  // If we already exist, exit early

nit: s/we/sBluetoothOppManager

@@ +220,5 @@
> +    NS_WARNING("BluetoothOppManager can't be created during shutdown");
> +    return nullptr;
> +  }
> +
> +  // Create new instance, register, return

nit: Create 'a' new instance
Attachment #777669 - Flags: review?(echou) → review+
https://hg.mozilla.org/mozilla-central/rev/126c0732c918
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.