Backed out changeset 45b5cadadc22 (bug 1372426) because it's blocking a backout a=backout

MozReview-Commit-ID: Jl0zxef8R9k
This commit is contained in:
Wes Kocher 2017-06-13 17:48:38 -07:00
parent f83d89fc9f
commit e883883e7c
13 changed files with 18 additions and 32 deletions

View File

@ -483,8 +483,7 @@ nsBMPEncoder::NotifyListener()
mNotifyThreshold || mFinished)) {
nsCOMPtr<nsIInputStreamCallback> callback;
if (mCallbackTarget) {
callback = NS_NewInputStreamReadyEvent("nsBMPEncoder::NotifyListener",
mCallback, mCallbackTarget);
callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
} else {
callback = mCallback;
}

View File

@ -442,8 +442,7 @@ nsICOEncoder::NotifyListener()
mImageBufferReadPoint >= mNotifyThreshold || mFinished)) {
nsCOMPtr<nsIInputStreamCallback> callback;
if (mCallbackTarget) {
callback = NS_NewInputStreamReadyEvent("nsICOEncoder::NotifyListener",
mCallback, mCallbackTarget);
callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
} else {
callback = mCallback;
}

View File

@ -515,8 +515,7 @@ nsJPEGEncoder::NotifyListener()
mFinished)) {
nsCOMPtr<nsIInputStreamCallback> callback;
if (mCallbackTarget) {
callback = NS_NewInputStreamReadyEvent("nsJPEGEncoder::NotifyListener",
mCallback, mCallbackTarget);
callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
} else {
callback = mCallback;
}

View File

@ -741,8 +741,7 @@ nsPNGEncoder::NotifyListener()
mFinished)) {
nsCOMPtr<nsIInputStreamCallback> callback;
if (mCallbackTarget) {
callback = NS_NewInputStreamReadyEvent("nsPNGEncoder::NotifyListener",
mCallback, mCallbackTarget);
callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
} else {
callback = mCallback;
}

View File

@ -226,8 +226,7 @@ ThrottleInputStream::AllowInput()
{
MOZ_ASSERT(mCallback);
nsCOMPtr<nsIInputStreamCallback> callbackEvent =
NS_NewInputStreamReadyEvent("ThrottleInputStream::AllowInput",
mCallback, mEventTarget);
NS_NewInputStreamReadyEvent(mCallback, mEventTarget);
mCallback = nullptr;
mEventTarget = nullptr;
callbackEvent->OnInputStreamReady(this);

View File

@ -19,8 +19,7 @@ nsBaseContentStream::DispatchCallback(bool async)
nsCOMPtr<nsIInputStreamCallback> callback;
if (async) {
callback = NS_NewInputStreamReadyEvent("nsBaseContentStream::DispatchCallback",
mCallback, mCallbackTarget);
callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
mCallback = nullptr;
} else {
callback.swap(mCallback);

View File

@ -486,8 +486,7 @@ nsSocketInputStream::AsyncWait(nsIInputStreamCallback *callback,
//
// build event proxy
//
mCallback = NS_NewInputStreamReadyEvent("nsSocketInputStream::AsyncWait",
callback, target);
mCallback = NS_NewInputStreamReadyEvent(callback, target);
}
else
mCallback = callback;

View File

@ -635,8 +635,7 @@ CacheFileInputStream::NotifyListener()
}
nsCOMPtr<nsIInputStreamCallback> asyncCallback =
NS_NewInputStreamReadyEvent("CacheFileInputStream::NotifyListener",
mCallback, mCallbackTarget);
NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
mCallback = nullptr;
mCallbackTarget = nullptr;

View File

@ -212,8 +212,7 @@ void AndroidCameraInputStream::NotifyListeners() {
if (mCallback && (mAvailable > sizeof(RawVideoHeader))) {
nsCOMPtr<nsIInputStreamCallback> callback;
if (mCallbackTarget) {
callback = NS_NewInputStreamReadyEvent("AndroidCameraInputStream::NotifyListeners",
mCallback, mCallbackTarget);
callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
} else {
callback = mCallback;
}

View File

@ -1493,8 +1493,7 @@ nsPipeInputStream::AsyncWait(nsIInputStreamCallback* aCallback,
nsCOMPtr<nsIInputStreamCallback> proxy;
if (aTarget) {
proxy = NS_NewInputStreamReadyEvent("nsPipeInputStream::AsyncWait",
aCallback, aTarget);
proxy = NS_NewInputStreamReadyEvent(aCallback, aTarget);
aCallback = proxy;
}

View File

@ -36,10 +36,9 @@ class nsInputStreamReadyEvent final
public:
NS_DECL_ISUPPORTS_INHERITED
nsInputStreamReadyEvent(const char* aName,
nsIInputStreamCallback* aCallback,
nsIEventTarget* aTarget)
: CancelableRunnable(aName)
nsInputStreamReadyEvent(nsIInputStreamCallback* aCallback,
nsIEventTarget* aTarget)
: CancelableRunnable("nsInputStreamReadyEvent")
, mCallback(aCallback)
, mTarget(aTarget)
{
@ -62,7 +61,7 @@ private:
nsresult rv = mTarget->IsOnCurrentThread(&val);
if (NS_FAILED(rv) || !val) {
nsCOMPtr<nsIInputStreamCallback> event =
NS_NewInputStreamReadyEvent("~nsInputStreamReadyEvent", mCallback, mTarget);
NS_NewInputStreamReadyEvent(mCallback, mTarget);
mCallback = nullptr;
if (event) {
rv = event->OnInputStreamReady(nullptr);
@ -210,14 +209,13 @@ NS_IMPL_ISUPPORTS_INHERITED(nsOutputStreamReadyEvent, CancelableRunnable,
//-----------------------------------------------------------------------------
already_AddRefed<nsIInputStreamCallback>
NS_NewInputStreamReadyEvent(const char* aName,
nsIInputStreamCallback* aCallback,
NS_NewInputStreamReadyEvent(nsIInputStreamCallback* aCallback,
nsIEventTarget* aTarget)
{
NS_ASSERTION(aCallback, "null callback");
NS_ASSERTION(aTarget, "null target");
RefPtr<nsInputStreamReadyEvent> ev =
new nsInputStreamReadyEvent(aName, aCallback, aTarget);
new nsInputStreamReadyEvent(aCallback, aTarget);
return ev.forget();
}

View File

@ -28,8 +28,7 @@ class nsIEventTarget;
* aTarget parameter is non-null.
*/
extern already_AddRefed<nsIInputStreamCallback>
NS_NewInputStreamReadyEvent(const char* aName,
nsIInputStreamCallback* aNotify,
NS_NewInputStreamReadyEvent(nsIInputStreamCallback* aNotify,
nsIEventTarget* aTarget);
/**

View File

@ -450,8 +450,7 @@ nsStringInputStream::AsyncWait(nsIInputStreamCallback* aCallback,
}
if (aEventTarget) {
mAsyncWaitCallback = NS_NewInputStreamReadyEvent("nsStringInputStream::AsyncWait",
aCallback, aEventTarget);
mAsyncWaitCallback = NS_NewInputStreamReadyEvent(aCallback, aEventTarget);
} else {
mAsyncWaitCallback = aCallback;
}