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

Side by Side Diff: chrome/browser/android/background_sync_launcher_android.cc

Issue 2580503002: Revert of Android: Switch to thread pool executor (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/android/background_sync_launcher_android.h" 5 #include "chrome/browser/android/background_sync_launcher_android.h"
6 6
7 #include "base/android/context_utils.h" 7 #include "base/android/context_utils.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "jni/BackgroundSyncLauncher_jni.h" 9 #include "jni/BackgroundSyncLauncher_jni.h"
10 10
(...skipping 26 matching lines...) Expand all
37 Get()->LaunchBrowserIfStoppedImpl(launch_when_next_online, min_delay_ms); 37 Get()->LaunchBrowserIfStoppedImpl(launch_when_next_online, min_delay_ms);
38 } 38 }
39 39
40 void BackgroundSyncLauncherAndroid::LaunchBrowserIfStoppedImpl( 40 void BackgroundSyncLauncherAndroid::LaunchBrowserIfStoppedImpl(
41 bool launch_when_next_online, 41 bool launch_when_next_online,
42 int64_t min_delay_ms) { 42 int64_t min_delay_ms) {
43 DCHECK_CURRENTLY_ON(BrowserThread::UI); 43 DCHECK_CURRENTLY_ON(BrowserThread::UI);
44 44
45 JNIEnv* env = base::android::AttachCurrentThread(); 45 JNIEnv* env = base::android::AttachCurrentThread();
46 Java_BackgroundSyncLauncher_launchBrowserIfStopped( 46 Java_BackgroundSyncLauncher_launchBrowserIfStopped(
47 env, java_launcher_, launch_when_next_online, min_delay_ms); 47 env, java_launcher_, base::android::GetApplicationContext(),
48 launch_when_next_online, min_delay_ms);
48 } 49 }
49 50
50 // static 51 // static
51 void BackgroundSyncLauncherAndroid::SetPlayServicesVersionCheckDisabledForTests( 52 void BackgroundSyncLauncherAndroid::SetPlayServicesVersionCheckDisabledForTests(
52 bool disabled) { 53 bool disabled) {
53 DCHECK_CURRENTLY_ON(BrowserThread::UI); 54 DCHECK_CURRENTLY_ON(BrowserThread::UI);
54 disable_play_services_version_check_for_tests = disabled; 55 disable_play_services_version_check_for_tests = disabled;
55 } 56 }
56 57
57 // static 58 // static
(...skipping 14 matching lines...) Expand all
72 java_launcher_.Reset(Java_BackgroundSyncLauncher_create( 73 java_launcher_.Reset(Java_BackgroundSyncLauncher_create(
73 env, base::android::GetApplicationContext())); 74 env, base::android::GetApplicationContext()));
74 } 75 }
75 76
76 BackgroundSyncLauncherAndroid::~BackgroundSyncLauncherAndroid() { 77 BackgroundSyncLauncherAndroid::~BackgroundSyncLauncherAndroid() {
77 DCHECK_CURRENTLY_ON(BrowserThread::UI); 78 DCHECK_CURRENTLY_ON(BrowserThread::UI);
78 79
79 JNIEnv* env = base::android::AttachCurrentThread(); 80 JNIEnv* env = base::android::AttachCurrentThread();
80 Java_BackgroundSyncLauncher_destroy(env, java_launcher_); 81 Java_BackgroundSyncLauncher_destroy(env, java_launcher_);
81 } 82 }
OLDNEW
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698