Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java | 
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..31e25ad9d80056e0058e6e6238a58a1f92afc755 | 
| --- /dev/null | 
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java | 
| @@ -0,0 +1,33 @@ | 
| +// Copyright 2015 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +package org.chromium.chrome.browser.physicalweb; | 
| + | 
| +import android.app.Application; | 
| + | 
| +import org.chromium.base.Log; | 
| +import org.chromium.chrome.browser.ChromeApplication; | 
| + | 
| +import java.util.concurrent.atomic.AtomicReference; | 
| + | 
| +/** | 
| + * This class provides the basic interface to the Physical Web feature. | 
| + */ | 
| +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.
 
 | 
| + 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.
 
 | 
| + new AtomicReference<PhysicalWebBleClient>(); | 
| + private static final String TAG = "cr.PhysicalWeb"; | 
| + | 
| + public static PhysicalWebBleClient getInstance(Application application) { | 
| + if (sInstance.get() == null) { | 
| + ChromeApplication chromeApplication = (ChromeApplication) application; | 
| + sInstance.compareAndSet(null, chromeApplication.createPhysicalWebBleClient()); | 
| + } | 
| + return sInstance.get(); | 
| + } | 
| + | 
| + void subscribe() { | 
| + Log.d(TAG, "subscribing in empty client"); | 
| + } | 
| +} |