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:
Nick Alexander 2016-01-19 16:20:37 -08:00
parent 00374ca06a
commit 6903c86a8c
2 changed files with 5 additions and 24 deletions

View File

@ -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);
}

View File

@ -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);
}});
}
}