зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1692391 - Replace the NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_NSRESULT macros with the functionally identical NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE). r=haik
This patch was generated with the commands: ``` rg -l 'NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT' . | xargs sed -i '' -e 's/NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT/NS_OBJC_BEGIN_TRY_BLOCK_RETURN/g' rg -l 'NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT' . | xargs sed -i '' -e 's/NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT/NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)/g' ``` Differential Revision: https://phabricator.services.mozilla.com/D104957
This commit is contained in:
Родитель
5257db6695
Коммит
56051da2d0
|
@ -138,7 +138,7 @@ void AccessibleWrap::Shutdown() {
|
|||
}
|
||||
|
||||
nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult rv = Accessible::HandleAccEvent(aEvent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -273,7 +273,7 @@ nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
bool AccessibleWrap::ApplyPostFilter(const EWhichPostFilter& aSearchKey,
|
||||
|
|
|
@ -44,7 +44,7 @@ xpcAccessibleMacInterface::xpcAccessibleMacInterface(AccessibleOrProxy aObj)
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleMacInterface::GetAttributeNames(nsTArray<nsString>& aAttributeNames) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
if (!mNativeObject || [mNativeObject isExpired]) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
@ -58,12 +58,12 @@ xpcAccessibleMacInterface::GetAttributeNames(nsTArray<nsString>& aAttributeNames
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleMacInterface::GetParameterizedAttributeNames(nsTArray<nsString>& aAttributeNames) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
if (!mNativeObject || [mNativeObject isExpired]) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
@ -77,12 +77,12 @@ xpcAccessibleMacInterface::GetParameterizedAttributeNames(nsTArray<nsString>& aA
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleMacInterface::GetActionNames(nsTArray<nsString>& aActionNames) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
if (!mNativeObject || [mNativeObject isExpired]) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
@ -96,12 +96,12 @@ xpcAccessibleMacInterface::GetActionNames(nsTArray<nsString>& aActionNames) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleMacInterface::PerformAction(const nsAString& aActionName) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
if (!mNativeObject || [mNativeObject isExpired]) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
@ -112,13 +112,13 @@ xpcAccessibleMacInterface::PerformAction(const nsAString& aActionName) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleMacInterface::GetAttributeValue(const nsAString& aAttributeName, JSContext* aCx,
|
||||
JS::MutableHandleValue aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
if (!mNativeObject || [mNativeObject isExpired]) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
@ -127,7 +127,7 @@ xpcAccessibleMacInterface::GetAttributeValue(const nsAString& aAttributeName, JS
|
|||
NSString* attribName = nsCocoaUtils::ToNSString(aAttributeName);
|
||||
return NSObjectToJsValue([mNativeObject accessibilityAttributeValue:attribName], aCx, aResult);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -117,17 +117,17 @@ SpeechTaskCallback::~SpeechTaskCallback() {
|
|||
|
||||
NS_IMETHODIMP
|
||||
SpeechTaskCallback::OnCancel() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[mSpeechSynthesizer stopSpeaking];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SpeechTaskCallback::OnPause() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[mSpeechSynthesizer pauseSpeakingAtBoundary:NSSpeechImmediateBoundary];
|
||||
if (!mTask) {
|
||||
|
@ -138,12 +138,12 @@ SpeechTaskCallback::OnPause() {
|
|||
mTask->DispatchPause(GetTimeDurationFromStart(), mCurrentIndex);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SpeechTaskCallback::OnResume() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[mSpeechSynthesizer continueSpeaking];
|
||||
if (!mTask) {
|
||||
|
@ -154,19 +154,19 @@ SpeechTaskCallback::OnResume() {
|
|||
mTask->DispatchResume(GetTimeDurationFromStart(), mCurrentIndex);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SpeechTaskCallback::OnVolumeChanged(float aVolume) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[mSpeechSynthesizer setObject:[NSNumber numberWithFloat:aVolume]
|
||||
forProperty:NSSpeechVolumeProperty
|
||||
error:nil];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
float SpeechTaskCallback::GetTimeDurationFromStart() {
|
||||
|
@ -262,7 +262,7 @@ class EnumVoicesRunnable final : public Runnable {
|
|||
|
||||
NS_IMETHODIMP
|
||||
EnumVoicesRunnable::Run() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
AutoTArray<OSXVoice, 64> list;
|
||||
|
||||
|
@ -297,7 +297,7 @@ EnumVoicesRunnable::Run() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
StaticRefPtr<OSXSpeechSynthesizerService> OSXSpeechSynthesizerService::sSingleton;
|
||||
|
@ -336,7 +336,7 @@ bool OSXSpeechSynthesizerService::Init() {
|
|||
NS_IMETHODIMP
|
||||
OSXSpeechSynthesizerService::Speak(const nsAString& aText, const nsAString& aUri, float aVolume,
|
||||
float aRate, float aPitch, nsISpeechTask* aTask) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
MOZ_ASSERT(StringBeginsWith(aUri, u"urn:moz-tts:osx:"_ns),
|
||||
"OSXSpeechSynthesizerService doesn't allow this voice URI");
|
||||
|
@ -396,7 +396,7 @@ OSXSpeechSynthesizerService::Speak(const nsAString& aText, const nsAString& aUri
|
|||
aTask->DispatchStart();
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -93,7 +93,7 @@ already_AddRefed<DrawTarget> PrintTargetCG::GetReferenceDrawTarget() {
|
|||
|
||||
nsresult PrintTargetCG::BeginPrinting(const nsAString& aTitle, const nsAString& aPrintToFileName,
|
||||
int32_t aStartPage, int32_t aEndPage) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Print Core of Application Service sent print job with names exceeding
|
||||
// 255 bytes. This is a workaround until fix it.
|
||||
|
@ -121,16 +121,16 @@ nsresult PrintTargetCG::BeginPrinting(const nsAString& aTitle, const nsAString&
|
|||
|
||||
return status == noErr ? NS_OK : NS_ERROR_ABORT;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult PrintTargetCG::EndPrinting() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
::PMSessionEndDocumentNoDialog(mPrintSession);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult PrintTargetCG::AbortPrinting() {
|
||||
|
@ -141,7 +141,7 @@ nsresult PrintTargetCG::AbortPrinting() {
|
|||
}
|
||||
|
||||
nsresult PrintTargetCG::BeginPage() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
PMSessionError(mPrintSession);
|
||||
OSStatus status = ::PMSessionBeginPageNoDialog(mPrintSession, mPageFormat, NULL);
|
||||
|
@ -176,11 +176,11 @@ nsresult PrintTargetCG::BeginPage() {
|
|||
|
||||
return PrintTarget::BeginPage();
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult PrintTargetCG::EndPage() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
cairo_surface_finish(mCairoSurface);
|
||||
mCairoSurface = nullptr;
|
||||
|
@ -192,7 +192,7 @@ nsresult PrintTargetCG::EndPage() {
|
|||
|
||||
return PrintTarget::EndPage();
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
|
|
|
@ -230,7 +230,7 @@ nsIconChannel::AsyncOpen(nsIStreamListener* aListener) {
|
|||
}
|
||||
|
||||
nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool aNonBlocking) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsCString contentType;
|
||||
nsAutoCString fileExt;
|
||||
|
@ -345,7 +345,7 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool aNonBlock
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -85,7 +85,7 @@ nsOSXSystemProxySettings::nsOSXSystemProxySettings() : mSystemDynamicStore(NULL)
|
|||
}
|
||||
|
||||
nsresult nsOSXSystemProxySettings::Init() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Register for notification of proxy setting changes
|
||||
// See:
|
||||
|
@ -118,7 +118,7 @@ nsresult nsOSXSystemProxySettings::Init() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsOSXSystemProxySettings::~nsOSXSystemProxySettings() {
|
||||
|
@ -152,7 +152,7 @@ void nsOSXSystemProxySettings::ProxyHasChanged() {
|
|||
nsresult nsOSXSystemProxySettings::FindSCProxyPort(const nsACString& aScheme,
|
||||
nsACString& aResultHost, int32_t& aResultPort,
|
||||
bool& aResultSocksProxy) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NS_ENSURE_TRUE(mProxyDict != NULL, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -184,7 +184,7 @@ nsresult nsOSXSystemProxySettings::FindSCProxyPort(const nsACString& aScheme,
|
|||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
bool nsOSXSystemProxySettings::IsAutoconfigEnabled() const {
|
||||
|
@ -198,7 +198,7 @@ bool nsOSXSystemProxySettings::IsAutoconfigEnabled() const {
|
|||
}
|
||||
|
||||
nsresult nsOSXSystemProxySettings::GetAutoconfigURL(nsAutoCString& aResult) const {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSString* value = [mProxyDict objectForKey:(NSString*)kSCPropNetProxiesProxyAutoConfigURLString];
|
||||
if (value != NULL) {
|
||||
|
@ -209,7 +209,7 @@ nsresult nsOSXSystemProxySettings::GetAutoconfigURL(nsAutoCString& aResult) cons
|
|||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
bool nsOSXSystemProxySettings::IsInExceptionList(const nsACString& aHost) const {
|
||||
|
@ -232,7 +232,7 @@ bool nsOSXSystemProxySettings::IsInExceptionList(const nsACString& aHost) const
|
|||
}
|
||||
|
||||
nsresult nsOSXSystemProxySettings::GetPACURI(nsACString& aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NS_ENSURE_TRUE(mProxyDict != NULL, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -244,14 +244,14 @@ nsresult nsOSXSystemProxySettings::GetPACURI(nsACString& aResult) {
|
|||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsOSXSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
|
||||
const nsACString& aScheme,
|
||||
const nsACString& aHost, const int32_t aPort,
|
||||
nsACString& aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
int32_t proxyPort;
|
||||
nsAutoCString proxyHost;
|
||||
|
@ -268,7 +268,7 @@ nsresult nsOSXSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMPL_COMPONENT_FACTORY(nsOSXSystemProxySettings) {
|
||||
|
|
|
@ -64,7 +64,7 @@ NS_IMETHODIMP nsNativeAppSupportCocoa::Start(bool* _retval) {
|
|||
int major, minor, bugfix;
|
||||
nsCocoaFeatures::GetSystemVersion(major, minor, bugfix);
|
||||
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Check that the OS version is supported, if not return false,
|
||||
// which will make the browser quit. In principle we could display an
|
||||
|
@ -80,12 +80,12 @@ NS_IMETHODIMP nsNativeAppSupportCocoa::Start(bool* _retval) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeAppSupportCocoa::ReOpen() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!mCanShowUI) return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -157,7 +157,7 @@ nsNativeAppSupportCocoa::ReOpen() {
|
|||
} // got window mediator
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
|
@ -31,7 +31,7 @@ NS_IMETHODIMP nsLocalHandlerAppMac::GetName(nsAString& aName) {
|
|||
*/
|
||||
NS_IMETHODIMP
|
||||
nsLocalHandlerAppMac::LaunchWithURI(nsIURI* aURI, mozilla::dom::BrowsingContext* aBrowsingContext) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsILocalFileMac> lfm(do_QueryInterface(mExecutable, &rv));
|
||||
|
@ -74,5 +74,5 @@ nsLocalHandlerAppMac::LaunchWithURI(nsIURI* aURI, mozilla::dom::BrowsingContext*
|
|||
|
||||
return err != noErr ? NS_ERROR_FAILURE : NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ NS_IMETHODIMP nsMIMEInfoMac::GetDefaultDescription(nsAString& aDefaultDescriptio
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsMIMEInfoMac::LaunchWithFile(nsIFile* aFile) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsCOMPtr<nsIFile> application;
|
||||
nsresult rv;
|
||||
|
@ -73,11 +73,11 @@ nsMIMEInfoMac::LaunchWithFile(nsIFile* aFile) {
|
|||
}
|
||||
return app->LaunchWithDoc(aFile, false);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsMIMEInfoMac::LoadUriInternal(nsIURI* aURI) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
|
||||
|
@ -97,5 +97,5 @@ nsresult nsMIMEInfoMac::LoadUriInternal(nsIURI* aURI) {
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define BRAND_BUNDLE_URL "chrome://branding/locale/brand.properties"
|
||||
|
||||
nsresult GetDefaultBundleURL(const nsACString& aScheme, CFURLRef* aBundleURL) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult rv = NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
|
@ -68,7 +68,7 @@ nsresult GetDefaultBundleURL(const nsACString& aScheme, CFURLRef* aBundleURL) {
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
using mozilla::LogLevel;
|
||||
|
@ -127,7 +127,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char* aProtocolSche
|
|||
|
||||
NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme,
|
||||
nsAString& _retval) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult rv = NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
|
@ -159,12 +159,12 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString&
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol(const nsACString& aScheme,
|
||||
bool* _retval) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult rv = NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
|
@ -185,12 +185,12 @@ NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol(const nsACS
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t* aPlatformAppPath,
|
||||
nsIFile** aFile) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsILocalFileMac> localFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
|
||||
|
@ -238,7 +238,7 @@ nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t* aPlatformAppP
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// Returns the MIME types an application bundle explicitly claims to handle.
|
||||
|
@ -554,7 +554,7 @@ nsresult nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
|
|||
mimeInfoMac.forget(aMIMEInfo);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -208,11 +208,11 @@ NS_IMPL_ISUPPORTS(OSXNotificationCenter, nsIAlertsService, nsIAlertsIconData, ns
|
|||
nsIAlertNotificationImageListener)
|
||||
|
||||
nsresult OSXNotificationCenter::Init() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
return (!!NSClassFromString(@"NSUserNotification")) ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -247,7 +247,7 @@ NS_IMETHODIMP
|
|||
OSXNotificationCenter::ShowAlertWithIconData(nsIAlertNotification* aAlert,
|
||||
nsIObserver* aAlertListener, uint32_t aIconSize,
|
||||
const uint8_t* aIconData) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NS_ENSURE_ARG(aAlert);
|
||||
|
||||
|
@ -378,18 +378,18 @@ OSXNotificationCenter::ShowAlertWithIconData(nsIAlertNotification* aAlert,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
OSXNotificationCenter::CloseAlert(const nsAString& aAlertName) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSString* alertName = nsCocoaUtils::ToNSString(aAlertName);
|
||||
CloseAlertCocoaString(alertName);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void OSXNotificationCenter::CloseAlertCocoaString(NSString* aAlertName) {
|
||||
|
@ -499,7 +499,7 @@ void OSXNotificationCenter::ShowPendingNotification(OSXNotificationInfo* osxni)
|
|||
|
||||
NS_IMETHODIMP
|
||||
OSXNotificationCenter::OnImageMissing(nsISupports* aUserData) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
OSXNotificationInfo* osxni = static_cast<OSXNotificationInfo*>(aUserData);
|
||||
if (osxni->mPendingNotification) {
|
||||
|
@ -509,12 +509,12 @@ OSXNotificationCenter::OnImageMissing(nsISupports* aUserData) {
|
|||
}
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
OSXNotificationCenter::OnImageReady(nsISupports* aUserData, imgIRequest* aRequest) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsCOMPtr<imgIContainer> image;
|
||||
nsresult rv = aRequest->GetImage(getter_AddRefs(image));
|
||||
|
@ -536,7 +536,7 @@ OSXNotificationCenter::OnImageReady(nsISupports* aUserData, imgIRequest* aReques
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// nsIAlertsDoNotDisturb
|
||||
|
@ -550,23 +550,23 @@ OSXNotificationCenter::SetManualDoNotDisturb(bool aDoNotDisturb) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
OSXNotificationCenter::GetSuppressForScreenSharing(bool* aRetVal) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
NS_ENSURE_ARG(aRetVal);
|
||||
*aRetVal = mSuppressForScreenSharing;
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
OSXNotificationCenter::SetSuppressForScreenSharing(bool aSuppress) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
mSuppressForScreenSharing = aSuppress;
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -4723,7 +4723,7 @@ nsresult TextInputHandlerBase::SynthesizeNativeKeyEvent(int32_t aNativeKeyboardL
|
|||
uint32_t aModifierFlags,
|
||||
const nsAString& aCharacters,
|
||||
const nsAString& aUnmodifiedCharacters) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
static const uint32_t sModifierFlagMap[][2] = {
|
||||
{nsIWidget::CAPS_LOCK, NSEventModifierFlagCapsLock},
|
||||
|
@ -4779,7 +4779,7 @@ nsresult TextInputHandlerBase::SynthesizeNativeKeyEvent(int32_t aNativeKeyboardL
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NSInteger TextInputHandlerBase::GetWindowLevel() {
|
||||
|
@ -4811,7 +4811,7 @@ NSInteger TextInputHandlerBase::GetWindowLevel() {
|
|||
|
||||
NS_IMETHODIMP
|
||||
TextInputHandlerBase::AttachNativeKeyEvent(WidgetKeyboardEvent& aKeyEvent) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Don't try to replace a native event if one already exists.
|
||||
// OS X doesn't have an OS modifier, can't make a native event.
|
||||
|
@ -4831,7 +4831,7 @@ TextInputHandlerBase::AttachNativeKeyEvent(WidgetKeyboardEvent& aKeyEvent) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
bool TextInputHandlerBase::SetSelection(NSRange& aRange) {
|
||||
|
|
|
@ -298,7 +298,7 @@ void nsAppShell::OnRunLoopActivityChanged(CFRunLoopActivity aActivity) {
|
|||
//
|
||||
// public
|
||||
nsresult nsAppShell::Init() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// No event loop is running yet (unless an embedding app that uses
|
||||
// NSApplicationMain() is running).
|
||||
|
@ -393,7 +393,7 @@ nsresult nsAppShell::Init() {
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// ProcessGeckoEvents
|
||||
|
@ -721,7 +721,7 @@ nsAppShell::Run(void) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsAppShell::Exit(void) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// This method is currently called more than once -- from (according to
|
||||
// mento) an nsAppExitEvent dispatched by nsAppStartup::Quit() and from an
|
||||
|
@ -767,7 +767,7 @@ nsAppShell::Exit(void) {
|
|||
|
||||
return nsBaseAppShell::Exit();
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// OnProcessNextEvent
|
||||
|
@ -782,7 +782,7 @@ nsAppShell::Exit(void) {
|
|||
// public
|
||||
NS_IMETHODIMP
|
||||
nsAppShell::OnProcessNextEvent(nsIThreadInternal* aThread, bool aMayWait) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NS_ASSERTION(mAutoreleasePools, "No stack on which to store autorelease pool");
|
||||
|
||||
|
@ -791,7 +791,7 @@ nsAppShell::OnProcessNextEvent(nsIThreadInternal* aThread, bool aMayWait) {
|
|||
|
||||
return nsBaseAppShell::OnProcessNextEvent(aThread, aMayWait);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// AfterProcessNextEvent
|
||||
|
@ -803,7 +803,7 @@ nsAppShell::OnProcessNextEvent(nsIThreadInternal* aThread, bool aMayWait) {
|
|||
// public
|
||||
NS_IMETHODIMP
|
||||
nsAppShell::AfterProcessNextEvent(nsIThreadInternal* aThread, bool aEventWasProcessed) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
CFIndex count = ::CFArrayGetCount(mAutoreleasePools);
|
||||
|
||||
|
@ -816,7 +816,7 @@ nsAppShell::AfterProcessNextEvent(nsIThreadInternal* aThread, bool aEventWasProc
|
|||
|
||||
return nsBaseAppShell::AfterProcessNextEvent(aThread, aEventWasProcessed);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// AppShellDelegate implementation
|
||||
|
|
|
@ -335,7 +335,7 @@ nsresult nsChildView::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsChildView::TearDownView() {
|
||||
|
@ -617,7 +617,7 @@ void nsChildView::Enable(bool aState) {}
|
|||
bool nsChildView::IsEnabled() const { return true; }
|
||||
|
||||
void nsChildView::SetFocus(Raise, mozilla::dom::CallerType aCallerType) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSWindow* window = [mView window];
|
||||
if (window) [window makeFirstResponder:mView];
|
||||
|
@ -870,7 +870,7 @@ nsresult nsChildView::SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
|
|||
nsresult nsChildView::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
|
||||
uint32_t aNativeMessage, uint32_t aModifierFlags,
|
||||
nsIObserver* aObserver) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
AutoObserverNotifier notifier(aObserver, "mouseevent");
|
||||
|
||||
|
@ -918,13 +918,13 @@ nsresult nsChildView::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
|
|||
[NSApp sendEvent:event];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsChildView::SynthesizeNativeMouseScrollEvent(
|
||||
mozilla::LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, double aDeltaX, double aDeltaY,
|
||||
double aDeltaZ, uint32_t aModifierFlags, uint32_t aAdditionalFlags, nsIObserver* aObserver) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
AutoObserverNotifier notifier(aObserver, "mousescrollevent");
|
||||
|
||||
|
@ -969,13 +969,13 @@ nsresult nsChildView::SynthesizeNativeMouseScrollEvent(
|
|||
CFRelease(cgEvent);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsChildView::SynthesizeNativeTouchPoint(
|
||||
uint32_t aPointerId, TouchPointerState aPointerState, mozilla::LayoutDeviceIntPoint aPoint,
|
||||
double aPointerPressure, uint32_t aPointerOrientation, nsIObserver* aObserver) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
AutoObserverNotifier notifier(aObserver, "touchpoint");
|
||||
|
||||
|
@ -995,7 +995,7 @@ nsresult nsChildView::SynthesizeNativeTouchPoint(
|
|||
DispatchTouchInput(inputToDispatch);
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
bool nsChildView::SendEventToNativeMenuSystem(NSEvent* aEvent) {
|
||||
|
@ -1040,7 +1040,7 @@ void nsChildView::PostHandleKeyEvent(mozilla::WidgetKeyboardEvent* aEvent) {
|
|||
|
||||
// Used for testing native menu system structure and event handling.
|
||||
nsresult nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSString* locationString =
|
||||
[NSString stringWithCharacters:reinterpret_cast<const unichar*>(indexString.BeginReading())
|
||||
|
@ -1060,12 +1060,12 @@ nsresult nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString) {
|
|||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// Used for testing native menu system structure and event handling.
|
||||
nsresult nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsCocoaWindow* widget = GetAppWindowWidget();
|
||||
if (widget) {
|
||||
|
@ -1079,7 +1079,7 @@ nsresult nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString) {
|
|||
}
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
@ -1400,12 +1400,12 @@ nsresult nsChildView::SetTitle(const nsAString& title) {
|
|||
}
|
||||
|
||||
nsresult nsChildView::GetAttention(int32_t aCycleCount) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[NSApp requestUserAttention:NSInformationalRequest];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -4681,7 +4681,7 @@ static gfx::IntPoint GetIntegerDeltaForEvent(NSEvent* aEvent) {
|
|||
}
|
||||
|
||||
nsresult nsChildView::GetSelectionAsPlaintext(nsAString& aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!nsClipboard::sSelectionCache) {
|
||||
MOZ_ASSERT(aResult.IsEmpty());
|
||||
|
@ -4707,7 +4707,7 @@ nsresult nsChildView::GetSelectionAsPlaintext(nsAString& aResult) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
|
@ -94,7 +94,7 @@ void nsClipboard::ClearSelectionCache() { sSelectionCache = nullptr; }
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsClipboard::SetNativeClipboardData(int32_t aWhichClipboard) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if ((aWhichClipboard != kGlobalClipboard && aWhichClipboard != kFindClipboard) || !mTransferable)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -153,12 +153,12 @@ nsClipboard::SetNativeClipboardData(int32_t aWhichClipboard) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsClipboard::TransferableFromPasteboard(nsITransferable* aTransferable,
|
||||
NSPasteboard* cocoaPasteboard) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// get flavor list that includes all acceptable flavors (including ones obtained through
|
||||
// conversion)
|
||||
|
@ -308,12 +308,12 @@ nsresult nsClipboard::TransferableFromPasteboard(nsITransferable* aTransferable,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable, int32_t aWhichClipboard) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if ((aWhichClipboard != kGlobalClipboard && aWhichClipboard != kFindClipboard) || !aTransferable)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -356,14 +356,14 @@ nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable, int32_t aWhi
|
|||
|
||||
return nsClipboard::TransferableFromPasteboard(aTransferable, cocoaPasteboard);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// returns true if we have *any* of the passed in flavors available for pasting
|
||||
NS_IMETHODIMP
|
||||
nsClipboard::HasDataMatchingFlavors(const nsTArray<nsCString>& aFlavorList, int32_t aWhichClipboard,
|
||||
bool* outResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
*outResult = false;
|
||||
|
||||
|
@ -423,7 +423,7 @@ nsClipboard::HasDataMatchingFlavors(const nsTArray<nsCString>& aFlavorList, int3
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -418,7 +418,7 @@ nsresult nsCocoaUtils::CreateCGImageFromSurface(SourceSurface* aSurface, CGImage
|
|||
}
|
||||
|
||||
nsresult nsCocoaUtils::CreateNSImageFromCGImage(CGImageRef aInputImage, NSImage** aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Be very careful when creating the NSImage that the backing NSImageRep is
|
||||
// exactly 1:1 with the input image. On a retina display, both [NSImage
|
||||
|
@ -467,7 +467,7 @@ nsresult nsCocoaUtils::CreateNSImageFromCGImage(CGImageRef aInputImage, NSImage*
|
|||
[offscreenRep release];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsCocoaUtils::CreateNSImageFromImageContainer(imgIContainer* aImage, uint32_t aWhichFrame,
|
||||
|
|
|
@ -300,7 +300,7 @@ static bool UseNativePopupWindows() {
|
|||
// aRect here is specified in desktop pixels
|
||||
nsresult nsCocoaWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
||||
const DesktopIntRect& aRect, nsWidgetInitData* aInitData) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Because the hidden window is created outside of an event loop,
|
||||
// we have to provide an autorelease pool (see bug 559075).
|
||||
|
@ -342,7 +342,7 @@ nsresult nsCocoaWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsCocoaWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
||||
|
@ -375,7 +375,7 @@ static unsigned int WindowMaskForBorderStyle(nsBorderStyle aBorderStyle) {
|
|||
// content rect.
|
||||
nsresult nsCocoaWindow::CreateNativeWindow(const NSRect& aRect, nsBorderStyle aBorderStyle,
|
||||
bool aRectIsFrameRect) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// We default to NSWindowStyleMaskBorderless, add features if needed.
|
||||
unsigned int features = NSWindowStyleMaskBorderless;
|
||||
|
@ -532,12 +532,12 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect& aRect, nsBorderStyle aB
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsCocoaWindow::CreatePopupContentView(const LayoutDeviceIntRect& aRect,
|
||||
nsWidgetInitData* aInitData) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// We need to make our content view a ChildView.
|
||||
mPopupContentView = new nsChildView();
|
||||
|
@ -559,7 +559,7 @@ nsresult nsCocoaWindow::CreatePopupContentView(const LayoutDeviceIntRect& aRect,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsCocoaWindow::Destroy() {
|
||||
|
@ -1659,7 +1659,7 @@ nsresult nsCocoaWindow::MakeFullScreenWithNativeTransition(bool aFullScreen,
|
|||
}
|
||||
|
||||
nsresult nsCocoaWindow::DoMakeFullScreen(bool aFullScreen, bool aUseSystemTransition) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!mWindow) {
|
||||
return NS_OK;
|
||||
|
@ -1697,7 +1697,7 @@ nsresult nsCocoaWindow::DoMakeFullScreen(bool aFullScreen, bool aUseSystemTransi
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// Coordinates are desktop pixels
|
||||
|
@ -1934,7 +1934,7 @@ void nsCocoaWindow::SetCursor(nsCursor aDefaultCursor, imgIContainer* aCursorIma
|
|||
}
|
||||
|
||||
nsresult nsCocoaWindow::SetTitle(const nsAString& aTitle) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!mWindow) {
|
||||
return NS_OK;
|
||||
|
@ -1954,7 +1954,7 @@ nsresult nsCocoaWindow::SetTitle(const nsAString& aTitle) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsCocoaWindow::Invalidate(const LayoutDeviceIntRect& aRect) {
|
||||
|
@ -2319,12 +2319,12 @@ void nsCocoaWindow::CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCa
|
|||
}
|
||||
|
||||
nsresult nsCocoaWindow::GetAttention(int32_t aCycleCount) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[NSApp requestUserAttention:NSInformationalRequest];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
bool nsCocoaWindow::HasPendingInputEvent() { return nsChildView::DoHasPendingInputEvent(); }
|
||||
|
@ -2495,13 +2495,13 @@ void nsCocoaWindow::SetDrawsTitle(bool aDrawTitle) {
|
|||
}
|
||||
|
||||
nsresult nsCocoaWindow::SetNonClientMargins(LayoutDeviceIntMargin& margins) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
SetDrawsInTitlebar(margins.top == 0);
|
||||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsCocoaWindow::SetDrawsInTitlebar(bool aState) {
|
||||
|
@ -2516,7 +2516,7 @@ NS_IMETHODIMP nsCocoaWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPo
|
|||
uint32_t aNativeMessage,
|
||||
uint32_t aModifierFlags,
|
||||
nsIObserver* aObserver) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
AutoObserverNotifier notifier(aObserver, "mouseevent");
|
||||
if (mPopupContentView)
|
||||
|
@ -2525,13 +2525,13 @@ NS_IMETHODIMP nsCocoaWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPo
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::SynthesizeNativeMouseScrollEvent(
|
||||
LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, double aDeltaX, double aDeltaY,
|
||||
double aDeltaZ, uint32_t aModifierFlags, uint32_t aAdditionalFlags, nsIObserver* aObserver) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
AutoObserverNotifier notifier(aObserver, "mousescrollevent");
|
||||
if (mPopupContentView) {
|
||||
|
@ -2544,7 +2544,7 @@ NS_IMETHODIMP nsCocoaWindow::SynthesizeNativeMouseScrollEvent(
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsCocoaWindow::LockAspectRatio(bool aShouldLock) {
|
||||
|
|
|
@ -198,7 +198,7 @@ static const nsCursor sCustomCursor = eCursorCount;
|
|||
}
|
||||
|
||||
- (nsresult)setCursor:(enum nsCursor)aCursor {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsCursor oldType = [mCurrentMacCursor type];
|
||||
[self setMacCursor:[self getCursor:aCursor]];
|
||||
|
@ -209,11 +209,11 @@ static const nsCursor sCustomCursor = eCursorCount;
|
|||
}
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
- (nsresult)setMacCursor:(nsMacCursor*)aMacCursor {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Some plugins mess with our cursors and set a cursor that even
|
||||
// [NSCursor currentCursor] doesn't know about. In case that happens, just
|
||||
|
@ -240,14 +240,14 @@ static const nsCursor sCustomCursor = eCursorCount;
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
- (nsresult)setCursorWithImage:(imgIContainer*)aCursorImage
|
||||
hotSpotX:(uint32_t)aHotspotX
|
||||
hotSpotY:(uint32_t)aHotspotY
|
||||
scaleFactor:(CGFloat)scaleFactor {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
// As the user moves the mouse, this gets called repeatedly with the same aCursorImage
|
||||
if (sCursorImgContainer == aCursorImage && sCursorScaleFactor == scaleFactor &&
|
||||
mCurrentMacCursor) {
|
||||
|
@ -287,7 +287,7 @@ static const nsCursor sCustomCursor = eCursorCount;
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
- (nsMacCursor*)getCursor:(enum nsCursor)aCursor {
|
||||
|
|
|
@ -78,7 +78,7 @@ NS_IMPL_ISUPPORTS(nsDeviceContextSpecX, nsIDeviceContextSpec)
|
|||
|
||||
NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIWidget* aWidget, nsIPrintSettings* aPS,
|
||||
bool aIsPrintPreview) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
RefPtr<nsPrintSettingsX> settings(do_QueryObject(aPS));
|
||||
if (!settings) {
|
||||
|
@ -160,21 +160,21 @@ NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIWidget* aWidget, nsIPrintSettings* a
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecX::BeginDocument(const nsAString& aTitle,
|
||||
const nsAString& aPrintToFileName,
|
||||
int32_t aStartPage, int32_t aEndPage) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextSpecX::EndDocument() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
#ifdef MOZ_ENABLE_SKIA_PDF
|
||||
if (mPrintViaSkPDF) {
|
||||
|
@ -260,7 +260,7 @@ NS_IMETHODIMP nsDeviceContextSpecX::EndDocument() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsDeviceContextSpecX::GetPaperRect(double* aTop, double* aLeft, double* aBottom,
|
||||
|
|
|
@ -246,7 +246,7 @@ NSString* nsDragService::GetFilePath(NSPasteboardItem* item) {
|
|||
nsresult nsDragService::InvokeDragSessionImpl(nsIArray* aTransferableArray,
|
||||
const Maybe<CSSIntRegion>& aRegion,
|
||||
uint32_t aActionType) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!gLastDragView) {
|
||||
// gLastDragView is non-null between -[ChildView mouseDown:] and -[ChildView mouseUp:].
|
||||
|
@ -320,12 +320,12 @@ nsresult nsDragService::InvokeDragSessionImpl(nsIArray* aTransferableArray,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!aTransferable) return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -487,12 +487,12 @@ nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) {
|
|||
}
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::IsDataFlavorSupported(const char* aDataFlavor, bool* _retval) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
*_retval = false;
|
||||
|
||||
|
@ -548,12 +548,12 @@ nsDragService::IsDataFlavorSupported(const char* aDataFlavor, bool* _retval) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::GetNumDropItems(uint32_t* aNumItems) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
*aNumItems = 0;
|
||||
|
||||
|
@ -570,7 +570,7 @@ nsDragService::GetNumDropItems(uint32_t* aNumItems) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -634,7 +634,7 @@ void nsDragService::DragMovedWithView(NSDraggingSession* aSession, NSPoint aPoin
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::EndDragSession(bool aDoneDrag, uint32_t aKeyModifiers) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (mNativeDragView) {
|
||||
[mNativeDragView release];
|
||||
|
@ -651,5 +651,5 @@ nsDragService::EndDragSession(bool aDoneDrag, uint32_t aKeyModifiers) {
|
|||
mDataItems = nullptr;
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -429,7 +429,7 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
|
|||
}
|
||||
|
||||
nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsresult res = NS_OK;
|
||||
|
||||
|
@ -611,7 +611,7 @@ nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
|||
}
|
||||
return res;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
|
|
|
@ -97,17 +97,17 @@ nsMacDockSupport::SetDockMenu(nsIStandaloneNativeMenu* aDockMenu) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsMacDockSupport::ActivateApplication(bool aIgnoreOtherApplications) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:aIgnoreOtherApplications];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMacDockSupport::SetBadgeText(const nsAString& aBadgeText) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSDockTile* tile = [[NSApplication sharedApplication] dockTile];
|
||||
mBadgeText = aBadgeText;
|
||||
|
@ -119,7 +119,7 @@ nsMacDockSupport::SetBadgeText(const nsAString& aBadgeText) {
|
|||
length:mBadgeText.Length()]];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -151,7 +151,7 @@ nsMacDockSupport::SetProgressState(nsTaskbarProgressState aState, uint64_t aCurr
|
|||
}
|
||||
|
||||
nsresult nsMacDockSupport::UpdateDockTile() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (mProgressState == STATE_NORMAL || mProgressState == STATE_INDETERMINATE) {
|
||||
if (!mDockTileWrapperView) {
|
||||
|
@ -194,5 +194,5 @@ nsresult nsMacDockSupport::UpdateDockTile() {
|
|||
}
|
||||
|
||||
return NS_OK;
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ nsMacFinderProgress::~nsMacFinderProgress() {
|
|||
NS_IMETHODIMP
|
||||
nsMacFinderProgress::Init(const nsAString& path,
|
||||
nsIMacFinderProgressCanceledCallback* cancellationCallback) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSURL* pathUrl = [NSURL
|
||||
fileURLWithPath:[NSString
|
||||
|
@ -57,12 +57,12 @@ nsMacFinderProgress::Init(const nsAString& path,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMacFinderProgress::UpdateProgress(uint64_t currentProgress, uint64_t totalProgress) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
if (mProgress) {
|
||||
mProgress.totalUnitCount = totalProgress;
|
||||
mProgress.completedUnitCount = currentProgress;
|
||||
|
@ -70,12 +70,12 @@ nsMacFinderProgress::UpdateProgress(uint64_t currentProgress, uint64_t totalProg
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMacFinderProgress::End() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (mProgress) {
|
||||
[mProgress unpublish];
|
||||
|
@ -83,5 +83,5 @@ nsMacFinderProgress::End() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ static void SetStrAttribute(JSContext* aCx, JS::Rooted<JSObject*>& aObj, const c
|
|||
|
||||
nsresult nsMacSharingService::GetSharingProviders(const nsAString& aPageUrl, JSContext* aCx,
|
||||
JS::MutableHandleValue aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
JS::Rooted<JSObject*> array(aCx, JS::NewArrayObject(aCx, 0));
|
||||
NSURL* url = [NSURL URLWithString:nsCocoaUtils::ToNSString(aPageUrl)];
|
||||
|
@ -125,12 +125,12 @@ nsresult nsMacSharingService::GetSharingProviders(const nsAString& aPageUrl, JSC
|
|||
aResult.setObject(*array);
|
||||
|
||||
return NS_OK;
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMacSharingService::OpenSharingPreferences() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSURL* prefPaneURL = [NSURL fileURLWithPath:extensionPrefPanePath isDirectory:YES];
|
||||
NSDictionary* args = @{
|
||||
|
@ -154,13 +154,13 @@ nsMacSharingService::OpenSharingPreferences() {
|
|||
[descriptor release];
|
||||
|
||||
return NS_OK;
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMacSharingService::ShareUrl(const nsAString& aServiceName, const nsAString& aPageUrl,
|
||||
const nsAString& aPageTitle) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSString* serviceName = nsCocoaUtils::ToNSString(aServiceName);
|
||||
NSURL* pageUrl = [NSURL URLWithString:nsCocoaUtils::ToNSString(aPageUrl)];
|
||||
|
@ -198,5 +198,5 @@ nsMacSharingService::ShareUrl(const nsAString& aServiceName, const nsAString& aP
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ NS_IMPL_ISUPPORTS(nsMacWebAppUtils, nsIMacWebAppUtils)
|
|||
|
||||
NS_IMETHODIMP nsMacWebAppUtils::PathForAppWithIdentifier(const nsAString& bundleIdentifier,
|
||||
nsAString& outPath) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
outPath.Truncate();
|
||||
|
||||
|
@ -40,11 +40,11 @@ NS_IMETHODIMP nsMacWebAppUtils::PathForAppWithIdentifier(const nsAString& bundle
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMacWebAppUtils::LaunchAppWithIdentifier(const nsAString& bundleIdentifier) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
|
@ -61,11 +61,11 @@ NS_IMETHODIMP nsMacWebAppUtils::LaunchAppWithIdentifier(const nsAString& bundleI
|
|||
|
||||
return success ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMacWebAppUtils::TrashApp(const nsAString& path, nsITrashAppCallback* aCallback) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!aCallback)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -86,5 +86,5 @@ NS_IMETHODIMP nsMacWebAppUtils::TrashApp(const nsAString& path, nsITrashAppCallb
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ bool nsMenuBarX::MenuContainsAppMenu() {
|
|||
}
|
||||
|
||||
nsresult nsMenuBarX::InsertMenuAtIndex(nsMenuX* aMenu, uint32_t aIndex) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// If we've only yet created a fallback global Application menu (using
|
||||
// ContructFallbackNativeMenus()), destroy it before recreating it properly.
|
||||
|
@ -262,7 +262,7 @@ nsresult nsMenuBarX::InsertMenuAtIndex(nsMenuX* aMenu, uint32_t aIndex) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsMenuBarX::RemoveMenuAtIndex(uint32_t aIndex) {
|
||||
|
@ -418,7 +418,7 @@ void nsMenuBarX::SetSystemHelpMenu() {
|
|||
}
|
||||
|
||||
nsresult nsMenuBarX::Paint() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Don't try to optimize anything in this painting by checking
|
||||
// sLastGeckoMenuBarPainted because the menubar can be manipulated by
|
||||
|
@ -444,7 +444,7 @@ nsresult nsMenuBarX::Paint() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -604,7 +604,7 @@ NSMenuItem* nsMenuBarX::CreateNativeAppMenuItem(nsMenuX* inMenu, const nsAString
|
|||
|
||||
// build the Application menu shared by all menu bars
|
||||
nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// At this point, the application menu is the application menu from
|
||||
// the nib in cocoa widgets. We do not have a way to create an application
|
||||
|
@ -792,7 +792,7 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu) {
|
|||
|
||||
return (sApplicationMenu) ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsMenuBarX::SetParent(nsIWidget* aParent) { mParentWindow = aParent; }
|
||||
|
|
|
@ -68,7 +68,7 @@ void nsMenuItemIconX::Destroy() {
|
|||
}
|
||||
|
||||
nsresult nsMenuItemIconX::SetupIcon() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Still don't have one, then something is wrong, get out of here.
|
||||
if (!mNativeMenuItem) {
|
||||
|
@ -107,7 +107,7 @@ nsresult nsMenuItemIconX::SetupIcon() {
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsMenuItemIconX::GetIconURI(nsIURI** aIconURI) {
|
||||
|
@ -200,7 +200,7 @@ nsresult nsMenuItemIconX::GetIconURI(nsIURI** aIconURI) {
|
|||
//
|
||||
|
||||
nsresult nsMenuItemIconX::OnComplete(imgIContainer* aImage) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
if (!mNativeMenuItem) {
|
||||
mIconLoader->Destroy();
|
||||
|
@ -219,5 +219,5 @@ nsresult nsMenuItemIconX::OnComplete(imgIContainer* aImage) {
|
|||
mIconLoader->Destroy();
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ nsMenuItemX::~nsMenuItemX() {
|
|||
|
||||
nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItemType aItemType,
|
||||
nsMenuGroupOwnerX* aMenuGroupOwner, nsIContent* aNode) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
mType = aItemType;
|
||||
mMenuParent = aParent;
|
||||
|
@ -130,11 +130,11 @@ nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItem
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsMenuItemX::SetChecked(bool aIsChecked) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
mIsChecked = aIsChecked;
|
||||
|
||||
|
@ -152,7 +152,7 @@ nsresult nsMenuItemX::SetChecked(bool aIsChecked) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
EMenuItemType nsMenuItemX::GetMenuItemType() { return mType; }
|
||||
|
|
|
@ -151,7 +151,7 @@ nsMenuX::~nsMenuX() {
|
|||
|
||||
nsresult nsMenuX::Create(nsMenuObjectX* aParent, nsMenuGroupOwnerX* aMenuGroupOwner,
|
||||
nsIContent* aContent) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
mContent = aContent;
|
||||
if (mContent->IsElement()) {
|
||||
|
@ -202,11 +202,11 @@ nsresult nsMenuX::Create(nsMenuObjectX* aParent, nsMenuGroupOwnerX* aMenuGroupOw
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult nsMenuX::AddMenuItem(nsMenuItemX* aMenuItem) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!aMenuItem) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -235,7 +235,7 @@ nsresult nsMenuX::AddMenuItem(nsMenuItemX* aMenuItem) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsMenuX* nsMenuX::AddMenu(UniquePtr<nsMenuX> aMenu) {
|
||||
|
@ -313,7 +313,7 @@ nsMenuObjectX* nsMenuX::GetVisibleItemAt(uint32_t aPos) {
|
|||
}
|
||||
|
||||
nsresult nsMenuX::RemoveAll() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (mNativeMenu) {
|
||||
// clear command id's
|
||||
|
@ -332,7 +332,7 @@ nsresult nsMenuX::RemoveAll() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsEventStatus nsMenuX::MenuOpened() {
|
||||
|
|
|
@ -2785,7 +2785,7 @@ NS_IMETHODIMP
|
|||
nsNativeThemeCocoa::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance, const nsRect& aRect,
|
||||
const nsRect& aDirtyRect) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
Maybe<WidgetInfo> widgetInfo = ComputeWidgetInfo(aFrame, aAppearance, aRect);
|
||||
|
||||
|
@ -2805,7 +2805,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsNativeThemeCocoa::RenderWidget(const WidgetInfo& aWidgetInfo, DrawTarget& aDrawTarget,
|
||||
|
@ -3401,7 +3401,7 @@ NS_IMETHODIMP
|
|||
nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance, LayoutDeviceIntSize* aResult,
|
||||
bool* aIsOverridable) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
aResult->SizeTo(0, 0);
|
||||
*aIsOverridable = true;
|
||||
|
@ -3583,7 +3583,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame*
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -34,7 +34,7 @@ nsPrintDialogServiceX::Init() { return NS_OK; }
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsPrintDialogServiceX::Show(nsPIDOMWindowOuter* aParent, nsIPrintSettings* aSettings) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
MOZ_ASSERT(aSettings, "aSettings must not be null");
|
||||
|
||||
|
@ -126,12 +126,12 @@ nsPrintDialogServiceX::Show(nsPIDOMWindowOuter* aParent, nsIPrintSettings* aSett
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintDialogServiceX::ShowPageSetup(nsPIDOMWindowOuter* aParent, nsIPrintSettings* aNSSettings) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
MOZ_ASSERT(aParent, "aParent must not be null");
|
||||
MOZ_ASSERT(aNSSettings, "aSettings must not be null");
|
||||
|
@ -170,7 +170,7 @@ nsPrintDialogServiceX::ShowPageSetup(nsPIDOMWindowOuter* aParent, nsIPrintSettin
|
|||
}
|
||||
return NS_ERROR_ABORT;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// Accessory view
|
||||
|
|
|
@ -22,18 +22,18 @@ nsSound::~nsSound() {}
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsSound::Beep() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSBeep();
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSound::OnStreamComplete(nsIStreamLoader* aLoader, nsISupports* context, nsresult aStatus,
|
||||
uint32_t dataLen, const uint8_t* data) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSData* value = [NSData dataWithBytes:data length:dataLen];
|
||||
|
||||
|
@ -45,7 +45,7 @@ nsSound::OnStreamComplete(nsIStreamLoader* aLoader, nsISupports* context, nsresu
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -91,7 +91,7 @@ nsStandaloneNativeMenu::GetNativeMenu(void** aVoidPointer) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsStandaloneNativeMenu::ActivateNativeMenuItemAt(const nsAString& indexString) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (!mMenu) {
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
@ -117,7 +117,7 @@ nsStandaloneNativeMenu::ActivateNativeMenuItemAt(const nsAString& indexString) {
|
|||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -17,7 +17,7 @@ NS_IMPL_ISUPPORTS(nsSystemStatusBarCocoa, nsISystemStatusBar)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsSystemStatusBarCocoa::AddItem(Element* aElement) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
RefPtr<nsStandaloneNativeMenu> menu = new nsStandaloneNativeMenu();
|
||||
nsresult rv = menu->Init(aElement);
|
||||
|
@ -30,18 +30,18 @@ nsSystemStatusBarCocoa::AddItem(Element* aElement) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSystemStatusBarCocoa::RemoveItem(Element* aElement) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
mItems.Remove(aElement);
|
||||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsSystemStatusBarCocoa::StatusItem::StatusItem(nsStandaloneNativeMenu* aMenu) : mMenu(aMenu) {
|
||||
|
|
|
@ -90,7 +90,7 @@ static void ToolkitSleepWakeCallback(void* refCon, io_service_t service, natural
|
|||
}
|
||||
|
||||
nsresult nsToolkit::RegisterForSleepWakeNotifications() {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
IONotificationPortRef notifyPortRef;
|
||||
|
||||
|
@ -108,7 +108,7 @@ nsresult nsToolkit::RegisterForSleepWakeNotifications() {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsToolkit::RemoveSleepWakeNotifications() {
|
||||
|
@ -227,7 +227,7 @@ nsToolkit* nsToolkit::GetToolkit() {
|
|||
// of its subclasses.
|
||||
nsresult nsToolkit::SwizzleMethods(Class aClass, SEL orgMethod, SEL posedMethod,
|
||||
bool classMethods) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
Method original = nil;
|
||||
Method posed = nil;
|
||||
|
@ -246,5 +246,5 @@ nsresult nsToolkit::SwizzleMethods(Class aClass, SEL orgMethod, SEL posedMethod,
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void nsTouchBarInputIcon::Destroy() {
|
|||
}
|
||||
|
||||
nsresult nsTouchBarInputIcon::SetupIcon(nsCOMPtr<nsIURI> aIconURI) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// We might not have a document if the Touch Bar tries to update when the main
|
||||
// window is closed.
|
||||
|
@ -103,7 +103,7 @@ nsresult nsTouchBarInputIcon::SetupIcon(nsCOMPtr<nsIURI> aIconURI) {
|
|||
|
||||
return rv;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void nsTouchBarInputIcon::ReleaseJSObjects() { mDocument = nil; }
|
||||
|
@ -113,7 +113,7 @@ void nsTouchBarInputIcon::ReleaseJSObjects() { mDocument = nil; }
|
|||
//
|
||||
|
||||
nsresult nsTouchBarInputIcon::OnComplete(imgIContainer* aImage) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN
|
||||
|
||||
// We ask only for the HiDPI images since all Touch Bars are Retina
|
||||
// displays and we have no need for icons @1x.
|
||||
|
@ -128,5 +128,5 @@ nsresult nsTouchBarInputIcon::OnComplete(imgIContainer* aImage) {
|
|||
mIconLoader->Destroy();
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE)
|
||||
}
|
||||
|
|
|
@ -24,13 +24,13 @@ HeadlessKeyBindings& HeadlessKeyBindings::GetInstance() {
|
|||
}
|
||||
|
||||
nsresult HeadlessKeyBindings::AttachNativeKeyEvent(WidgetKeyboardEvent& aEvent) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
aEvent.mNativeKeyEvent = nsCocoaUtils::MakeNewCococaEventFromWidgetEvent(aEvent, 0, nil);
|
||||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
void HeadlessKeyBindings::GetEditCommands(nsIWidget::NativeKeyBindingsType aType,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
namespace mozilla {
|
||||
|
||||
nsresult GetSelectedCityInfo(nsAString& aCountryCode) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
// Can be replaced with [[NSLocale currentLocale] countryCode] once we build
|
||||
// with the 10.12 SDK.
|
||||
|
@ -26,7 +26,7 @@ nsresult GetSelectedCityInfo(nsAString& aCountryCode) {
|
|||
|
||||
return mozilla::CopyCocoaStringToXPCOMString((NSString*)countryCode, aCountryCode);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
} // namespace Mozilla
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace mozilla {
|
||||
|
||||
nsresult CopyCocoaStringToXPCOMString(NSString* aFrom, nsAString& aTo) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSUInteger len = [aFrom length];
|
||||
if (len > std::numeric_limits<nsAString::size_type>::max()) {
|
||||
|
@ -28,7 +28,7 @@ nsresult CopyCocoaStringToXPCOMString(NSString* aFrom, nsAString& aTo) {
|
|||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
} // namespace Mozilla
|
||||
|
|
|
@ -49,14 +49,6 @@ void nsObjCExceptionLog(NSException* aException);
|
|||
} \
|
||||
return nullptr;
|
||||
|
||||
#define NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT @try {
|
||||
#define NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT \
|
||||
} \
|
||||
@catch (NSException * _exn) { \
|
||||
nsObjCExceptionLog(_exn); \
|
||||
} \
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
#define NS_OBJC_BEGIN_TRY_BLOCK_RETURN @try {
|
||||
#define NS_OBJC_END_TRY_BLOCK_RETURN(_rv) \
|
||||
} \
|
||||
|
|
|
@ -21,7 +21,7 @@ const CFStringRef kCFURLQuarantinePropertiesKey = CFSTR("NSURLQuarantineProperti
|
|||
namespace CocoaFileUtils {
|
||||
|
||||
nsresult RevealFileInFinder(CFURLRef url) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!url)) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -32,11 +32,11 @@ nsresult RevealFileInFinder(CFURLRef url) {
|
|||
|
||||
return (success ? NS_OK : NS_ERROR_FAILURE);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult OpenURL(CFURLRef url) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!url)) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -46,11 +46,11 @@ nsresult OpenURL(CFURLRef url) {
|
|||
|
||||
return (success ? NS_OK : NS_ERROR_FAILURE);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult GetFileCreatorCode(CFURLRef url, OSType* creatorCode) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!url) || NS_WARN_IF(!creatorCode)) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -75,11 +75,11 @@ nsresult GetFileCreatorCode(CFURLRef url, OSType* creatorCode) {
|
|||
*creatorCode = [creatorNum unsignedLongValue];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult SetFileCreatorCode(CFURLRef url, OSType creatorCode) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!url)) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -93,11 +93,11 @@ nsresult SetFileCreatorCode(CFURLRef url, OSType creatorCode) {
|
|||
[ap release];
|
||||
return (success ? NS_OK : NS_ERROR_FAILURE);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult GetFileTypeCode(CFURLRef url, OSType* typeCode) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!url) || NS_WARN_IF(!typeCode)) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -122,11 +122,11 @@ nsresult GetFileTypeCode(CFURLRef url, OSType* typeCode) {
|
|||
*typeCode = [typeNum unsignedLongValue];
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsresult SetFileTypeCode(CFURLRef url, OSType typeCode) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
if (NS_WARN_IF(!url)) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -139,7 +139,7 @@ nsresult SetFileTypeCode(CFURLRef url, OSType typeCode) {
|
|||
[ap release];
|
||||
return (success ? NS_OK : NS_ERROR_FAILURE);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
// Can be called off of the main thread.
|
||||
|
|
Загрузка…
Ссылка в новой задаче