зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D22514
This commit is contained in:
Родитель
bc278165ae
Коммит
4aa92e3091
|
@ -176,8 +176,8 @@ static mozilla::UniquePtr<char[]> WideToUTF8(const wchar_t* aStr,
|
|||
// WideCharToMultiByte fail in that unlikely case.
|
||||
size_t cvtLen = std::min(aStrLenExclNul, kMaxStrLen);
|
||||
|
||||
int numConv = ::WideCharToMultiByte(CP_UTF8, 0, aStr, cvtLen, nullptr,
|
||||
0, nullptr, nullptr);
|
||||
int numConv = ::WideCharToMultiByte(CP_UTF8, 0, aStr, cvtLen, nullptr, 0,
|
||||
nullptr, nullptr);
|
||||
if (!numConv) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -185,8 +185,8 @@ static mozilla::UniquePtr<char[]> WideToUTF8(const wchar_t* aStr,
|
|||
// Include room for the null terminator by adding one
|
||||
auto buf = mozilla::MakeUnique<char[]>(numConv + 1);
|
||||
|
||||
numConv = ::WideCharToMultiByte(CP_UTF8, 0, aStr, cvtLen, buf.get(),
|
||||
numConv, nullptr, nullptr);
|
||||
numConv = ::WideCharToMultiByte(CP_UTF8, 0, aStr, cvtLen, buf.get(), numConv,
|
||||
nullptr, nullptr);
|
||||
if (!numConv) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ static mozilla::UniquePtr<char[]> WideToUTF8(const std::wstring& aStr) {
|
|||
}
|
||||
|
||||
// MinGW does not support the Windows Security Center APIs.
|
||||
#if !defined(__MINGW32__)
|
||||
# if !defined(__MINGW32__)
|
||||
|
||||
static mozilla::UniquePtr<char[]> WideToUTF8(const _bstr_t& aStr) {
|
||||
return WideToUTF8(static_cast<const wchar_t*>(aStr), aStr.length());
|
||||
|
@ -327,7 +327,7 @@ static bool AddWscInfo(mozilla::JSONWriter& aJson) {
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif // !defined(__MINGW32__)
|
||||
# endif // !defined(__MINGW32__)
|
||||
|
||||
// Max array length for telemetry intake.
|
||||
static const size_t kMaxArrayLen = 1000;
|
||||
|
@ -452,16 +452,15 @@ struct PingThreadContext {
|
|||
|
||||
} // anonymous namespace
|
||||
|
||||
static bool PrepPing(const PingThreadContext& aContext,
|
||||
const std::wstring& aId,
|
||||
static bool PrepPing(const PingThreadContext& aContext, const std::wstring& aId,
|
||||
mozilla::JSONWriter& aJson) {
|
||||
#if defined(DEBUG)
|
||||
# if defined(DEBUG)
|
||||
const mozilla::JSONWriter::CollectionStyle style =
|
||||
mozilla::JSONWriter::MultiLineStyle;
|
||||
#else
|
||||
# else
|
||||
const mozilla::JSONWriter::CollectionStyle style =
|
||||
mozilla::JSONWriter::SingleLineStyle;
|
||||
#endif // defined(DEBUG)
|
||||
# endif // defined(DEBUG)
|
||||
|
||||
aJson.Start(style);
|
||||
|
||||
|
@ -563,11 +562,11 @@ static bool PrepPing(const PingThreadContext& aContext,
|
|||
aJson.IntProperty("hresult", aContext.mLauncherError.mError.AsHResult());
|
||||
aJson.EndObject();
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
# if !defined(__MINGW32__)
|
||||
if (!AddWscInfo(aJson)) {
|
||||
return false;
|
||||
}
|
||||
#endif // !defined(__MINGW32__)
|
||||
# endif // !defined(__MINGW32__)
|
||||
|
||||
if (!AddModuleInfo(aContext.mModulesSnapshot, aJson)) {
|
||||
return false;
|
||||
|
@ -682,7 +681,7 @@ static unsigned __stdcall SendPingThread(void* aContext) {
|
|||
|
||||
static bool SendPing(const mozilla::LauncherError& aError) {
|
||||
#if defined(MOZ_TELEMETRY_REPORTING)
|
||||
#if defined(MOZ_LAUNCHER_PROCESS)
|
||||
# if defined(MOZ_LAUNCHER_PROCESS)
|
||||
mozilla::LauncherRegistryInfo regInfo;
|
||||
mozilla::LauncherResult<mozilla::LauncherRegistryInfo::EnabledState>
|
||||
launcherEnabled = regInfo.IsEnabled();
|
||||
|
@ -693,7 +692,7 @@ static bool SendPing(const mozilla::LauncherError& aError) {
|
|||
// (since studies and thus telemetry have been opted out)
|
||||
return false;
|
||||
}
|
||||
#endif // defined(MOZ_LAUNCHER_PROCESS)
|
||||
# endif // defined(MOZ_LAUNCHER_PROCESS)
|
||||
|
||||
// We send this ping when the launcher process fails. After we start the
|
||||
// SendPingThread, this thread falls back from running as the launcher process
|
||||
|
@ -745,8 +744,6 @@ void SetLauncherErrorAppData(const StaticXREAppData& aAppData) {
|
|||
gAppData = &aAppData;
|
||||
}
|
||||
|
||||
void SetLauncherErrorForceEventLog() {
|
||||
gForceEventLog = true;
|
||||
}
|
||||
void SetLauncherErrorForceEventLog() { gForceEventLog = true; }
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -411,8 +411,7 @@ static nsresult GetSpecialBaseDomain(const nsCOMPtr<nsIURI>& aCodebase,
|
|||
}
|
||||
|
||||
bool isBehaved;
|
||||
if (NS_SUCCEEDED(aCodebase->SchemeIs("indexeddb", &isBehaved)) &&
|
||||
isBehaved) {
|
||||
if (NS_SUCCEEDED(aCodebase->SchemeIs("indexeddb", &isBehaved)) && isBehaved) {
|
||||
*aHandled = true;
|
||||
return aCodebase->GetSpec(aBaseDomain);
|
||||
}
|
||||
|
|
|
@ -327,21 +327,17 @@ nsresult nsPingListener::StartTimeout(DocGroup* aDocGroup) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPingListener::OnStartRequest(nsIRequest* aRequest) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsPingListener::OnStartRequest(nsIRequest* aRequest) { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPingListener::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
nsPingListener::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
uint32_t result;
|
||||
return aStream->ReadSegments(NS_DiscardSegment, nullptr, aCount, &result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPingListener::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
nsPingListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
mLoadGroup = nullptr;
|
||||
|
||||
if (mTimer) {
|
||||
|
|
|
@ -203,8 +203,7 @@ already_AddRefed<Document> DOMParser::ParseFromStream(nsIInputStream* aStream,
|
|||
parserChannel->GetStatus(&status);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(status)) {
|
||||
rv = listener->OnDataAvailable(parserChannel, stream, 0,
|
||||
aContentLength);
|
||||
rv = listener->OnDataAvailable(parserChannel, stream, 0, aContentLength);
|
||||
if (NS_FAILED(rv)) parserChannel->Cancel(rv);
|
||||
parserChannel->GetStatus(&status);
|
||||
}
|
||||
|
|
|
@ -992,8 +992,7 @@ ExternalResourceMap::PendingLoad::OnDataAvailable(nsIRequest* aRequest,
|
|||
if (mDisplayDocument->ExternalResourceMap().HaveShutDown()) {
|
||||
return NS_BINDING_ABORTED;
|
||||
}
|
||||
return mTargetListener->OnDataAvailable(aRequest, aStream, aOffset,
|
||||
aCount);
|
||||
return mTargetListener->OnDataAvailable(aRequest, aStream, aOffset, aCount);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -730,8 +730,7 @@ EventSourceImpl::OnDataAvailable(nsIRequest* aRequest,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
EventSourceImpl::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatusCode) {
|
||||
EventSourceImpl::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
|
||||
AssertIsOnMainThread();
|
||||
|
||||
if (IsClosed()) {
|
||||
|
|
|
@ -538,20 +538,23 @@ void ScreenOrientation::UpdateActiveOrientationLock(
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> ScreenOrientation::DispatchChangeEventAndResolvePromise() {
|
||||
nsCOMPtr<nsIRunnable>
|
||||
ScreenOrientation::DispatchChangeEventAndResolvePromise() {
|
||||
RefPtr<Document> doc = GetResponsibleDocument();
|
||||
RefPtr<ScreenOrientation> self = this;
|
||||
return NS_NewRunnableFunction("dom::ScreenOrientation::DispatchChangeEvent", [self, doc]() {
|
||||
DebugOnly<nsresult> rv = self->DispatchTrustedEvent(NS_LITERAL_STRING("change"));
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "DispatchTrustedEvent failed");
|
||||
if (doc) {
|
||||
Promise* pendingPromise = doc->GetOrientationPendingPromise();
|
||||
if (pendingPromise) {
|
||||
pendingPromise->MaybeResolveWithUndefined();
|
||||
doc->SetOrientationPendingPromise(nullptr);
|
||||
}
|
||||
}
|
||||
});
|
||||
return NS_NewRunnableFunction(
|
||||
"dom::ScreenOrientation::DispatchChangeEvent", [self, doc]() {
|
||||
DebugOnly<nsresult> rv =
|
||||
self->DispatchTrustedEvent(NS_LITERAL_STRING("change"));
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "DispatchTrustedEvent failed");
|
||||
if (doc) {
|
||||
Promise* pendingPromise = doc->GetOrientationPendingPromise();
|
||||
if (pendingPromise) {
|
||||
pendingPromise->MaybeResolveWithUndefined();
|
||||
doc->SetOrientationPendingPromise(nullptr);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
JSObject* ScreenOrientation::WrapObject(JSContext* aCx,
|
||||
|
@ -604,7 +607,8 @@ ScreenOrientation::VisibleEventListener::HandleEvent(Event* aEvent) {
|
|||
doc->SetCurrentOrientation(orientation->DeviceType(CallerType::System),
|
||||
orientation->DeviceAngle(CallerType::System));
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable = orientation->DispatchChangeEventAndResolvePromise();
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
orientation->DispatchChangeEventAndResolvePromise();
|
||||
rv = NS_DispatchToMainThread(runnable);
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
return rv.StealNSResult();
|
||||
|
|
|
@ -7238,8 +7238,7 @@ nsresult nsContentUtils::IPCTransferableToTransferable(
|
|||
const IPCDataTransfer& aDataTransfer, const bool& aIsPrivateData,
|
||||
nsIPrincipal* aRequestingPrincipal,
|
||||
const nsContentPolicyType& aContentPolicyType,
|
||||
nsITransferable* aTransferable,
|
||||
mozilla::dom::ContentParent* aContentParent,
|
||||
nsITransferable* aTransferable, mozilla::dom::ContentParent* aContentParent,
|
||||
mozilla::dom::TabChild* aTabChild) {
|
||||
nsresult rv;
|
||||
|
||||
|
|
|
@ -2845,8 +2845,7 @@ class nsContentUtils {
|
|||
static void TransferableToIPCTransferable(
|
||||
nsITransferable* aTransferable,
|
||||
mozilla::dom::IPCDataTransfer* aIPCDataTransfer, bool aInSyncMessage,
|
||||
mozilla::dom::ContentChild* aChild,
|
||||
mozilla::dom::ContentParent* aParent);
|
||||
mozilla::dom::ContentChild* aChild, mozilla::dom::ContentParent* aParent);
|
||||
|
||||
/*
|
||||
* Get the pixel data from the given source surface and return it as a buffer.
|
||||
|
|
|
@ -476,8 +476,8 @@ nsresult nsClipboardCommand::IsCommandEnabled(const char *aCommandName,
|
|||
NS_ENSURE_ARG_POINTER(outCmdEnabled);
|
||||
*outCmdEnabled = false;
|
||||
|
||||
if (strcmp(aCommandName, "cmd_copy") &&
|
||||
strcmp(aCommandName, "cmd_cut") && strcmp(aCommandName, "cmd_paste")) {
|
||||
if (strcmp(aCommandName, "cmd_copy") && strcmp(aCommandName, "cmd_cut") &&
|
||||
strcmp(aCommandName, "cmd_paste")) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1078,10 +1078,10 @@ class nsINode : public mozilla::dom::EventTarget {
|
|||
}
|
||||
|
||||
void UnsetFlags(FlagsType aFlagsToUnset) {
|
||||
NS_ASSERTION(!(aFlagsToUnset & (NODE_IS_ANONYMOUS_ROOT |
|
||||
NODE_HAS_BEEN_IN_UA_WIDGET |
|
||||
NODE_IS_NATIVE_ANONYMOUS_ROOT)),
|
||||
"Trying to unset write-only flags");
|
||||
NS_ASSERTION(
|
||||
!(aFlagsToUnset & (NODE_IS_ANONYMOUS_ROOT | NODE_HAS_BEEN_IN_UA_WIDGET |
|
||||
NODE_IS_NATIVE_ANONYMOUS_ROOT)),
|
||||
"Trying to unset write-only flags");
|
||||
nsWrapperCache::UnsetFlags(aFlagsToUnset);
|
||||
}
|
||||
|
||||
|
|
|
@ -524,8 +524,9 @@ void nsObjectLoadingContent::SetupFrameLoader(int32_t aJSPluginId) {
|
|||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
|
||||
mFrameLoader = nsFrameLoader::Create(thisContent->AsElement(),
|
||||
/* aOpener = */ nullptr, mNetworkCreated);
|
||||
mFrameLoader =
|
||||
nsFrameLoader::Create(thisContent->AsElement(),
|
||||
/* aOpener = */ nullptr, mNetworkCreated);
|
||||
MOZ_ASSERT(mFrameLoader, "nsFrameLoader::Create failed");
|
||||
}
|
||||
|
||||
|
@ -1056,8 +1057,8 @@ nsObjectLoadingContent::OnDataAvailable(nsIRequest* aRequest,
|
|||
if (mFinalListener) {
|
||||
// This may re-enter in the case of plugin listeners
|
||||
nsCOMPtr<nsIStreamListener> listenerGrip(mFinalListener);
|
||||
return listenerGrip->OnDataAvailable(aRequest, aInputStream,
|
||||
aOffset, aCount);
|
||||
return listenerGrip->OnDataAvailable(aRequest, aInputStream, aOffset,
|
||||
aCount);
|
||||
}
|
||||
|
||||
// We shouldn't have a connected channel with no final listener
|
||||
|
@ -2156,7 +2157,9 @@ nsresult nsObjectLoadingContent::LoadObject(bool aNotify, bool aForceLoad,
|
|||
break;
|
||||
case eType_FakePlugin:
|
||||
// We're now in the process of removing FakePlugin. See bug 1529133.
|
||||
MOZ_CRASH("Shouldn't reach here! This means there's a fakeplugin trying to be loaded.");
|
||||
MOZ_CRASH(
|
||||
"Shouldn't reach here! This means there's a fakeplugin trying to be "
|
||||
"loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -101,8 +101,7 @@ nsForceXMLListener::OnStartRequest(nsIRequest *aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsForceXMLListener::OnStopRequest(nsIRequest *aRequest,
|
||||
nsresult aStatusCode) {
|
||||
nsForceXMLListener::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) {
|
||||
return mListener->OnStopRequest(aRequest, aStatusCode);
|
||||
}
|
||||
|
||||
|
@ -244,8 +243,7 @@ nsSyncLoader::OnStartRequest(nsIRequest *aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSyncLoader::OnStopRequest(nsIRequest *aRequest,
|
||||
nsresult aStatusCode) {
|
||||
nsSyncLoader::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) {
|
||||
if (NS_SUCCEEDED(mAsyncLoadStatus) && NS_FAILED(aStatusCode)) {
|
||||
mAsyncLoadStatus = aStatusCode;
|
||||
}
|
||||
|
@ -346,8 +344,7 @@ nsresult nsSyncLoadService::PushSyncStreamToListener(
|
|||
if (readCount > UINT32_MAX) readCount = UINT32_MAX;
|
||||
|
||||
rv = aListener->OnDataAvailable(
|
||||
aChannel, in,
|
||||
(uint32_t)std::min(sourceOffset, (uint64_t)UINT32_MAX),
|
||||
aChannel, in, (uint32_t)std::min(sourceOffset, (uint64_t)UINT32_MAX),
|
||||
(uint32_t)readCount);
|
||||
if (NS_FAILED(rv)) {
|
||||
break;
|
||||
|
|
|
@ -462,8 +462,8 @@ int32_t JSStackFrame::GetSourceId(JSContext* aCx) {
|
|||
|
||||
uint32_t id;
|
||||
bool canCache = false, useCachedValue = false;
|
||||
GetValueIfNotCached(aCx, mStack, JS::GetSavedFrameSourceId, mSourceIdInitialized,
|
||||
&canCache, &useCachedValue, &id);
|
||||
GetValueIfNotCached(aCx, mStack, JS::GetSavedFrameSourceId,
|
||||
mSourceIdInitialized, &canCache, &useCachedValue, &id);
|
||||
|
||||
if (useCachedValue) {
|
||||
return mSourceId;
|
||||
|
|
|
@ -406,15 +406,17 @@ bool nsScriptErrorBase::ComputeIsFromPrivateWindow(
|
|||
NS_IMPL_ISUPPORTS(nsScriptError, nsIConsoleMessage, nsIScriptError)
|
||||
|
||||
nsScriptErrorNote::nsScriptErrorNote()
|
||||
: mMessage(), mSourceName(), mSourceId(0), mLineNumber(0), mColumnNumber(0) {}
|
||||
: mMessage(),
|
||||
mSourceName(),
|
||||
mSourceId(0),
|
||||
mLineNumber(0),
|
||||
mColumnNumber(0) {}
|
||||
|
||||
nsScriptErrorNote::~nsScriptErrorNote() {}
|
||||
|
||||
void nsScriptErrorNote::Init(const nsAString& message,
|
||||
const nsAString& sourceName,
|
||||
uint32_t sourceId,
|
||||
uint32_t lineNumber,
|
||||
uint32_t columnNumber) {
|
||||
const nsAString& sourceName, uint32_t sourceId,
|
||||
uint32_t lineNumber, uint32_t columnNumber) {
|
||||
mMessage.Assign(message);
|
||||
AssignSourceNameHelper(mSourceName, sourceName);
|
||||
mSourceId = sourceId;
|
||||
|
|
|
@ -2502,9 +2502,9 @@ nsresult ReadResponse(mozIStorageConnection* aConn, EntryId aEntryId,
|
|||
}
|
||||
|
||||
aSavedResponseOut->mValue.principalInfo() =
|
||||
Some(mozilla::ipc::ContentPrincipalInfo(
|
||||
attrs, origin, specNoSuffix, Nothing(), std::move(policies),
|
||||
baseDomain));
|
||||
Some(mozilla::ipc::ContentPrincipalInfo(attrs, origin, specNoSuffix,
|
||||
Nothing(), std::move(policies),
|
||||
baseDomain));
|
||||
}
|
||||
|
||||
bool nullPadding = false;
|
||||
|
|
|
@ -44,8 +44,7 @@ struct ImageCacheEntryData {
|
|||
mSourceSurface(aOther.mSourceSurface),
|
||||
mSize(aOther.mSize) {}
|
||||
explicit ImageCacheEntryData(const ImageCacheKey& aKey)
|
||||
: mImage(aKey.mImage),
|
||||
mCanvas(aKey.mCanvas) {}
|
||||
: mImage(aKey.mImage), mCanvas(aKey.mCanvas) {}
|
||||
|
||||
nsExpirationState* GetExpirationState() { return &mState; }
|
||||
size_t SizeInBytes() { return mSize.width * mSize.height * 4; }
|
||||
|
@ -87,8 +86,7 @@ class ImageCacheEntry : public PLDHashEntryHdr {
|
|||
* Used for all images across all canvases.
|
||||
*/
|
||||
struct AllCanvasImageCacheKey {
|
||||
explicit AllCanvasImageCacheKey(imgIContainer* aImage)
|
||||
: mImage(aImage) {}
|
||||
explicit AllCanvasImageCacheKey(imgIContainer* aImage) : mImage(aImage) {}
|
||||
|
||||
nsCOMPtr<imgIContainer> mImage;
|
||||
};
|
||||
|
@ -102,14 +100,11 @@ class AllCanvasImageCacheEntry : public PLDHashEntryHdr {
|
|||
: mImage(aKey->mImage) {}
|
||||
|
||||
AllCanvasImageCacheEntry(const AllCanvasImageCacheEntry& toCopy)
|
||||
: mImage(toCopy.mImage),
|
||||
mSourceSurface(toCopy.mSourceSurface) {}
|
||||
: mImage(toCopy.mImage), mSourceSurface(toCopy.mSourceSurface) {}
|
||||
|
||||
~AllCanvasImageCacheEntry() {}
|
||||
|
||||
bool KeyEquals(KeyTypePointer key) const {
|
||||
return mImage == key->mImage;
|
||||
}
|
||||
bool KeyEquals(KeyTypePointer key) const { return mImage == key->mImage; }
|
||||
|
||||
static KeyTypePointer KeyToPointer(KeyType& key) { return &key; }
|
||||
static PLDHashNumber HashKey(KeyTypePointer key) {
|
||||
|
@ -139,8 +134,7 @@ class ImageCache final : public nsExpirationTracker<ImageCacheEntryData, 4> {
|
|||
|
||||
// Remove from the all canvas cache entry first since nsExpirationTracker
|
||||
// will delete aObject.
|
||||
mAllCanvasCache.RemoveEntry(
|
||||
AllCanvasImageCacheKey(aObject->mImage));
|
||||
mAllCanvasCache.RemoveEntry(AllCanvasImageCacheKey(aObject->mImage));
|
||||
|
||||
// Deleting the entry will delete aObject since the entry owns aObject.
|
||||
mCache.RemoveEntry(ImageCacheKey(aObject->mImage, aObject->mCanvas));
|
||||
|
@ -337,8 +331,8 @@ SourceSurface* CanvasImageCache::LookupCanvas(Element* aImage,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ImageCacheEntry* entry = gImageCache->mCache.GetEntry(
|
||||
ImageCacheKey(imgContainer, aCanvas));
|
||||
ImageCacheEntry* entry =
|
||||
gImageCache->mCache.GetEntry(ImageCacheKey(imgContainer, aCanvas));
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,8 @@ class CanvasImageCache {
|
|||
*/
|
||||
static void NotifyDrawImage(dom::Element* aImage,
|
||||
dom::HTMLCanvasElement* aCanvas,
|
||||
SourceSurface* aSource, const gfx::IntSize& aSize);
|
||||
SourceSurface* aSource,
|
||||
const gfx::IntSize& aSize);
|
||||
|
||||
/**
|
||||
* Check whether aImage has recently been drawn any canvas. If we return
|
||||
|
|
|
@ -607,9 +607,8 @@ class CanvasRenderingContext2D final : public nsICanvasRenderingContextInternal,
|
|||
*
|
||||
* Returns true on success.
|
||||
*/
|
||||
bool EnsureTarget(
|
||||
const gfx::Rect* aCoveredRect = nullptr,
|
||||
bool aWillClear = false);
|
||||
bool EnsureTarget(const gfx::Rect* aCoveredRect = nullptr,
|
||||
bool aWillClear = false);
|
||||
|
||||
void RestoreClipsAndTransformToTarget();
|
||||
|
||||
|
|
|
@ -52,14 +52,16 @@ IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionFloatBlend, EXT_float_blend)
|
|||
|
||||
// -
|
||||
|
||||
WebGLExtensionFBORenderMipmap::WebGLExtensionFBORenderMipmap(WebGLContext* const webgl)
|
||||
WebGLExtensionFBORenderMipmap::WebGLExtensionFBORenderMipmap(
|
||||
WebGLContext* const webgl)
|
||||
: WebGLExtensionBase(webgl) {
|
||||
MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported.");
|
||||
}
|
||||
|
||||
WebGLExtensionFBORenderMipmap::~WebGLExtensionFBORenderMipmap() = default;
|
||||
|
||||
bool WebGLExtensionFBORenderMipmap::IsSupported(const WebGLContext* const webgl) {
|
||||
bool WebGLExtensionFBORenderMipmap::IsSupported(
|
||||
const WebGLContext* const webgl) {
|
||||
if (webgl->IsWebGL2()) return false;
|
||||
if (!gfxPrefs::WebGLDraftExtensionsEnabled()) return false;
|
||||
|
||||
|
|
|
@ -5589,7 +5589,8 @@ nsresult EventStateManager::DoContentCommandEvent(
|
|||
nsCOMPtr<nsITransferable> transferable = aEvent->mTransferable;
|
||||
IPCDataTransfer ipcDataTransfer;
|
||||
nsContentUtils::TransferableToIPCTransferable(
|
||||
transferable, &ipcDataTransfer, false, nullptr, remote->Manager());
|
||||
transferable, &ipcDataTransfer, false, nullptr,
|
||||
remote->Manager());
|
||||
bool isPrivateData = transferable->GetIsPrivateData();
|
||||
nsCOMPtr<nsIPrincipal> requestingPrincipal =
|
||||
transferable->GetRequestingPrincipal();
|
||||
|
|
|
@ -264,8 +264,8 @@ AlternativeDataStreamListener::OnDataAvailable(nsIRequest* aRequest,
|
|||
}
|
||||
if (mStatus == AlternativeDataStreamListener::FALLBACK) {
|
||||
MOZ_ASSERT(mFetchDriver);
|
||||
return mFetchDriver->OnDataAvailable(aRequest, aInputStream,
|
||||
aOffset, aCount);
|
||||
return mFetchDriver->OnDataAvailable(aRequest, aInputStream, aOffset,
|
||||
aCount);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1151,9 +1151,8 @@ nsresult CopySegmentToStreamAndSRI(nsIInputStream* aInStr, void* aClosure,
|
|||
} // anonymous namespace
|
||||
|
||||
NS_IMETHODIMP
|
||||
FetchDriver::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aInputStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
FetchDriver::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInputStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
// NB: This can be called on any thread! But we're guaranteed that it is
|
||||
// called between OnStartRequest and OnStopRequest, so we don't need to worry
|
||||
// about races.
|
||||
|
@ -1208,8 +1207,7 @@ FetchDriver::OnDataAvailable(nsIRequest* aRequest,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FetchDriver::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatusCode) {
|
||||
FetchDriver::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
|
||||
AssertIsOnMainThread();
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mOnStopRequestCalled);
|
||||
|
|
|
@ -717,8 +717,7 @@ HTMLMediaElement::MediaLoadListener::OnDataAvailable(nsIRequest* aRequest,
|
|||
"canceled this request");
|
||||
return NS_BINDING_ABORTED;
|
||||
}
|
||||
return mNextListener->OnDataAvailable(aRequest, aStream, aOffset,
|
||||
aCount);
|
||||
return mNextListener->OnDataAvailable(aRequest, aStream, aOffset, aCount);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -128,8 +128,7 @@ ImageListener::OnStartRequest(nsIRequest* request) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageListener::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
ImageListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
ImageDocument* imgDoc = static_cast<ImageDocument*>(mDocument.get());
|
||||
nsContentUtils::DispatchChromeEvent(imgDoc, ToSupports(imgDoc),
|
||||
NS_LITERAL_STRING("ImageContentLoaded"),
|
||||
|
|
|
@ -89,8 +89,7 @@ MediaDocumentStreamListener::OnDataAvailable(nsIRequest* request,
|
|||
uint64_t sourceOffset,
|
||||
uint32_t count) {
|
||||
if (mNextStream) {
|
||||
return mNextStream->OnDataAvailable(request, inStr, sourceOffset,
|
||||
count);
|
||||
return mNextStream->OnDataAvailable(request, inStr, sourceOffset, count);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -619,8 +619,7 @@ class nsGenericHTMLElement : public nsGenericHTMLElementBase {
|
|||
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override;
|
||||
|
||||
static bool LegacyTouchAPIEnabled(JSContext* aCx,
|
||||
JSObject* aObj);
|
||||
static bool LegacyTouchAPIEnabled(JSContext* aCx, JSObject* aObj);
|
||||
|
||||
static inline bool CanHaveName(nsAtom* aTag) {
|
||||
return aTag == nsGkAtoms::img || aTag == nsGkAtoms::form ||
|
||||
|
|
|
@ -945,18 +945,15 @@ nsJSChannel::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJSChannel::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aInputStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
nsJSChannel::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInputStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
NS_ENSURE_TRUE(aRequest == mStreamChannel, NS_ERROR_UNEXPECTED);
|
||||
|
||||
return mListener->OnDataAvailable(this, aInputStream, aOffset,
|
||||
aCount);
|
||||
return mListener->OnDataAvailable(this, aInputStream, aOffset, aCount);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJSChannel::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
nsJSChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
NS_ENSURE_TRUE(aRequest == mStreamChannel, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsCOMPtr<nsIStreamListener> listener = mListener;
|
||||
|
|
|
@ -3205,9 +3205,8 @@ bool VerifyRequestParams(const Maybe<ContentParentId>& aContentParentId,
|
|||
const LSRequestPrepareObserverParams& params =
|
||||
aParams.get_LSRequestPrepareObserverParams();
|
||||
|
||||
if (NS_WARN_IF(!VerifyPrincipalInfo(aContentParentId,
|
||||
params.principalInfo(),
|
||||
params.clientId()))) {
|
||||
if (NS_WARN_IF(!VerifyPrincipalInfo(
|
||||
aContentParentId, params.principalInfo(), params.clientId()))) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return false;
|
||||
}
|
||||
|
@ -3329,8 +3328,7 @@ bool VerifyRequestParams(const Maybe<ContentParentId>& aContentParentId,
|
|||
aParams.get_LSSimpleRequestPreloadedParams();
|
||||
|
||||
if (NS_WARN_IF(!VerifyPrincipalInfo(aContentParentId,
|
||||
params.principalInfo(),
|
||||
Nothing()))) {
|
||||
params.principalInfo(), Nothing()))) {
|
||||
ASSERT_UNLESS_FUZZING();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -217,8 +217,8 @@ void LSObject::Initialize() {
|
|||
}
|
||||
});
|
||||
|
||||
if (NS_WARN_IF(NS_FAILED(domFileThread->Dispatch(runnable,
|
||||
NS_DISPATCH_NORMAL)))) {
|
||||
if (NS_WARN_IF(
|
||||
NS_FAILED(domFileThread->Dispatch(runnable, NS_DISPATCH_NORMAL)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -419,9 +419,10 @@ LSRequestChild* LSObject::StartRequest(nsIEventTarget* aMainEventTarget,
|
|||
LSRequestChildCallback* aCallback) {
|
||||
AssertIsOnDOMFileThread();
|
||||
|
||||
PBackgroundChild* backgroundActor = XRE_IsParentProcess() ?
|
||||
BackgroundChild::GetOrCreateForCurrentThread(aMainEventTarget) :
|
||||
BackgroundChild::GetForCurrentThread();
|
||||
PBackgroundChild* backgroundActor =
|
||||
XRE_IsParentProcess()
|
||||
? BackgroundChild::GetOrCreateForCurrentThread(aMainEventTarget)
|
||||
: BackgroundChild::GetForCurrentThread();
|
||||
if (NS_WARN_IF(!backgroundActor)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1047,9 +1048,9 @@ nsresult RequestHelper::StartAndReturnResponse(LSRequestResponse& aResponse) {
|
|||
mNestedEventTargetWrapper =
|
||||
new NestedEventTargetWrapper(mNestedEventTarget);
|
||||
|
||||
nsCOMPtr<nsIEventTarget> domFileThread = XRE_IsParentProcess() ?
|
||||
IPCBlobInputStreamThread::GetOrCreate() :
|
||||
IPCBlobInputStreamThread::Get();
|
||||
nsCOMPtr<nsIEventTarget> domFileThread =
|
||||
XRE_IsParentProcess() ? IPCBlobInputStreamThread::GetOrCreate()
|
||||
: IPCBlobInputStreamThread::Get();
|
||||
if (NS_WARN_IF(!domFileThread)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -67,8 +67,8 @@ nsresult ChannelMediaResource::Listener::OnStopRequest(nsIRequest* aRequest,
|
|||
}
|
||||
|
||||
nsresult ChannelMediaResource::Listener::OnDataAvailable(
|
||||
nsIRequest* aRequest, nsIInputStream* aStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
nsIRequest* aRequest, nsIInputStream* aStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
// This might happen off the main thread.
|
||||
RefPtr<ChannelMediaResource> res;
|
||||
{
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
#define PREF_AUDIOIPC_POOL_SIZE "media.audioipc.pool_size"
|
||||
#define PREF_AUDIOIPC_STACK_SIZE "media.audioipc.stack_size"
|
||||
|
||||
#if (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)) || defined(XP_MACOSX) || (defined(XP_WIN) && !defined(_ARM64_))
|
||||
#if (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)) || \
|
||||
defined(XP_MACOSX) || (defined(XP_WIN) && !defined(_ARM64_))
|
||||
# define MOZ_CUBEB_REMOTING
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3084,7 +3084,6 @@ RefPtr<MediaManager::StreamPromise> MediaManager::GetDisplayMedia(
|
|||
void MediaManager::AnonymizeDevices(MediaDeviceSet& aDevices,
|
||||
const nsACString& aOriginKey,
|
||||
const uint64_t aWindowId) {
|
||||
|
||||
if (!aOriginKey.IsEmpty()) {
|
||||
for (RefPtr<MediaDevice>& device : aDevices) {
|
||||
nsString id;
|
||||
|
|
|
@ -142,7 +142,8 @@ void VideoFrameContainer::SetCurrentFrames(const VideoSegment& aSegment) {
|
|||
|
||||
if (frame->GetForceBlack()) {
|
||||
if (!mBlackImage) {
|
||||
RefPtr<Image> blackImage = GetImageContainer()->CreatePlanarYCbCrImage();
|
||||
RefPtr<Image> blackImage =
|
||||
GetImageContainer()->CreatePlanarYCbCrImage();
|
||||
if (blackImage) {
|
||||
// Sets the image to a single black pixel, which will be scaled to
|
||||
// fill the rendered size.
|
||||
|
|
|
@ -84,8 +84,7 @@ WebVTTListener::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebVTTListener::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
WebVTTListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
VTT_LOG("WebVTTListener::OnStopRequest\n");
|
||||
if (NS_FAILED(aStatus)) {
|
||||
mElement->SetReadyState(TextTrackReadyState::FailedToLoad);
|
||||
|
@ -119,9 +118,8 @@ nsresult WebVTTListener::ParseChunk(nsIInputStream* aInStream, void* aClosure,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebVTTListener::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
WebVTTListener::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
VTT_LOG("WebVTTListener::OnDataAvailable\n");
|
||||
uint32_t count = aCount;
|
||||
while (count > 0) {
|
||||
|
|
|
@ -63,9 +63,7 @@ MediaEngineDefaultVideoSource::MediaEngineDefaultVideoSource()
|
|||
|
||||
MediaEngineDefaultVideoSource::~MediaEngineDefaultVideoSource() {}
|
||||
|
||||
nsString MediaEngineDefaultVideoSource::GetName() const {
|
||||
return mName;
|
||||
}
|
||||
nsString MediaEngineDefaultVideoSource::GetName() const { return mName; }
|
||||
|
||||
nsCString MediaEngineDefaultVideoSource::GetUUID() const {
|
||||
return NS_LITERAL_CSTRING("1041FCBD-3F12-4F7B-9E9B-1EC556DD5676");
|
||||
|
@ -582,8 +580,8 @@ void MediaEngineDefault::EnumerateDevices(
|
|||
devicesForThisWindow->AppendElement(newSource);
|
||||
aDevices->AppendElement(MakeRefPtr<MediaDevice>(
|
||||
newSource, newSource->GetName(),
|
||||
NS_ConvertUTF8toUTF16(newSource->GetUUID()),
|
||||
newSource->GetGroupId(), NS_LITERAL_STRING("")));
|
||||
NS_ConvertUTF8toUTF16(newSource->GetUUID()), newSource->GetGroupId(),
|
||||
NS_LITERAL_STRING("")));
|
||||
return;
|
||||
}
|
||||
case dom::MediaSourceEnum::Microphone: {
|
||||
|
@ -594,8 +592,8 @@ void MediaEngineDefault::EnumerateDevices(
|
|||
if (source->IsAvailable()) {
|
||||
aDevices->AppendElement(MakeRefPtr<MediaDevice>(
|
||||
source, source->GetName(),
|
||||
NS_ConvertUTF8toUTF16(source->GetUUID()),
|
||||
source->GetGroupId(), NS_LITERAL_STRING("")));
|
||||
NS_ConvertUTF8toUTF16(source->GetUUID()), source->GetGroupId(),
|
||||
NS_LITERAL_STRING("")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ class MediaEngineDefaultVideoSource : public MediaEngineSource {
|
|||
int mCb = 16;
|
||||
int mCr = 16;
|
||||
|
||||
private:
|
||||
private:
|
||||
const nsString mName;
|
||||
};
|
||||
|
||||
|
|
|
@ -28,8 +28,10 @@ class AudioInputProcessing;
|
|||
class MediaEngineWebRTCMicrophoneSource : public MediaEngineSource {
|
||||
public:
|
||||
MediaEngineWebRTCMicrophoneSource(RefPtr<AudioDeviceInfo> aInfo,
|
||||
const nsString& aName, const nsCString& aUuid,
|
||||
const nsString& aGroupId, uint32_t aMaxChannelCount,
|
||||
const nsString& aName,
|
||||
const nsCString& aUuid,
|
||||
const nsString& aGroupId,
|
||||
uint32_t aMaxChannelCount,
|
||||
bool aDelayAgnostic, bool aExtendedFilter);
|
||||
|
||||
bool RequiresSharing() const override { return false; }
|
||||
|
|
|
@ -319,13 +319,10 @@ class CopierCallbacks final : public nsIRequestObserver {
|
|||
NS_IMPL_ISUPPORTS(CopierCallbacks, nsIRequestObserver)
|
||||
|
||||
NS_IMETHODIMP
|
||||
CopierCallbacks::OnStartRequest(nsIRequest* aRequest) {
|
||||
return NS_OK;
|
||||
}
|
||||
CopierCallbacks::OnStartRequest(nsIRequest* aRequest) { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
CopierCallbacks::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
CopierCallbacks::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
mOwner->NotifyCopyComplete(aStatus);
|
||||
mOwner = nullptr;
|
||||
return NS_OK;
|
||||
|
@ -932,14 +929,11 @@ TCPSocket::OnInputStreamReady(nsIAsyncInputStream* aStream) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TCPSocket::OnStartRequest(nsIRequest* aRequest) {
|
||||
return NS_OK;
|
||||
}
|
||||
TCPSocket::OnStartRequest(nsIRequest* aRequest) { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
TCPSocket::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
TCPSocket::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
if (mUseArrayBuffers) {
|
||||
nsTArray<uint8_t> buffer;
|
||||
buffer.SetCapacity(aCount);
|
||||
|
@ -994,8 +988,7 @@ TCPSocket::OnDataAvailable(nsIRequest* aRequest,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TCPSocket::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
TCPSocket::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
mInputStreamPump = nullptr;
|
||||
|
||||
if (mAsyncCopierActive && NS_SUCCEEDED(aStatus)) {
|
||||
|
|
|
@ -276,8 +276,8 @@ nsresult nsPluginStreamListenerPeer::SetStreamOffset(int32_t value) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(
|
||||
nsIRequest* request, nsIInputStream* aIStream,
|
||||
uint64_t sourceOffset, uint32_t aLength) {
|
||||
nsIRequest* request, nsIInputStream* aIStream, uint64_t sourceOffset,
|
||||
uint32_t aLength) {
|
||||
if (mRequests.IndexOfObject(request) == -1) {
|
||||
MOZ_ASSERT(false, "Received OnDataAvailable for untracked request.");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
|
|
@ -44,13 +44,10 @@ class CopierCallbacks final : public nsIRequestObserver {
|
|||
NS_IMPL_ISUPPORTS(CopierCallbacks, nsIRequestObserver)
|
||||
|
||||
NS_IMETHODIMP
|
||||
CopierCallbacks::OnStartRequest(nsIRequest* aRequest) {
|
||||
return NS_OK;
|
||||
}
|
||||
CopierCallbacks::OnStartRequest(nsIRequest* aRequest) { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
CopierCallbacks::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
CopierCallbacks::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
mOwner->NotifyCopyComplete(aStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -2126,15 +2126,15 @@ void InitializeQuotaManager() {
|
|||
NS_WARNING("Failed to initialize quota manager!");
|
||||
}
|
||||
|
||||
if (NS_FAILED(Preferences::AddAtomicIntVarCache(
|
||||
&gFixedLimitKB, PREF_FIXED_LIMIT, kDefaultFixedLimitKB)) ||
|
||||
NS_FAILED(Preferences::AddAtomicUintVarCache(
|
||||
&gChunkSizeKB, PREF_CHUNK_SIZE, kDefaultChunkSizeKB))) {
|
||||
if (NS_FAILED(Preferences::AddAtomicIntVarCache(
|
||||
&gFixedLimitKB, PREF_FIXED_LIMIT, kDefaultFixedLimitKB)) ||
|
||||
NS_FAILED(Preferences::AddAtomicUintVarCache(
|
||||
&gChunkSizeKB, PREF_CHUNK_SIZE, kDefaultChunkSizeKB))) {
|
||||
NS_WARNING("Unable to respond to temp storage pref changes!");
|
||||
}
|
||||
|
||||
if (NS_FAILED(Preferences::AddAtomicBoolVarCache(
|
||||
&gTestingEnabled, PREF_TESTING_FEATURES, false))) {
|
||||
if (NS_FAILED(Preferences::AddAtomicBoolVarCache(
|
||||
&gTestingEnabled, PREF_TESTING_FEATURES, false))) {
|
||||
NS_WARNING("Unable to respond to testing pref changes!");
|
||||
}
|
||||
|
||||
|
|
|
@ -37,15 +37,15 @@ NS_IMETHODIMP nsIndexedDBProtocolHandler::GetProtocolFlags(
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsIndexedDBProtocolHandler::NewURI(
|
||||
const nsACString& aSpec, const char* aOriginCharset, nsIURI* aBaseURI,
|
||||
nsIURI** _retval) {
|
||||
NS_IMETHODIMP nsIndexedDBProtocolHandler::NewURI(const nsACString& aSpec,
|
||||
const char* aOriginCharset,
|
||||
nsIURI* aBaseURI,
|
||||
nsIURI** _retval) {
|
||||
nsCOMPtr<nsIURI> baseURI(aBaseURI);
|
||||
return NS_MutateURI(new nsStandardURL::Mutator())
|
||||
.Apply(NS_MutatorMethod(&nsIStandardURLMutator::Init,
|
||||
nsIStandardURL::URLTYPE_AUTHORITY, 0,
|
||||
nsCString(aSpec), aOriginCharset, baseURI,
|
||||
nullptr))
|
||||
.Apply(NS_MutatorMethod(
|
||||
&nsIStandardURLMutator::Init, nsIStandardURL::URLTYPE_AUTHORITY, 0,
|
||||
nsCString(aSpec), aOriginCharset, baseURI, nullptr))
|
||||
.Finalize(_retval);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,8 +102,8 @@ void ContentVerifier::FinishSignature() {
|
|||
break;
|
||||
}
|
||||
// let the next listener know that there is data in oInStr
|
||||
rv = nextListener->OnDataAvailable(mContentRequest, oInStr,
|
||||
offset, mContent[i].Length());
|
||||
rv = nextListener->OnDataAvailable(mContentRequest, oInStr, offset,
|
||||
mContent[i].Length());
|
||||
offset += mContent[i].Length();
|
||||
if (NS_FAILED(rv)) {
|
||||
break;
|
||||
|
@ -121,8 +121,7 @@ ContentVerifier::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ContentVerifier::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
ContentVerifier::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
// If we don't have a next listener, we handed off this request already.
|
||||
// Return, there's nothing to do here.
|
||||
if (!mNextListener) {
|
||||
|
@ -188,8 +187,8 @@ ContentVerifier::ContextCreated(bool successful) {
|
|||
CSV_LOG(("failed to get a valid cert chain\n"));
|
||||
if (mContentRequest && nextListener) {
|
||||
mContentRequest->Cancel(NS_ERROR_INVALID_SIGNATURE);
|
||||
nsresult rv = nextListener->OnStopRequest(
|
||||
mContentRequest, NS_ERROR_INVALID_SIGNATURE);
|
||||
nsresult rv = nextListener->OnStopRequest(mContentRequest,
|
||||
NS_ERROR_INVALID_SIGNATURE);
|
||||
mContentRequest = nullptr;
|
||||
mContentContext = nullptr;
|
||||
return rv;
|
||||
|
|
|
@ -660,7 +660,8 @@ class LifeCycleEventWatcher final : public ExtendableEventCallback {
|
|||
mCallback->SetResult(aResult);
|
||||
// Using DispatchToMainThreadForMessaging so that state update on
|
||||
// the main thread doesn't happen too soon.
|
||||
nsresult rv = mWorkerRef->Private()->DispatchToMainThreadForMessaging(mCallback);
|
||||
nsresult rv =
|
||||
mWorkerRef->Private()->DispatchToMainThreadForMessaging(mCallback);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
MOZ_CRASH("Failed to dispatch life cycle event handler.");
|
||||
}
|
||||
|
|
|
@ -849,8 +849,7 @@ nsresult CompareNetwork::SetPrincipalInfo(nsIChannel* aChannel) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CompareNetwork::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatusCode) {
|
||||
CompareNetwork::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
|
||||
// Nothing to do here!
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -363,7 +363,8 @@ void ServiceWorkerUpdateJob::ComparisonResult(nsresult aStatus,
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIURI> scopeURI;
|
||||
rv = NS_NewURI(getter_AddRefs(scopeURI), mRegistration->Scope(), nullptr, scriptURI);
|
||||
rv = NS_NewURI(getter_AddRefs(scopeURI), mRegistration->Scope(), nullptr,
|
||||
scriptURI);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
FailUpdateJob(NS_ERROR_FAILURE);
|
||||
return;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "nsURLParsers.h"
|
||||
|
||||
#ifdef OS_WIN
|
||||
#include "WinWebAuthnManager.h"
|
||||
# include "WinWebAuthnManager.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
|
|
|
@ -822,7 +822,8 @@ JSObject* Wrap(JSContext* cx, JS::HandleObject existing, JS::HandleObject obj) {
|
|||
JSObject* targetGlobal = JS::CurrentGlobalOrNull(cx);
|
||||
if (!IsWorkerDebuggerGlobal(targetGlobal) &&
|
||||
!IsWorkerDebuggerSandbox(targetGlobal)) {
|
||||
JS_ReportErrorASCII(cx, "There should be no edges from the debuggee to the debugger.");
|
||||
JS_ReportErrorASCII(
|
||||
cx, "There should be no edges from the debuggee to the debugger.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -529,8 +529,7 @@ class LoaderListener final : public nsIStreamLoaderObserver,
|
|||
OnStartRequest(nsIRequest* aRequest) override;
|
||||
|
||||
NS_IMETHOD
|
||||
OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatusCode) override {
|
||||
OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) override {
|
||||
// Nothing to do here!
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -380,8 +380,7 @@ WorkerDebugger::RemoveListener(nsIWorkerDebuggerListener* aListener) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WorkerDebugger::SetDebuggerReady(bool aReady)
|
||||
{
|
||||
WorkerDebugger::SetDebuggerReady(bool aReady) {
|
||||
return mWorkerPrivate->SetIsDebuggerReady(aReady);
|
||||
}
|
||||
|
||||
|
|
|
@ -180,8 +180,7 @@ nsXBLStreamListener::OnDataAvailable(nsIRequest* request,
|
|||
nsIInputStream* aInStr,
|
||||
uint64_t aSourceOffset, uint32_t aCount) {
|
||||
if (mInner)
|
||||
return mInner->OnDataAvailable(request, aInStr, aSourceOffset,
|
||||
aCount);
|
||||
return mInner->OnDataAvailable(request, aInStr, aSourceOffset, aCount);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -212,8 +211,7 @@ nsXBLStreamListener::OnStartRequest(nsIRequest* request) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXBLStreamListener::OnStopRequest(nsIRequest* request,
|
||||
nsresult aStatus) {
|
||||
nsXBLStreamListener::OnStopRequest(nsIRequest* request, nsresult aStatus) {
|
||||
nsresult rv = NS_OK;
|
||||
if (mInner) {
|
||||
rv = mInner->OnStopRequest(request, aStatus);
|
||||
|
|
|
@ -1552,8 +1552,7 @@ nsresult XMLHttpRequestMainThread::StreamReaderFunc(
|
|||
NS_ASSERTION(copyStream, "NS_NewByteInputStream lied");
|
||||
nsresult parsingResult =
|
||||
xmlHttpRequest->mXMLParserStreamListener->OnDataAvailable(
|
||||
xmlHttpRequest->mChannel, copyStream,
|
||||
toOffset, count);
|
||||
xmlHttpRequest->mChannel, copyStream, toOffset, count);
|
||||
|
||||
// No use to continue parsing if we failed here, but we
|
||||
// should still finish reading the stream
|
||||
|
@ -2020,8 +2019,7 @@ XMLHttpRequestMainThread::OnStartRequest(nsIRequest* request) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
XMLHttpRequestMainThread::OnStopRequest(nsIRequest* request,
|
||||
nsresult status) {
|
||||
XMLHttpRequestMainThread::OnStopRequest(nsIRequest* request, nsresult status) {
|
||||
AUTO_PROFILER_LABEL("XMLHttpRequestMainThread::OnStopRequest", NETWORK);
|
||||
|
||||
if (request != mChannel) {
|
||||
|
|
|
@ -216,8 +216,7 @@ txStylesheetSink::OnDataAvailable(nsIRequest* aRequest,
|
|||
}
|
||||
}
|
||||
|
||||
return mListener->OnDataAvailable(aRequest, aInputStream, aOffset,
|
||||
aCount);
|
||||
return mListener->OnDataAvailable(aRequest, aInputStream, aOffset, aCount);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -269,8 +268,7 @@ txStylesheetSink::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
txStylesheetSink::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatusCode) {
|
||||
txStylesheetSink::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
|
||||
bool success = true;
|
||||
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aRequest);
|
||||
|
|
|
@ -16,4 +16,3 @@ void CookieModuleDtor();
|
|||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -62,14 +62,11 @@ void nsAutoConfig::SetConfigURL(const char *aConfigURL) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAutoConfig::OnStartRequest(nsIRequest *request) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsAutoConfig::OnStartRequest(nsIRequest *request) { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAutoConfig::OnDataAvailable(nsIRequest *request,
|
||||
nsIInputStream *aIStream, uint64_t aSourceOffset,
|
||||
uint32_t aLength) {
|
||||
nsAutoConfig::OnDataAvailable(nsIRequest *request, nsIInputStream *aIStream,
|
||||
uint64_t aSourceOffset, uint32_t aLength) {
|
||||
uint32_t amt, size;
|
||||
nsresult rv;
|
||||
char buf[1024];
|
||||
|
@ -85,8 +82,7 @@ nsAutoConfig::OnDataAvailable(nsIRequest *request,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAutoConfig::OnStopRequest(nsIRequest *request,
|
||||
nsresult aStatus) {
|
||||
nsAutoConfig::OnStopRequest(nsIRequest *request, nsresult aStatus) {
|
||||
nsresult rv;
|
||||
|
||||
// If the request is failed, go read the failover.jsc file
|
||||
|
|
|
@ -1451,7 +1451,8 @@ void DrawTargetSkia::MaskSurface(const Pattern& aSource, SourceSurface* aMask,
|
|||
return;
|
||||
}
|
||||
|
||||
mCanvas->drawImage(alphaMask, aOffset.x + aMask->GetRect().x, aOffset.y + aMask->GetRect().y, &paint.mPaint);
|
||||
mCanvas->drawImage(alphaMask, aOffset.x + aMask->GetRect().x,
|
||||
aOffset.y + aMask->GetRect().y, &paint.mPaint);
|
||||
}
|
||||
|
||||
bool DrawTarget::Draw3DTransformedSurface(SourceSurface* aSurface,
|
||||
|
|
|
@ -841,7 +841,8 @@ bool GLContext::InitImpl() {
|
|||
// see bug 737182 for 2D textures, bug 684882 for cube map textures.
|
||||
mMaxTextureSize = std::min(mMaxTextureSize, 4096);
|
||||
mMaxCubeMapTextureSize = std::min(mMaxCubeMapTextureSize, 512);
|
||||
// for good measure, we align renderbuffers on what we do for 2D textures
|
||||
// for good measure, we align renderbuffers on what we do for 2D
|
||||
// textures
|
||||
mMaxRenderbufferSize = std::min(mMaxRenderbufferSize, 4096);
|
||||
mNeedsTextureSizeChecks = true;
|
||||
} else if (mVendor == GLVendor::NVIDIA) {
|
||||
|
@ -890,8 +891,7 @@ bool GLContext::InitImpl() {
|
|||
}
|
||||
#endif
|
||||
#if MOZ_WIDGET_ANDROID
|
||||
if (Renderer() == GLRenderer::SGX540 &&
|
||||
jni::GetAPIVersion() <= 15) {
|
||||
if (Renderer() == GLRenderer::SGX540 && jni::GetAPIVersion() <= 15) {
|
||||
// Bug 1288446. Driver sometimes crashes when uploading data to a
|
||||
// texture if the render target has changed since the texture was
|
||||
// rendered from. Calling glCheckFramebufferStatus after
|
||||
|
|
|
@ -3311,8 +3311,8 @@ class GLContext : public GenericAtomicRefCounted,
|
|||
// -----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
protected:
|
||||
explicit GLContext(CreateContextFlags flags,
|
||||
const SurfaceCaps& caps, GLContext* sharedContext = nullptr,
|
||||
explicit GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
GLContext* sharedContext = nullptr,
|
||||
bool isOffscreen = false, bool canUseTLSIsCurrent = false);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -3569,7 +3569,8 @@ class GLContext : public GenericAtomicRefCounted,
|
|||
void LoadMoreSymbols(const SymbolLoader& loader);
|
||||
bool LoadExtSymbols(const SymbolLoader& loader, const SymLoadStruct* list,
|
||||
GLExtensions ext);
|
||||
bool LoadFeatureSymbols(const SymbolLoader& loader, const SymLoadStruct* list, GLFeature feature);
|
||||
bool LoadFeatureSymbols(const SymbolLoader& loader, const SymLoadStruct* list,
|
||||
GLFeature feature);
|
||||
|
||||
protected:
|
||||
void InitExtensions();
|
||||
|
|
|
@ -119,10 +119,9 @@ bool GLContextCGL::SwapBuffers() {
|
|||
|
||||
void GLContextCGL::GetWSIInfo(nsCString* const out) const { out->AppendLiteral("CGL"); }
|
||||
|
||||
Maybe<SymbolLoader> GLContextCGL::GetSymbolLoader() const
|
||||
{
|
||||
const auto& lib = sCGLLibrary.Library();
|
||||
return Some(SymbolLoader(*lib));
|
||||
Maybe<SymbolLoader> GLContextCGL::GetSymbolLoader() const {
|
||||
const auto& lib = sCGLLibrary.Library();
|
||||
return Some(SymbolLoader(*lib));
|
||||
}
|
||||
|
||||
already_AddRefed<GLContext> GLContextProviderCGL::CreateWrappingExisting(void*, void*) {
|
||||
|
|
|
@ -69,5 +69,5 @@ PRFuncPtr SymbolLoader::GetProcAddress(const char* const name) const {
|
|||
return ret;
|
||||
}
|
||||
|
||||
} // namespace gl
|
||||
} // namespace mozilla
|
||||
} // namespace gl
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -23,35 +23,29 @@ struct SymLoadStruct final {
|
|||
void ClearSymbols(const SymLoadStruct* firstStruct);
|
||||
|
||||
class SymbolLoader final {
|
||||
public:
|
||||
typedef PRFuncPtr (GLAPIENTRY * GetProcAddressT)(const char*);
|
||||
public:
|
||||
typedef PRFuncPtr(GLAPIENTRY* GetProcAddressT)(const char*);
|
||||
|
||||
GetProcAddressT mPfn = nullptr; // Try this first, if not null.
|
||||
GetProcAddressT mPfn = nullptr; // Try this first, if not null.
|
||||
PRLibrary* mLib = nullptr;
|
||||
|
||||
explicit SymbolLoader(void* (GLAPIENTRY * pfn)(const char*))
|
||||
: mPfn(GetProcAddressT(pfn))
|
||||
{
|
||||
explicit SymbolLoader(void*(GLAPIENTRY* pfn)(const char*))
|
||||
: mPfn(GetProcAddressT(pfn)) {
|
||||
MOZ_ASSERT(mPfn);
|
||||
}
|
||||
|
||||
explicit SymbolLoader(const GetProcAddressT pfn)
|
||||
: mPfn(pfn)
|
||||
{
|
||||
explicit SymbolLoader(const GetProcAddressT pfn) : mPfn(pfn) {
|
||||
MOZ_ASSERT(mPfn);
|
||||
}
|
||||
|
||||
explicit SymbolLoader(PRLibrary& lib)
|
||||
: mLib(&lib)
|
||||
{
|
||||
MOZ_ASSERT(mLib);
|
||||
}
|
||||
explicit SymbolLoader(PRLibrary& lib) : mLib(&lib) { MOZ_ASSERT(mLib); }
|
||||
|
||||
PRFuncPtr GetProcAddress(const char*) const;
|
||||
bool LoadSymbols(const SymLoadStruct* firstStruct, bool warnOnFailures = true) const;
|
||||
bool LoadSymbols(const SymLoadStruct* firstStruct,
|
||||
bool warnOnFailures = true) const;
|
||||
};
|
||||
|
||||
} // namespace gl
|
||||
} // namespace mozilla
|
||||
} // namespace gl
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // GLLIBRARYLOADER_H_
|
||||
#endif // GLLIBRARYLOADER_H_
|
||||
|
|
|
@ -179,9 +179,7 @@ class GLXLibrary final {
|
|||
bool IsATI() { return mIsATI; }
|
||||
bool IsMesa() { return mClientIsMesa; }
|
||||
|
||||
auto GetGetProcAddress() const {
|
||||
return mSymbols.fGetProcAddress;
|
||||
}
|
||||
auto GetGetProcAddress() const { return mSymbols.fGetProcAddress; }
|
||||
|
||||
private:
|
||||
struct {
|
||||
|
|
|
@ -45,7 +45,7 @@ struct CanvasInitializeData final {
|
|||
void* mDidTransCallbackData = nullptr;
|
||||
|
||||
// The size of the canvas content
|
||||
gfx::IntSize mSize = {0,0};
|
||||
gfx::IntSize mSize = {0, 0};
|
||||
|
||||
// Whether the canvas drawingbuffer has an alpha channel.
|
||||
bool mHasAlpha = false;
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
#include "mozilla/layers/FocusTarget.h"
|
||||
|
||||
#include "mozilla/dom/BrowserBridgeChild.h" // for BrowserBridgeChild
|
||||
#include "mozilla/dom/EventTarget.h" // for EventTarget
|
||||
#include "mozilla/dom/TabParent.h" // for TabParent
|
||||
#include "mozilla/EventDispatcher.h" // for EventDispatcher
|
||||
#include "mozilla/layout/RenderFrame.h" // For RenderFrame
|
||||
#include "nsIContentInlines.h" // for nsINode::IsEditable()
|
||||
#include "nsIPresShell.h" // for nsIPresShell
|
||||
#include "nsLayoutUtils.h" // for nsLayoutUtils
|
||||
#include "mozilla/dom/EventTarget.h" // for EventTarget
|
||||
#include "mozilla/dom/TabParent.h" // for TabParent
|
||||
#include "mozilla/EventDispatcher.h" // for EventDispatcher
|
||||
#include "mozilla/layout/RenderFrame.h" // For RenderFrame
|
||||
#include "nsIContentInlines.h" // for nsINode::IsEditable()
|
||||
#include "nsIPresShell.h" // for nsIPresShell
|
||||
#include "nsLayoutUtils.h" // for nsLayoutUtils
|
||||
|
||||
#define ENABLE_FT_LOGGING 0
|
||||
// #define ENABLE_FT_LOGGING 1
|
||||
|
|
|
@ -128,9 +128,8 @@ mozilla::ipc::IPCResult APZCTreeManagerChild::RecvHandleTap(
|
|||
mCompositorSession->RootLayerTreeId() == aGuid.mLayersId &&
|
||||
mCompositorSession->GetContentController()) {
|
||||
RefPtr<GeckoContentController> controller =
|
||||
mCompositorSession->GetContentController();
|
||||
controller->HandleTap(
|
||||
aType, aPoint, aModifiers, aGuid, aInputBlockId);
|
||||
mCompositorSession->GetContentController();
|
||||
controller->HandleTap(aType, aPoint, aModifiers, aGuid, aInputBlockId);
|
||||
return IPC_OK();
|
||||
}
|
||||
dom::TabParent* tab =
|
||||
|
|
|
@ -2133,13 +2133,13 @@ void CompositorBridgeParent::InvalidateRemoteLayers() {
|
|||
Unused << PCompositorBridgeParent::SendInvalidateLayers(LayersId{0});
|
||||
|
||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||
ForEachIndirectLayerTree(
|
||||
[](LayerTreeState* lts, const LayersId& aLayersId) -> void {
|
||||
if (lts->mContentCompositorBridgeParent) {
|
||||
ContentCompositorBridgeParent* cpcp = lts->mContentCompositorBridgeParent;
|
||||
Unused << cpcp->SendInvalidateLayers(aLayersId);
|
||||
}
|
||||
});
|
||||
ForEachIndirectLayerTree([](LayerTreeState* lts,
|
||||
const LayersId& aLayersId) -> void {
|
||||
if (lts->mContentCompositorBridgeParent) {
|
||||
ContentCompositorBridgeParent* cpcp = lts->mContentCompositorBridgeParent;
|
||||
Unused << cpcp->SendInvalidateLayers(aLayersId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void UpdateIndirectTree(LayersId aId, Layer* aRoot,
|
||||
|
|
|
@ -175,7 +175,6 @@ class MOZ_STACK_CLASS AutoImageBridgeParentAsyncMessageSender {
|
|||
mozilla::ipc::IPCResult ImageBridgeParent::RecvUpdate(
|
||||
EditArray&& aEdits, OpDestroyArray&& aToDestroy,
|
||||
const uint64_t& aFwdTransactionId) {
|
||||
|
||||
AUTO_PROFILER_TRACING("Paint", "ImageBridgeTransaction", GRAPHICS);
|
||||
AUTO_PROFILER_LABEL("ImageBridgeParent::RecvUpdate", GRAPHICS);
|
||||
|
||||
|
|
|
@ -238,8 +238,8 @@ Maybe<TextureHost::ResourceUpdateOp> AsyncImagePipelineManager::UpdateImageKeys(
|
|||
// Use WebRenderTextureHostWrapper only for video.
|
||||
// And WebRenderTextureHostWrapper could be used only with
|
||||
// WebRenderTextureHost that supports NativeTexture
|
||||
bool useWrTextureWrapper = useExternalImage && wrTexture &&
|
||||
wrTexture->SupportsWrNativeTexture();
|
||||
bool useWrTextureWrapper =
|
||||
useExternalImage && wrTexture && wrTexture->SupportsWrNativeTexture();
|
||||
|
||||
// The non-external image code path falls back to converting the texture into
|
||||
// an rgb image.
|
||||
|
@ -283,13 +283,15 @@ Maybe<TextureHost::ResourceUpdateOp> AsyncImagePipelineManager::UpdateImageKeys(
|
|||
MOZ_ASSERT(canUpdate);
|
||||
// Reuse WebRenderTextureHostWrapper. With it, rendered frame could be
|
||||
// updated without batch re-creation.
|
||||
aPipeline->mWrTextureWrapper->UpdateWebRenderTextureHost(aMaybeFastTxn, wrTexture);
|
||||
aPipeline->mWrTextureWrapper->UpdateWebRenderTextureHost(aMaybeFastTxn,
|
||||
wrTexture);
|
||||
// Ensure frame generation.
|
||||
SetWillGenerateFrame();
|
||||
} else {
|
||||
if (useWrTextureWrapper) {
|
||||
aPipeline->mWrTextureWrapper = new WebRenderTextureHostWrapper(this);
|
||||
aPipeline->mWrTextureWrapper->UpdateWebRenderTextureHost(aMaybeFastTxn, wrTexture);
|
||||
aPipeline->mWrTextureWrapper->UpdateWebRenderTextureHost(aMaybeFastTxn,
|
||||
wrTexture);
|
||||
}
|
||||
Range<wr::ImageKey> keys(&aKeys[0], aKeys.Length());
|
||||
auto externalImageKey =
|
||||
|
@ -389,8 +391,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
|||
// It is for making epoch update consistent.
|
||||
aSceneBuilderTxn.UpdateEpoch(aPipelineId, aEpoch);
|
||||
if (aPipeline->mCurrentTexture) {
|
||||
HoldExternalImage(aPipelineId, aEpoch,
|
||||
aPipeline->mCurrentTexture);
|
||||
HoldExternalImage(aPipelineId, aEpoch, aPipeline->mCurrentTexture);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -432,8 +433,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
|||
aPipeline->mCurrentTexture->PushDisplayItems(
|
||||
builder, wr::ToRoundedLayoutRect(rect), wr::ToRoundedLayoutRect(rect),
|
||||
aPipeline->mFilter, range_keys);
|
||||
HoldExternalImage(aPipelineId, aEpoch,
|
||||
aPipeline->mCurrentTexture);
|
||||
HoldExternalImage(aPipelineId, aEpoch, aPipeline->mCurrentTexture);
|
||||
} else {
|
||||
MOZ_ASSERT(keys.Length() == 1);
|
||||
builder.PushImage(wr::ToRoundedLayoutRect(rect),
|
||||
|
|
|
@ -53,8 +53,7 @@ class AsyncImagePipelineManager final {
|
|||
WebRenderBridgeParent* GetWrBridge(const wr::PipelineId& aPipelineId);
|
||||
|
||||
void HoldExternalImage(const wr::PipelineId& aPipelineId,
|
||||
const wr::Epoch& aEpoch,
|
||||
TextureHost* aTexture);
|
||||
const wr::Epoch& aEpoch, TextureHost* aTexture);
|
||||
void HoldExternalImage(const wr::PipelineId& aPipelineId,
|
||||
const wr::Epoch& aEpoch,
|
||||
WebRenderTextureHostWrapper* aWrTextureWrapper);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "mozilla/webrender/WebRenderAPI.h"
|
||||
#include "mozilla/webrender/WebRenderTypes.h"
|
||||
#include "Units.h"
|
||||
#include "nsSVGIntegrationUtils.h" // for WrFiltersHolder
|
||||
#include "nsSVGIntegrationUtils.h" // for WrFiltersHolder
|
||||
|
||||
class nsDisplayTransform;
|
||||
|
||||
|
|
|
@ -65,13 +65,14 @@ void gecko_profiler_end_marker(const char* name) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void gecko_profiler_add_text_marker(const char* name, const char* text_bytes, size_t text_len, uint64_t microseconds) {
|
||||
void gecko_profiler_add_text_marker(const char* name, const char* text_bytes,
|
||||
size_t text_len, uint64_t microseconds) {
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_thread_is_being_profiled()) {
|
||||
auto now = mozilla::TimeStamp::Now();
|
||||
auto start = now - mozilla::TimeDuration::FromMicroseconds(microseconds);
|
||||
profiler_add_text_marker(
|
||||
name, nsDependentCString(text_bytes, text_len), JS::ProfilingCategoryPair::GRAPHICS, start, now);
|
||||
profiler_add_text_marker(name, nsDependentCString(text_bytes, text_len),
|
||||
JS::ProfilingCategoryPair::GRAPHICS, start, now);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -47,11 +47,12 @@ class CompositorVsyncScheduler;
|
|||
class AsyncImagePipelineManager;
|
||||
class WebRenderImageHost;
|
||||
|
||||
class WebRenderBridgeParent final : public PWebRenderBridgeParent,
|
||||
public CompositorVsyncSchedulerOwner,
|
||||
public CompositableParentManager,
|
||||
public layers::FrameRecorder,
|
||||
public SupportsWeakPtr<WebRenderBridgeParent> {
|
||||
class WebRenderBridgeParent final
|
||||
: public PWebRenderBridgeParent,
|
||||
public CompositorVsyncSchedulerOwner,
|
||||
public CompositableParentManager,
|
||||
public layers::FrameRecorder,
|
||||
public SupportsWeakPtr<WebRenderBridgeParent> {
|
||||
public:
|
||||
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebRenderBridgeParent)
|
||||
WebRenderBridgeParent(CompositorBridgeParentBase* aCompositorBridge,
|
||||
|
|
|
@ -28,9 +28,7 @@ namespace layers {
|
|||
class ISurfaceAllocator;
|
||||
|
||||
WebRenderImageHost::WebRenderImageHost(const TextureInfo& aTextureInfo)
|
||||
: CompositableHost(aTextureInfo),
|
||||
ImageComposite(),
|
||||
mWrBridgeBindings(0) {}
|
||||
: CompositableHost(aTextureInfo), ImageComposite(), mWrBridgeBindings(0) {}
|
||||
|
||||
WebRenderImageHost::~WebRenderImageHost() { MOZ_ASSERT(!mWrBridge); }
|
||||
|
||||
|
|
|
@ -26,9 +26,8 @@ class ScheduleUpdateRenderTextureHost : public wr::NotificationHandler {
|
|||
virtual void Notify(wr::Checkpoint aCheckpoint) override {
|
||||
if (aCheckpoint == wr::Checkpoint::FrameTexturesUpdated) {
|
||||
MOZ_ASSERT(wr::RenderThread::IsInRenderThread());
|
||||
wr::RenderThread::Get()->UpdateRenderTextureHost(
|
||||
mSrcExternalImageId,
|
||||
mWrappedExternalImageId);
|
||||
wr::RenderThread::Get()->UpdateRenderTextureHost(mSrcExternalImageId,
|
||||
mWrappedExternalImageId);
|
||||
} else {
|
||||
MOZ_ASSERT(aCheckpoint == wr::Checkpoint::TransactionDropped);
|
||||
}
|
||||
|
@ -57,8 +56,7 @@ WebRenderTextureHostWrapper::~WebRenderTextureHostWrapper() {
|
|||
}
|
||||
|
||||
void WebRenderTextureHostWrapper::UpdateWebRenderTextureHost(
|
||||
wr::TransactionBuilder& aTxn,
|
||||
WebRenderTextureHost* aTextureHost) {
|
||||
wr::TransactionBuilder& aTxn, WebRenderTextureHost* aTextureHost) {
|
||||
MOZ_ASSERT(aTextureHost);
|
||||
|
||||
// AsyncImagePipelineManager is responsible of holding compositable ref of
|
||||
|
@ -66,9 +64,9 @@ void WebRenderTextureHostWrapper::UpdateWebRenderTextureHost(
|
|||
// ScheduleUpdateRenderTextureHost does not need to handle it.
|
||||
|
||||
aTxn.Notify(wr::Checkpoint::FrameTexturesUpdated,
|
||||
MakeUnique<ScheduleUpdateRenderTextureHost>(
|
||||
wr::AsUint64(mExternalImageId),
|
||||
wr::AsUint64(aTextureHost->GetExternalImageKey())));
|
||||
MakeUnique<ScheduleUpdateRenderTextureHost>(
|
||||
wr::AsUint64(mExternalImageId),
|
||||
wr::AsUint64(aTextureHost->GetExternalImageKey())));
|
||||
|
||||
mWrTextureHost = aTextureHost;
|
||||
}
|
||||
|
|
|
@ -1191,8 +1191,8 @@ struct RegionBitmap {
|
|||
int height;
|
||||
};
|
||||
|
||||
static void VisitEdge(void *closure, VisitSide side, int x1, int y1,
|
||||
int x2, int y2) {
|
||||
static void VisitEdge(void *closure, VisitSide side, int x1, int y1, int x2,
|
||||
int y2) {
|
||||
EXPECT_GE(x2, x1);
|
||||
RegionBitmap *visitor = static_cast<RegionBitmap *>(closure);
|
||||
unsigned char *bitmap = visitor->bitmap;
|
||||
|
|
|
@ -266,9 +266,7 @@ class gfxFontEntry {
|
|||
AutoTable(gfxFontEntry* aFontEntry, uint32_t aTag) {
|
||||
mBlob = aFontEntry->GetFontTable(aTag);
|
||||
}
|
||||
~AutoTable() {
|
||||
hb_blob_destroy(mBlob);
|
||||
}
|
||||
~AutoTable() { hb_blob_destroy(mBlob); }
|
||||
operator hb_blob_t*() const { return mBlob; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -1769,9 +1769,7 @@ void gfxFontUtils::GetVariationInstances(
|
|||
public:
|
||||
explicit AutoHBBlob(hb_blob_t* aBlob) : mBlob(aBlob) {}
|
||||
|
||||
~AutoHBBlob() {
|
||||
hb_blob_destroy(mBlob);
|
||||
}
|
||||
~AutoHBBlob() { hb_blob_destroy(mBlob); }
|
||||
|
||||
operator hb_blob_t*() { return mBlob; }
|
||||
|
||||
|
|
|
@ -372,8 +372,7 @@ nsresult gfxSVGGlyphsDocument::ParseDocument(const uint8_t *aBuffer,
|
|||
nsresult status;
|
||||
channel->GetStatus(&status);
|
||||
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(status)) {
|
||||
rv = listener->OnDataAvailable(channel, stream, 0,
|
||||
aBufLen);
|
||||
rv = listener->OnDataAvailable(channel, stream, 0, aBufLen);
|
||||
if (NS_FAILED(rv)) {
|
||||
channel->Cancel(rv);
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ void VRDisplayHost::SubmitFrameInternal(
|
|||
#endif // !defined(MOZ_WIDGET_ANDROID)
|
||||
AUTO_PROFILER_TRACING("VR", "SubmitFrameAtVRDisplayHost", OTHER);
|
||||
|
||||
{ // scope lock
|
||||
{ // scope lock
|
||||
MonitorAutoLock lock(mCurrentSubmitTaskMonitor);
|
||||
|
||||
if (!SubmitFrame(aTexture, aFrameId, aLeftEyeRect, aRightEyeRect)) {
|
||||
|
@ -355,10 +355,9 @@ void VRDisplayHost::SubmitFrame(VRLayerParent* aLayer,
|
|||
|
||||
mFrameStarted = false;
|
||||
|
||||
RefPtr<CancelableRunnable> task =
|
||||
NewCancelableRunnableMethod<StoreCopyPassByConstLRef<layers::SurfaceDescriptor>,
|
||||
uint64_t, StoreCopyPassByConstLRef<gfx::Rect>,
|
||||
StoreCopyPassByConstLRef<gfx::Rect>>(
|
||||
RefPtr<CancelableRunnable> task = NewCancelableRunnableMethod<
|
||||
StoreCopyPassByConstLRef<layers::SurfaceDescriptor>, uint64_t,
|
||||
StoreCopyPassByConstLRef<gfx::Rect>, StoreCopyPassByConstLRef<gfx::Rect>>(
|
||||
"gfx::VRDisplayHost::SubmitFrameInternal", this,
|
||||
&VRDisplayHost::SubmitFrameInternal, aTexture, aFrameId, aLeftEyeRect,
|
||||
aRightEyeRect);
|
||||
|
@ -375,7 +374,6 @@ void VRDisplayHost::SubmitFrame(VRLayerParent* aLayer,
|
|||
CompositorThreadHolder::Loop()->PostTask(task.forget());
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void VRDisplayHost::CancelCurrentSubmitTask() {
|
||||
|
|
|
@ -161,7 +161,8 @@ bool RenderCompositorANGLE::Initialize() {
|
|||
desc.SampleDesc.Quality = 0;
|
||||
// DXGI_USAGE_SHADER_INPUT is set for improving performanc of copying from
|
||||
// framebuffer to texture on intel gpu.
|
||||
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
|
||||
desc.BufferUsage =
|
||||
DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
|
||||
// Do not use DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, since it makes HWND
|
||||
// unreusable.
|
||||
// desc.BufferCount = 2;
|
||||
|
@ -191,7 +192,8 @@ bool RenderCompositorANGLE::Initialize() {
|
|||
swapDesc.SampleDesc.Quality = 0;
|
||||
// DXGI_USAGE_SHADER_INPUT is set for improving performanc of copying from
|
||||
// framebuffer to texture on intel gpu.
|
||||
swapDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
|
||||
swapDesc.BufferUsage =
|
||||
DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
|
||||
swapDesc.BufferCount = 1;
|
||||
swapDesc.OutputWindow = hwnd;
|
||||
swapDesc.Windowed = TRUE;
|
||||
|
|
|
@ -691,7 +691,8 @@ Maybe<wr::WrSpatialId> DisplayListBuilder::PushStackingContext(
|
|||
auto spatialId = wr_dp_push_stacking_context(
|
||||
mWrState, aBounds, mCurrentSpaceAndClipChain.space, &aParams,
|
||||
maybeTransform, aParams.mFilters.Elements(), aParams.mFilters.Length(),
|
||||
aParams.mFilterDatas.Elements(), aParams.mFilterDatas.Length(), aRasterSpace);
|
||||
aParams.mFilterDatas.Elements(), aParams.mFilterDatas.Length(),
|
||||
aRasterSpace);
|
||||
|
||||
return spatialId.id != 0 ? Some(spatialId) : Nothing();
|
||||
}
|
||||
|
|
|
@ -57,9 +57,7 @@ struct ExternalImageKeyPair {
|
|||
/* Generate a brand new window id and return it. */
|
||||
WindowId NewWindowId();
|
||||
|
||||
inline DebugFlags NewDebugFlags(uint32_t aFlags) {
|
||||
return {aFlags};
|
||||
}
|
||||
inline DebugFlags NewDebugFlags(uint32_t aFlags) { return {aFlags}; }
|
||||
|
||||
inline Maybe<wr::ImageFormat> SurfaceFormatToImageFormat(
|
||||
gfx::SurfaceFormat aFormat) {
|
||||
|
|
|
@ -33,8 +33,8 @@ void gecko_profiler_unregister_thread();
|
|||
|
||||
void gecko_profiler_start_marker(const char* name);
|
||||
void gecko_profiler_end_marker(const char* name);
|
||||
void gecko_profiler_add_text_marker(
|
||||
const char* name, const char* text_ptr, size_t text_len, uint64_t microseconds);
|
||||
void gecko_profiler_add_text_marker(const char* name, const char* text_ptr,
|
||||
size_t text_len, uint64_t microseconds);
|
||||
bool gecko_profiler_thread_is_being_profiled();
|
||||
|
||||
// IMPORTANT: Keep this synchronized with enumerate_interners in
|
||||
|
@ -53,7 +53,6 @@ bool gecko_profiler_thread_is_being_profiled();
|
|||
macro(text_run); \
|
||||
macro(filterdata);
|
||||
|
||||
|
||||
// Prelude of types necessary before including webrender_ffi_generated.h
|
||||
namespace mozilla {
|
||||
namespace wr {
|
||||
|
|
|
@ -186,8 +186,7 @@ void SVGDocumentWrapper::TickRefreshDriver() {
|
|||
/** nsIStreamListener methods **/
|
||||
|
||||
NS_IMETHODIMP
|
||||
SVGDocumentWrapper::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* inStr,
|
||||
SVGDocumentWrapper::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* inStr,
|
||||
uint64_t sourceOffset, uint32_t count) {
|
||||
return mListener->OnDataAvailable(aRequest, inStr, sourceOffset, count);
|
||||
}
|
||||
|
@ -199,8 +198,7 @@ SVGDocumentWrapper::OnStartRequest(nsIRequest* aRequest) {
|
|||
nsresult rv = SetupViewer(aRequest, getter_AddRefs(mViewer),
|
||||
getter_AddRefs(mLoadGroup));
|
||||
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
NS_SUCCEEDED(mListener->OnStartRequest(aRequest))) {
|
||||
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(mListener->OnStartRequest(aRequest))) {
|
||||
mViewer->GetDocument()->SetIsBeingUsedAsImage();
|
||||
StopAnimation(); // otherwise animations start automatically in helper doc
|
||||
|
||||
|
@ -213,8 +211,7 @@ SVGDocumentWrapper::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SVGDocumentWrapper::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult status) {
|
||||
SVGDocumentWrapper::OnStopRequest(nsIRequest* aRequest, nsresult status) {
|
||||
if (mListener) {
|
||||
mListener->OnStopRequest(aRequest, status);
|
||||
mListener = nullptr;
|
||||
|
|
|
@ -1367,8 +1367,7 @@ VectorImage::OnStartRequest(nsIRequest* aRequest) {
|
|||
|
||||
//******************************************************************************
|
||||
NS_IMETHODIMP
|
||||
VectorImage::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
VectorImage::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
if (mError) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -1468,15 +1467,14 @@ void VectorImage::OnSVGDocumentError() {
|
|||
|
||||
//******************************************************************************
|
||||
NS_IMETHODIMP
|
||||
VectorImage::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aInStr, uint64_t aSourceOffset,
|
||||
uint32_t aCount) {
|
||||
VectorImage::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInStr,
|
||||
uint64_t aSourceOffset, uint32_t aCount) {
|
||||
if (mError) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return mSVGDocumentWrapper->OnDataAvailable(aRequest, aInStr,
|
||||
aSourceOffset, aCount);
|
||||
return mSVGDocumentWrapper->OnDataAvailable(aRequest, aInStr, aSourceOffset,
|
||||
aCount);
|
||||
}
|
||||
|
||||
// --------------------------
|
||||
|
|
|
@ -98,8 +98,8 @@ nsIconChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
|||
|
||||
// nsIStreamListener methods
|
||||
NS_IMETHODIMP
|
||||
nsIconChannel::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
nsIconChannel::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
if (mListener) {
|
||||
return mListener->OnDataAvailable(this, aStream, aOffset, aCount);
|
||||
}
|
||||
|
|
|
@ -714,8 +714,7 @@ NS_IMETHODIMP nsIconChannel::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsIconChannel::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult aStatus) {
|
||||
nsIconChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||
if (mListener) {
|
||||
mListener->OnStopRequest(this, aStatus);
|
||||
mListener = nullptr;
|
||||
|
@ -734,9 +733,8 @@ nsIconChannel::OnStopRequest(nsIRequest* aRequest,
|
|||
|
||||
// nsIStreamListener methods
|
||||
NS_IMETHODIMP
|
||||
nsIconChannel::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aStream, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
nsIconChannel::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
if (mListener) {
|
||||
return mListener->OnDataAvailable(this, aStream, aOffset, aCount);
|
||||
}
|
||||
|
|
|
@ -2693,8 +2693,7 @@ ProxyListener::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ProxyListener::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult status) {
|
||||
ProxyListener::OnStopRequest(nsIRequest* aRequest, nsresult status) {
|
||||
if (!mDestListener) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -2705,15 +2704,13 @@ ProxyListener::OnStopRequest(nsIRequest* aRequest,
|
|||
/** nsIStreamListener methods **/
|
||||
|
||||
NS_IMETHODIMP
|
||||
ProxyListener::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* inStr, uint64_t sourceOffset,
|
||||
uint32_t count) {
|
||||
ProxyListener::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* inStr,
|
||||
uint64_t sourceOffset, uint32_t count) {
|
||||
if (!mDestListener) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return mDestListener->OnDataAvailable(aRequest, inStr, sourceOffset,
|
||||
count);
|
||||
return mDestListener->OnDataAvailable(aRequest, inStr, sourceOffset, count);
|
||||
}
|
||||
|
||||
/** nsThreadRetargetableStreamListener methods **/
|
||||
|
@ -2919,8 +2916,7 @@ imgCacheValidator::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgCacheValidator::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult status) {
|
||||
imgCacheValidator::OnStopRequest(nsIRequest* aRequest, nsresult status) {
|
||||
// Be sure we've released the document that we may have been holding on to.
|
||||
mContext = nullptr;
|
||||
|
||||
|
@ -2934,9 +2930,8 @@ imgCacheValidator::OnStopRequest(nsIRequest* aRequest,
|
|||
/** nsIStreamListener methods **/
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgCacheValidator::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* inStr, uint64_t sourceOffset,
|
||||
uint32_t count) {
|
||||
imgCacheValidator::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* inStr,
|
||||
uint64_t sourceOffset, uint32_t count) {
|
||||
if (!mDestListener) {
|
||||
// XXX see bug 113959
|
||||
uint32_t _retval;
|
||||
|
@ -2944,8 +2939,7 @@ imgCacheValidator::OnDataAvailable(nsIRequest* aRequest,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
return mDestListener->OnDataAvailable(aRequest, inStr, sourceOffset,
|
||||
count);
|
||||
return mDestListener->OnDataAvailable(aRequest, inStr, sourceOffset, count);
|
||||
}
|
||||
|
||||
/** nsIThreadRetargetableStreamListener methods **/
|
||||
|
|
|
@ -735,8 +735,7 @@ imgRequest::OnStartRequest(nsIRequest* aRequest) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgRequest::OnStopRequest(nsIRequest* aRequest,
|
||||
nsresult status) {
|
||||
imgRequest::OnStopRequest(nsIRequest* aRequest, nsresult status) {
|
||||
LOG_FUNC(gImgLog, "imgRequest::OnStopRequest");
|
||||
MOZ_ASSERT(NS_IsMainThread(), "Can't send notifications off-main-thread");
|
||||
|
||||
|
@ -779,7 +778,8 @@ imgRequest::OnStopRequest(nsIRequest* aRequest,
|
|||
// trigger a failure, since the image might be waiting for more non-optional
|
||||
// data and this is the point where we break the news that it's not coming.
|
||||
if (image) {
|
||||
nsresult rv = image->OnImageDataComplete(aRequest, nullptr, status, lastPart);
|
||||
nsresult rv =
|
||||
image->OnImageDataComplete(aRequest, nullptr, status, lastPart);
|
||||
|
||||
// If we got an error in the OnImageDataComplete() call, we don't want to
|
||||
// proceed as if nothing bad happened. However, we also want to give
|
||||
|
@ -989,9 +989,8 @@ void imgRequest::FinishPreparingForNewPart(const NewPartResult& aResult) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgRequest::OnDataAvailable(nsIRequest* aRequest,
|
||||
nsIInputStream* aInStr, uint64_t aOffset,
|
||||
uint32_t aCount) {
|
||||
imgRequest::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInStr,
|
||||
uint64_t aOffset, uint32_t aCount) {
|
||||
LOG_SCOPE_WITH_PARAM(gImgLog, "imgRequest::OnDataAvailable", "count", aCount);
|
||||
|
||||
NS_ASSERTION(aRequest, "imgRequest::OnDataAvailable -- no request!");
|
||||
|
@ -1062,8 +1061,8 @@ imgRequest::OnDataAvailable(nsIRequest* aRequest,
|
|||
|
||||
// Notify the image that it has new data.
|
||||
if (aInStr) {
|
||||
nsresult rv = image->OnImageDataAvailable(aRequest, nullptr, aInStr,
|
||||
aOffset, aCount);
|
||||
nsresult rv =
|
||||
image->OnImageDataAvailable(aRequest, nullptr, aInStr, aOffset, aCount);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_LOG(gImgLog, LogLevel::Warning,
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
# include "mozilla/Assertions.h"
|
||||
# include "mozilla/UniquePtr.h"
|
||||
|
||||
# include "ICUUtils.h"
|
||||
# include "mozilla/Preferences.h"
|
||||
|
@ -157,10 +157,9 @@ double ICUUtils::ParseNumber(nsAString& aValue,
|
|||
int32_t parsePos = 0;
|
||||
static_assert(sizeof(UChar) == 2 && sizeof(nsAString::char_type) == 2,
|
||||
"Unexpected character size - the following cast is unsafe");
|
||||
double val =
|
||||
unum_parseDouble(format.get(),
|
||||
(const UChar*)PromiseFlatString(aValue).get(),
|
||||
length, &parsePos, &status);
|
||||
double val = unum_parseDouble(format.get(),
|
||||
(const UChar*)PromiseFlatString(aValue).get(),
|
||||
length, &parsePos, &status);
|
||||
if (U_SUCCESS(status) && parsePos == (int32_t)length) {
|
||||
return val;
|
||||
}
|
||||
|
|
|
@ -59,18 +59,20 @@ class InputStreamHelper {
|
|||
|
||||
// When a stream wants to serialize itself as IPCRemoteStream, it uses one of
|
||||
// these methods.
|
||||
static void SerializeInputStreamAsPipe(
|
||||
nsIInputStream* aInputStream, InputStreamParams& aParams,
|
||||
bool aDelayedStart, mozilla::dom::ContentChild* aManager);
|
||||
static void SerializeInputStreamAsPipe(nsIInputStream* aInputStream,
|
||||
InputStreamParams& aParams,
|
||||
bool aDelayedStart,
|
||||
mozilla::dom::ContentChild* aManager);
|
||||
|
||||
static void SerializeInputStreamAsPipe(nsIInputStream* aInputStream,
|
||||
InputStreamParams& aParams,
|
||||
bool aDelayedStart,
|
||||
PBackgroundChild* aManager);
|
||||
|
||||
static void SerializeInputStreamAsPipe(
|
||||
nsIInputStream* aInputStream, InputStreamParams& aParams,
|
||||
bool aDelayedStart, mozilla::dom::ContentParent* aManager);
|
||||
static void SerializeInputStreamAsPipe(nsIInputStream* aInputStream,
|
||||
InputStreamParams& aParams,
|
||||
bool aDelayedStart,
|
||||
mozilla::dom::ContentParent* aManager);
|
||||
|
||||
static void SerializeInputStreamAsPipe(nsIInputStream* aInputStream,
|
||||
InputStreamParams& aParams,
|
||||
|
|
|
@ -79,7 +79,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream,
|
|||
#define NS_DECL_NSIIPCSERIALIZABLEINPUTSTREAM \
|
||||
virtual void Serialize(mozilla::ipc::InputStreamParams&, \
|
||||
FileDescriptorArray&, bool, uint32_t, uint32_t*, \
|
||||
mozilla::dom::ContentChild*) override; \
|
||||
mozilla::dom::ContentChild*) override; \
|
||||
\
|
||||
virtual void Serialize(mozilla::ipc::InputStreamParams&, \
|
||||
FileDescriptorArray&, bool, uint32_t, uint32_t*, \
|
||||
|
@ -87,7 +87,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream,
|
|||
\
|
||||
virtual void Serialize(mozilla::ipc::InputStreamParams&, \
|
||||
FileDescriptorArray&, bool, uint32_t, uint32_t*, \
|
||||
mozilla::dom::ContentParent*) override; \
|
||||
mozilla::dom::ContentParent*) override; \
|
||||
\
|
||||
virtual void Serialize(mozilla::ipc::InputStreamParams&, \
|
||||
FileDescriptorArray&, bool, uint32_t, uint32_t*, \
|
||||
|
@ -101,7 +101,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream,
|
|||
FileDescriptorArray& aFileDescriptors, \
|
||||
bool aDelayedStart, uint32_t aMaxSize, \
|
||||
uint32_t* aSizeUsed, \
|
||||
mozilla::dom::ContentChild* aManager) override { \
|
||||
mozilla::dom::ContentChild* aManager) override { \
|
||||
_to Serialize(aParams, aFileDescriptors, aDelayedStart, aMaxSize, \
|
||||
aSizeUsed, aManager); \
|
||||
} \
|
||||
|
@ -119,7 +119,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream,
|
|||
FileDescriptorArray& aFileDescriptors, \
|
||||
bool aDelayedStart, uint32_t aMaxSize, \
|
||||
uint32_t* aSizeUsed, \
|
||||
mozilla::dom::ContentParent* aManager) override { \
|
||||
mozilla::dom::ContentParent* aManager) override { \
|
||||
_to Serialize(aParams, aFileDescriptors, aDelayedStart, aMaxSize, \
|
||||
aSizeUsed, aManager); \
|
||||
} \
|
||||
|
@ -144,7 +144,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream,
|
|||
FileDescriptorArray& aFileDescriptors, \
|
||||
bool aDelayedStart, uint32_t aMaxSize, \
|
||||
uint32_t* aSizeUsed, \
|
||||
mozilla::dom::ContentChild* aManager) override { \
|
||||
mozilla::dom::ContentChild* aManager) override { \
|
||||
if (_to) { \
|
||||
_to->Serialize(aParams, aFileDescriptors, aDelayedStart, aMaxSize, \
|
||||
aSizeUsed, aManager); \
|
||||
|
@ -166,7 +166,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream,
|
|||
FileDescriptorArray& aFileDescriptors, \
|
||||
bool aDelayedStart, uint32_t aMaxSize, \
|
||||
uint32_t* aSizeUsed, \
|
||||
mozilla::dom::ContentParent* aManager) override { \
|
||||
mozilla::dom::ContentParent* aManager) override { \
|
||||
if (_to) { \
|
||||
_to->Serialize(aParams, aFileDescriptors, aDelayedStart, aMaxSize, \
|
||||
aSizeUsed, aManager); \
|
||||
|
|
|
@ -153,18 +153,18 @@ class JSErrorNotes {
|
|||
~JSErrorNotes();
|
||||
|
||||
// Add an note to the given position.
|
||||
bool addNoteASCII(JSContext* cx, const char* filename,
|
||||
unsigned sourceId, unsigned lineno,
|
||||
unsigned column, JSErrorCallback errorCallback,
|
||||
void* userRef, const unsigned errorNumber, ...);
|
||||
bool addNoteLatin1(JSContext* cx, const char* filename,
|
||||
unsigned sourceId, unsigned lineno,
|
||||
unsigned column, JSErrorCallback errorCallback,
|
||||
void* userRef, const unsigned errorNumber, ...);
|
||||
bool addNoteUTF8(JSContext* cx, const char* filename,
|
||||
unsigned sourceId, unsigned lineno,
|
||||
unsigned column, JSErrorCallback errorCallback,
|
||||
void* userRef, const unsigned errorNumber, ...);
|
||||
bool addNoteASCII(JSContext* cx, const char* filename, unsigned sourceId,
|
||||
unsigned lineno, unsigned column,
|
||||
JSErrorCallback errorCallback, void* userRef,
|
||||
const unsigned errorNumber, ...);
|
||||
bool addNoteLatin1(JSContext* cx, const char* filename, unsigned sourceId,
|
||||
unsigned lineno, unsigned column,
|
||||
JSErrorCallback errorCallback, void* userRef,
|
||||
const unsigned errorNumber, ...);
|
||||
bool addNoteUTF8(JSContext* cx, const char* filename, unsigned sourceId,
|
||||
unsigned lineno, unsigned column,
|
||||
JSErrorCallback errorCallback, void* userRef,
|
||||
const unsigned errorNumber, ...);
|
||||
|
||||
JS_PUBLIC_API size_t length();
|
||||
|
||||
|
|
|
@ -1010,8 +1010,7 @@ const ClassSpec DataViewObject::classSpec_ = {
|
|||
nullptr,
|
||||
DataViewObject::methods,
|
||||
DataViewObject::properties,
|
||||
DataViewObject::finishInit
|
||||
};
|
||||
DataViewObject::finishInit};
|
||||
|
||||
const Class DataViewObject::class_ = {
|
||||
"DataView",
|
||||
|
@ -1047,8 +1046,7 @@ const JSFunctionSpec DataViewObject::bigIntMethods[] = {
|
|||
JS_FN("getBigInt64", DataViewObject::fun_getBigInt64, 1, 0),
|
||||
JS_FN("getBigUint64", DataViewObject::fun_getBigUint64, 1, 0),
|
||||
JS_FN("setBigInt64", DataViewObject::fun_setBigInt64, 2, 0),
|
||||
JS_FN("setBigUint64", DataViewObject::fun_setBigUint64, 2, 0),
|
||||
JS_FS_END};
|
||||
JS_FN("setBigUint64", DataViewObject::fun_setBigUint64, 2, 0), JS_FS_END};
|
||||
|
||||
const JSPropertySpec DataViewObject::properties[] = {
|
||||
JS_PSG("buffer", DataViewObject::bufferGetter, 0),
|
||||
|
|
|
@ -22,8 +22,7 @@ MOZ_MUST_USE bool testingFunc_assertRecoveredOnBailout(JSContext* cx,
|
|||
unsigned argc,
|
||||
Value* vp);
|
||||
|
||||
MOZ_MUST_USE bool testingFunc_serialize(JSContext* cx,
|
||||
unsigned argc,
|
||||
MOZ_MUST_USE bool testingFunc_serialize(JSContext* cx, unsigned argc,
|
||||
Value* vp);
|
||||
|
||||
extern JSScript* TestingFunctionArgumentToScript(JSContext* cx, HandleValue v,
|
||||
|
|
|
@ -163,11 +163,13 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
|
|||
unsigned firstLine = 0; /* first line, for JSScript::initFromEmitter */
|
||||
|
||||
uint32_t maxFixedSlots = 0; /* maximum number of fixed frame slots so far */
|
||||
uint32_t maxStackDepth = 0; /* maximum number of expression stack slots so far */
|
||||
uint32_t maxStackDepth =
|
||||
0; /* maximum number of expression stack slots so far */
|
||||
|
||||
int32_t stackDepth = 0; /* current stack depth in script frame */
|
||||
|
||||
uint32_t bodyScopeIndex = UINT32_MAX; /* index into scopeList of the body scope */
|
||||
uint32_t bodyScopeIndex =
|
||||
UINT32_MAX; /* index into scopeList of the body scope */
|
||||
|
||||
EmitterScope* varEmitterScope = nullptr;
|
||||
NestableControl* innermostNestableControl = nullptr;
|
||||
|
@ -352,8 +354,8 @@ struct MOZ_STACK_CLASS BytecodeEmitter {
|
|||
Scope* outermostScope() const { return scopeList.vector[0]; }
|
||||
Scope* innermostScope() const;
|
||||
Scope* bodyScope() const {
|
||||
MOZ_ASSERT(bodyScopeIndex < scopeList.length());
|
||||
return scopeList.vector[bodyScopeIndex];
|
||||
MOZ_ASSERT(bodyScopeIndex < scopeList.length());
|
||||
return scopeList.vector[bodyScopeIndex];
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE
|
||||
|
|
|
@ -491,7 +491,7 @@ bool FunctionScriptEmitter::prepareForBody() {
|
|||
|
||||
bool FunctionScriptEmitter::emitAsyncFunctionRejectPrologue() {
|
||||
rejectTryCatch_.emplace(bce_, TryEmitter::Kind::TryCatch,
|
||||
TryEmitter::ControlKind::NonSyntactic);
|
||||
TryEmitter::ControlKind::NonSyntactic);
|
||||
return rejectTryCatch_->emitTry();
|
||||
}
|
||||
|
||||
|
@ -508,7 +508,8 @@ bool FunctionScriptEmitter::emitAsyncFunctionRejectEpilogue() {
|
|||
// [stack] EXC GEN
|
||||
return false;
|
||||
}
|
||||
if (!bce_->emit2(JSOP_ASYNCRESOLVE, uint8_t(AsyncFunctionResolveKind::Reject))) {
|
||||
if (!bce_->emit2(JSOP_ASYNCRESOLVE,
|
||||
uint8_t(AsyncFunctionResolveKind::Reject))) {
|
||||
// [stack] PROMISE
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -759,10 +759,9 @@ MOZ_COLD void TokenStreamChars<Utf8Unit, AnyCharsAccess>::internalEncodingError(
|
|||
uint32_t line, column;
|
||||
computeLineAndColumn(offset, &line, &column);
|
||||
|
||||
if (!notes->addNoteASCII(anyChars.cx, anyChars.getFilename(),
|
||||
0, line, column,
|
||||
GetErrorMessage, nullptr, JSMSG_BAD_CODE_UNITS,
|
||||
badUnitsStr)) {
|
||||
if (!notes->addNoteASCII(anyChars.cx, anyChars.getFilename(), 0, line,
|
||||
column, GetErrorMessage, nullptr,
|
||||
JSMSG_BAD_CODE_UNITS, badUnitsStr)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,9 @@ using namespace js;
|
|||
using namespace gc;
|
||||
|
||||
template <AllowGC allowGC /* = CanGC */>
|
||||
JSObject* js::AllocateObject(JSContext* cx, AllocKind kind, size_t nDynamicSlots,
|
||||
InitialHeap heap, const Class* clasp) {
|
||||
JSObject* js::AllocateObject(JSContext* cx, AllocKind kind,
|
||||
size_t nDynamicSlots, InitialHeap heap,
|
||||
const Class* clasp) {
|
||||
MOZ_ASSERT(IsObjectAllocKind(kind));
|
||||
size_t thingSize = Arena::thingSize(kind);
|
||||
|
||||
|
@ -75,16 +76,14 @@ JSObject* js::AllocateObject(JSContext* cx, AllocKind kind, size_t nDynamicSlots
|
|||
return GCRuntime::tryNewTenuredObject<allowGC>(cx, kind, thingSize,
|
||||
nDynamicSlots);
|
||||
}
|
||||
template JSObject* js::AllocateObject<NoGC>(JSContext* cx,
|
||||
gc::AllocKind kind,
|
||||
template JSObject* js::AllocateObject<NoGC>(JSContext* cx, gc::AllocKind kind,
|
||||
size_t nDynamicSlots,
|
||||
gc::InitialHeap heap,
|
||||
const Class* clasp);
|
||||
template JSObject* js::AllocateObject<CanGC>(JSContext* cx,
|
||||
gc::AllocKind kind,
|
||||
size_t nDynamicSlots,
|
||||
gc::InitialHeap heap,
|
||||
const Class* clasp);
|
||||
template JSObject* js::AllocateObject<CanGC>(JSContext* cx, gc::AllocKind kind,
|
||||
size_t nDynamicSlots,
|
||||
gc::InitialHeap heap,
|
||||
const Class* clasp);
|
||||
|
||||
// Attempt to allocate a new JSObject out of the nursery. If there is not
|
||||
// enough room in the nursery or there is an OOM, this method will return
|
||||
|
|
|
@ -32,8 +32,9 @@ T* Allocate(JSContext* cx);
|
|||
// optimizations. If dynamic slots are requested they will be allocated and the
|
||||
// pointer stored directly in |NativeObject::slots_|.
|
||||
template <AllowGC allowGC = CanGC>
|
||||
JSObject* AllocateObject(JSContext* cx, gc::AllocKind kind, size_t nDynamicSlots,
|
||||
gc::InitialHeap heap, const Class* clasp);
|
||||
JSObject* AllocateObject(JSContext* cx, gc::AllocKind kind,
|
||||
size_t nDynamicSlots, gc::InitialHeap heap,
|
||||
const Class* clasp);
|
||||
|
||||
// Internal function used for nursery-allocatable strings.
|
||||
template <typename StringAllocT, AllowGC allowGC = CanGC>
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче