mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1244944 - Remove old and crufty defer{Get,Put}. r=rnewman
This is safe because the single consumer of `MetaGlobal.fetch` is `FetchMetaGlobalStage.execute`, which already expects to be called on a thread and have another thread waiting for the callback. MozReview-Commit-ID: 5XXd5aBkljc
This commit is contained in:
parent
00374ca06a
commit
6903c86a8c
@ -56,7 +56,7 @@ public class MetaGlobal implements SyncStorageRequestDelegate {
|
||||
this.isUploading = false;
|
||||
SyncStorageRecordRequest r = new SyncStorageRecordRequest(this.metaURL);
|
||||
r.delegate = this;
|
||||
r.deferGet();
|
||||
r.get();
|
||||
} catch (URISyntaxException e) {
|
||||
this.callback.handleError(e);
|
||||
}
|
||||
|
@ -4,14 +4,13 @@
|
||||
|
||||
package org.mozilla.gecko.sync.net;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.mozilla.gecko.sync.CryptoRecord;
|
||||
import org.mozilla.gecko.sync.ThreadPool;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
/**
|
||||
* Resource class that implements expected headers and processing for Sync.
|
||||
@ -93,22 +92,4 @@ public class SyncStorageRecordRequest extends SyncStorageRequest {
|
||||
public void put(CryptoRecord record) {
|
||||
this.put(record.toJSONObject());
|
||||
}
|
||||
|
||||
public void deferGet() {
|
||||
final SyncStorageRecordRequest self = this;
|
||||
ThreadPool.run(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
self.get();
|
||||
}});
|
||||
}
|
||||
|
||||
public void deferPut(final JSONObject body) {
|
||||
final SyncStorageRecordRequest self = this;
|
||||
ThreadPool.run(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
self.put(body);
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user