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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java

Issue 2325563003: [Offline Pages] Close race condition of multiple StartProcessing callers. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.offlinepages; 5 package org.chromium.chrome.browser.offlinepages;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Bundle; 8 import android.os.Bundle;
9 9
10 import org.chromium.base.ApplicationStatus; 10 import org.chromium.base.ApplicationStatus;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 */ 93 */
94 @Override 94 @Override
95 public void onResult(Boolean result) { 95 public void onResult(Boolean result) {
96 // Release the wake lock. 96 // Release the wake lock.
97 Log.d(TAG, "onProcessingDone"); 97 Log.d(TAG, "onProcessingDone");
98 waiter.onWaitDone(); 98 waiter.onWaitDone();
99 } 99 }
100 }; 100 };
101 101
102 // Pass the activation on to the bridge to the C++ RequestCoordinator. 102 // Pass the activation on to the bridge to the C++ RequestCoordinator.
103 mBridge.startProcessing(deviceConditions, callback); 103 if (!mBridge.startProcessing(deviceConditions, callback)) {
104 // Processing not started currently. Let callback know.
105 callback.onResult(false);
106 }
104 } 107 }
105 } 108 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698