Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chrome.browser.physicalweb; | |
| 6 | |
| 7 import android.app.Application; | |
| 8 | |
| 9 import org.chromium.base.Log; | |
| 10 import org.chromium.chrome.browser.ChromeApplication; | |
| 11 | |
| 12 import java.util.concurrent.atomic.AtomicReference; | |
| 13 | |
| 14 /** | |
| 15 * This class provides the basic interface to the Physical Web feature. | |
| 16 */ | |
| 17 public class PhysicalWebBleClient { | |
|
jdduke (slow)
2015/09/15 16:46:39
What does "Ble" mean in the class name?
cco3
2015/09/16 17:41:28
Done.
| |
| 18 private static AtomicReference<PhysicalWebBleClient> sInstance = | |
|
jdduke (slow)
2015/09/15 16:46:39
Why atomic? Do you expect this to be used on multi
cco3
2015/09/16 17:41:28
It was just a pattern for singletons that I saw in
jdduke (slow)
2015/09/28 22:38:34
I think a common pattern is something like:
priva
cco3
2015/09/28 23:20:24
Done.
| |
| 19 new AtomicReference<PhysicalWebBleClient>(); | |
| 20 private static final String TAG = "cr.PhysicalWeb"; | |
| 21 | |
| 22 public static PhysicalWebBleClient getInstance(Application application) { | |
| 23 if (sInstance.get() == null) { | |
| 24 ChromeApplication chromeApplication = (ChromeApplication) applicatio n; | |
| 25 sInstance.compareAndSet(null, chromeApplication.createPhysicalWebBle Client()); | |
| 26 } | |
| 27 return sInstance.get(); | |
| 28 } | |
| 29 | |
| 30 void subscribe() { | |
| 31 Log.d(TAG, "subscribing in empty client"); | |
| 32 } | |
| 33 } | |
| OLD | NEW |