diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-01-10 18:42:10 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-01-10 18:42:10 +0800 |
commit | 0661a81aa4285c40cf33c408026df6d44d09700f (patch) | |
tree | 4542ba96d0f029a6d9d53f51907d0c900d0f36b2 /embed | |
parent | 39fc1047662acd0b69425546ecd427ce81a04733 (diff) | |
download | gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.tar gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.tar.gz gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.tar.bz2 gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.tar.lz gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.tar.xz gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.tar.zst gsoc2013-epiphany-0661a81aa4285c40cf33c408026df6d44d09700f.zip |
Use NS_ENSURE_SUCCESS/NS_ENSURE_TRUE at appropriate places instead of
2004-01-10 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyAboutRedirector.cpp:
* embed/mozilla/EphyAboutRedirector.h:
Use NS_ENSURE_SUCCESS/NS_ENSURE_TRUE at appropriate places instead of
silent "if (...) return ...;".
Really kill "about:options".
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/EphyAboutRedirector.cpp | 22 | ||||
-rw-r--r-- | embed/mozilla/EphyAboutRedirector.h | 1 |
2 files changed, 14 insertions, 9 deletions
diff --git a/embed/mozilla/EphyAboutRedirector.cpp b/embed/mozilla/EphyAboutRedirector.cpp index 7a240d92b..6d1e9d479 100644 --- a/embed/mozilla/EphyAboutRedirector.cpp +++ b/embed/mozilla/EphyAboutRedirector.cpp @@ -36,6 +36,10 @@ * * ***** END LICENSE BLOCK ***** */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "EphyAboutRedirector.h" #include "nsNetCID.h" #include "nsIIOService.h" @@ -68,23 +72,26 @@ EphyAboutRedirector::NewChannel(nsIURI *aURI, nsIChannel **result) NS_ENSURE_ARG(aURI); nsCAutoString path; (void)aURI->GetPath(path); - nsresult rv; - nsCOMPtr<nsIIOService> ioService(do_GetService(kIOServiceCID, &rv)); - if (NS_FAILED(rv)) - return rv; + + nsCOMPtr<nsIIOService> ioService(do_GetService(kIOServiceCID)); + NS_ENSURE_TRUE (ioService, NS_ERROR_FAILURE); for (int i = 0; i< kRedirTotal; i++) { if (!PL_strcasecmp(path.get(), kRedirMap[i].id)) { nsCOMPtr<nsIChannel> tempChannel; - rv = ioService->NewChannel(nsDependentCString(kRedirMap[i].url), - nsnull, nsnull, getter_AddRefs(tempChannel)); + ioService->NewChannel(nsDependentCString(kRedirMap[i].url), + nsnull, nsnull, getter_AddRefs(tempChannel)); + NS_ENSURE_TRUE (tempChannel, NS_ERROR_FAILURE); + *result = tempChannel.get(); NS_ADDREF(*result); - return rv; + + return NS_OK; } } + NS_ASSERTION(0, "EphyAboutRedirector called for unknown case"); return NS_ERROR_ILLEGAL_VALUE; } @@ -100,4 +107,3 @@ EphyAboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult) NS_RELEASE(about); return rv; } - diff --git a/embed/mozilla/EphyAboutRedirector.h b/embed/mozilla/EphyAboutRedirector.h index 4ac63be78..70421f089 100644 --- a/embed/mozilla/EphyAboutRedirector.h +++ b/embed/mozilla/EphyAboutRedirector.h @@ -64,7 +64,6 @@ protected: {0xbf, 0xd0, 0x52, 0xf6, 0x94, 0x45, 0xaf, 0xb7} \ } -#define EPHY_ABOUT_REDIRECTOR_OPTIONS_CONTRACTID NS_ABOUT_MODULE_CONTRACTID_PREFIX "options" #define EPHY_ABOUT_REDIRECTOR_EPIPHANY_CONTRACTID NS_ABOUT_MODULE_CONTRACTID_PREFIX "epiphany" #define EPHY_ABOUT_REDIRECTOR_CONSPIRACY_CONTRACTID NS_ABOUT_MODULE_CONTRACTID_PREFIX "conspiracy" #define EPHY_ABOUT_REDIRECTOR_MARCO_CONTRACTID NS_ABOUT_MODULE_CONTRACTID_PREFIX "marco" |