Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java

Issue 1326593006: Add the Physical Web to Chrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add UrlManager class Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698