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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/sync/ChromiumSyncAdapterService.java

Issue 1144543009: [Android] Only invalidate objects that were received from Tango on resume. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +toString Created 5 years, 6 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 2013 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.sync;
6
7 import android.app.Application;
8 import android.app.Service;
9 import android.content.Context;
10 import android.content.Intent;
11 import android.os.IBinder;
12
13 public abstract class ChromiumSyncAdapterService extends Service {
14 private static ChromiumSyncAdapter sSyncAdapter = null;
15 private static final Object LOCK = new Object();
16
17 /**
18 * Get the sync adapter reference, creating an instance if necessary.
19 */
20 private ChromiumSyncAdapter getOrCreateSyncAdapter(Context applicationContex t) {
21 synchronized (LOCK) {
22 if (sSyncAdapter == null) {
23 sSyncAdapter = createChromiumSyncAdapter(applicationContext, get Application());
24 }
25 }
26 return sSyncAdapter;
27 }
28
29 @Override
30 public IBinder onBind(Intent intent) {
31 return getOrCreateSyncAdapter(getApplicationContext()).getSyncAdapterBin der();
32 }
33
34 protected abstract ChromiumSyncAdapter createChromiumSyncAdapter(Context app licationContext,
35 Application application);
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698