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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.invalidation; 5 package org.chromium.chrome.browser.invalidation;
6 6
7 import android.content.Context;
8
9 import org.chromium.base.ThreadUtils; 7 import org.chromium.base.ThreadUtils;
10 import org.chromium.base.VisibleForTesting; 8 import org.chromium.base.VisibleForTesting;
11 import org.chromium.base.annotations.JNINamespace; 9 import org.chromium.base.annotations.JNINamespace;
12 import org.chromium.chrome.browser.profiles.Profile; 10 import org.chromium.chrome.browser.profiles.Profile;
13 import org.chromium.components.invalidation.InvalidationService; 11 import org.chromium.components.invalidation.InvalidationService;
14 12
15 import java.util.HashMap; 13 import java.util.HashMap;
16 import java.util.Map; 14 import java.util.Map;
17 15
18 /** 16 /**
(...skipping 17 matching lines...) Expand all
36 ThreadUtils.assertOnUiThread(); 34 ThreadUtils.assertOnUiThread();
37 InvalidationService service = sServiceMap.get(profile); 35 InvalidationService service = sServiceMap.get(profile);
38 if (service == null) { 36 if (service == null) {
39 service = nativeGetForProfile(profile); 37 service = nativeGetForProfile(profile);
40 sServiceMap.put(profile, service); 38 sServiceMap.put(profile, service);
41 } 39 }
42 return service; 40 return service;
43 } 41 }
44 42
45 @VisibleForTesting 43 @VisibleForTesting
46 public static InvalidationService getForTest(Context context) { 44 public static InvalidationService getForTest() {
47 return nativeGetForTest(context); 45 return nativeGetForTest();
48 } 46 }
49 47
50 private static native InvalidationService nativeGetForProfile(Profile profil e); 48 private static native InvalidationService nativeGetForProfile(Profile profil e);
51 private static native InvalidationService nativeGetForTest(Context context); 49 private static native InvalidationService nativeGetForTest();
52 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698