зеркало из https://github.com/mozilla/pjs.git
Bug 178643: Remove uses of NS_INIT_ISUPPORTS, since it is no longer needed. r=timeless sr=jag
This commit is contained in:
Родитель
8ac2d62574
Коммит
963a794bbc
|
@ -311,7 +311,6 @@ NS_IMPL_ISUPPORTS2(nsPrintingPromptService, nsIPrintingPromptService, nsIWebProg
|
|||
nsPrintingPromptService::nsPrintingPromptService() :
|
||||
mWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID))
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintingPromptService::~nsPrintingPromptService()
|
||||
|
|
|
@ -132,7 +132,6 @@ NS_IMPL_ISUPPORTS2(nsPrintingPromptService, nsIPrintingPromptService, nsIWebProg
|
|||
nsPrintingPromptService::nsPrintingPromptService() :
|
||||
mWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID))
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintingPromptService::~nsPrintingPromptService()
|
||||
|
|
|
@ -58,7 +58,6 @@ NS_INTERFACE_MAP_END_THREADSAFE
|
|||
|
||||
nsPrintProgress::nsPrintProgress()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
m_closeProgress = PR_FALSE;
|
||||
m_processCanceled = PR_FALSE;
|
||||
m_pendingStateFlags = -1;
|
||||
|
|
|
@ -44,7 +44,6 @@ NS_IMPL_ISUPPORTS1(nsPrintProgressParams, nsIPrintProgressParams)
|
|||
|
||||
nsPrintProgressParams::nsPrintProgressParams()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintProgressParams::~nsPrintProgressParams()
|
||||
|
|
|
@ -98,7 +98,6 @@ NS_IMPL_ISUPPORTS2(nsPrintingPromptService, nsIPrintingPromptService, nsIWebProg
|
|||
|
||||
nsPrintingPromptService::nsPrintingPromptService()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintingPromptService::~nsPrintingPromptService()
|
||||
|
|
|
@ -58,7 +58,6 @@ NS_INTERFACE_MAP_END_THREADSAFE
|
|||
|
||||
nsPrintProgress::nsPrintProgress()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
m_closeProgress = PR_FALSE;
|
||||
m_processCanceled = PR_FALSE;
|
||||
m_pendingStateFlags = -1;
|
||||
|
|
|
@ -44,7 +44,6 @@ NS_IMPL_ISUPPORTS1(nsPrintProgressParams, nsIPrintProgressParams)
|
|||
|
||||
nsPrintProgressParams::nsPrintProgressParams()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintProgressParams::~nsPrintProgressParams()
|
||||
|
|
|
@ -93,7 +93,6 @@ NS_IMPL_ISUPPORTS2(nsPrintingPromptService, nsIPrintingPromptService, nsIWebProg
|
|||
|
||||
nsPrintingPromptService::nsPrintingPromptService()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintingPromptService::~nsPrintingPromptService()
|
||||
|
|
|
@ -92,7 +92,6 @@ NS_INTERFACE_MAP_END_THREADSAFE
|
|||
|
||||
nsPrintProgress::nsPrintProgress()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
m_closeProgress = PR_FALSE;
|
||||
m_processCanceled = PR_FALSE;
|
||||
m_pendingStateFlags = -1;
|
||||
|
|
|
@ -44,7 +44,6 @@ NS_IMPL_ISUPPORTS1(nsPrintProgressParams, nsIPrintProgressParams)
|
|||
|
||||
nsPrintProgressParams::nsPrintProgressParams()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintProgressParams::~nsPrintProgressParams()
|
||||
|
|
|
@ -95,7 +95,6 @@ NS_IMPL_ISUPPORTS2(nsPrintingPromptService, nsIPrintingPromptService, nsIWebProg
|
|||
|
||||
nsPrintingPromptService::nsPrintingPromptService()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
|
|
@ -206,7 +206,6 @@ nsWebBrowserPersist::nsWebBrowserPersist() :
|
|||
mWrapColumn(72),
|
||||
mEncodingFlags(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWebBrowserPersist::~nsWebBrowserPersist()
|
||||
|
@ -3386,7 +3385,6 @@ nsWebBrowserPersist::SetDocumentBase(
|
|||
|
||||
nsEncoderNodeFixup::nsEncoderNodeFixup() : mWebBrowserPersist(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,8 +44,6 @@ NS_IMPL_ISUPPORTS1(nsDialogParamBlock, nsIDialogParamBlock)
|
|||
|
||||
nsDialogParamBlock::nsDialogParamBlock() : mNumStrings(0), mString(NULL)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
for(PRInt32 i = 0; i < kNumInts; i++)
|
||||
mInt[i] = 0;
|
||||
}
|
||||
|
|
|
@ -1,112 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsPrintingPrompt.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
#include "nsIWebProgressListener.h"
|
||||
|
||||
nsresult
|
||||
NS_NewPrintingPrompter(nsIPrintingPrompt **result, nsIDOMWindow *aParent)
|
||||
{
|
||||
nsresult rv;
|
||||
*result = 0;
|
||||
|
||||
nsPrintingPrompt *prompter = new nsPrintingPrompt(aParent);
|
||||
if (!prompter)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(prompter);
|
||||
rv = prompter->Init();
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(prompter);
|
||||
return rv;
|
||||
}
|
||||
|
||||
*result = prompter;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsPrintingPrompt, nsIPrintingPrompt)
|
||||
|
||||
nsPrintingPrompt::nsPrintingPrompt(nsIDOMWindow *aParent)
|
||||
: mParent(aParent)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsPrintingPrompt::Init()
|
||||
{
|
||||
mPromptService = do_GetService("@mozilla.org/embedcomp/printingprompt-service;1");
|
||||
return mPromptService ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsPrintingPrompt::nsIPrintingPrompt
|
||||
//*****************************************************************************
|
||||
|
||||
/* void showPrintDialog (in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPrompt::ShowPrintDialog(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings)
|
||||
{
|
||||
return mPromptService->ShowPrintDialog(mParent, webBrowserPrint, printSettings);
|
||||
}
|
||||
|
||||
/* void showProgress (in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings, out nsIWebProgressListener webProgressListener, out nsIPrintProgressParams printProgressParams); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPrompt::ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams** printProgressParams, PRBool* notifyOnOpen)
|
||||
{
|
||||
return mPromptService->ShowProgress(mParent, webBrowserPrint, printSettings, openDialogObserver, isForPrinting, webProgressListener, printProgressParams, notifyOnOpen);
|
||||
}
|
||||
|
||||
/* void showPageSetup (in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPrompt::ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
return mPromptService->ShowPageSetup(mParent, printSettings, aObs);
|
||||
}
|
||||
|
||||
/* void showPrinterProperties (in wstring printerName, in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPrompt::ShowPrinterProperties(const PRUnichar *printerName, nsIPrintSettings *printSettings)
|
||||
{
|
||||
return mPromptService->ShowPrinterProperties(mParent, printerName, printSettings);
|
||||
}
|
||||
|
|
@ -103,7 +103,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS2(nsPrompt, nsIPrompt, nsIAuthPrompt)
|
|||
nsPrompt::nsPrompt(nsIDOMWindow *aParent)
|
||||
: mParent(aParent)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -93,7 +93,6 @@ private:
|
|||
NS_IMPL_ISUPPORTS2(nsPromptService, nsIPromptService, nsPIPromptService)
|
||||
|
||||
nsPromptService::nsPromptService() {
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPromptService::~nsPromptService() {
|
||||
|
|
|
@ -198,7 +198,6 @@ nsWatcherWindowEnumerator::nsWatcherWindowEnumerator(nsWindowWatcher *inWatcher)
|
|||
: mWindowWatcher(inWatcher),
|
||||
mCurrentPosition(inWatcher->mOldestWindow)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mWindowWatcher->AddEnumerator(this);
|
||||
mWindowWatcher->AddRef();
|
||||
}
|
||||
|
@ -418,7 +417,6 @@ nsWindowWatcher::nsWindowWatcher() :
|
|||
mActiveWindow(0),
|
||||
mListLock(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWindowWatcher::~nsWindowWatcher()
|
||||
|
|
|
@ -158,7 +158,6 @@ NS_IMPL_ISUPPORTS1(nsEmbedChromeRegistry, nsIChromeRegistry)
|
|||
|
||||
nsEmbedChromeRegistry::nsEmbedChromeRegistry()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -1045,7 +1045,6 @@ PRUint32 AppCallbacks::RunEventLoop(PRBool &aRunCondition)
|
|||
|
||||
nsQABrowserUIGlue::nsQABrowserUIGlue():mAllowNewWindows(PR_TRUE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsQABrowserUIGlue::~nsQABrowserUIGlue()
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
|
||||
nsQABrowserChrome::nsQABrowserChrome()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mNativeWindow = nsnull;
|
||||
mSizeSet = PR_FALSE;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
|
||||
nsQABrowserView::nsQABrowserView():mWebBrowser(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mWebBrowser = nsnull;
|
||||
mWebNav = nsnull;
|
||||
mBaseWindow = nsnull;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
WindowCreator::WindowCreator()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
WindowCreator::~WindowCreator()
|
||||
|
|
|
@ -94,8 +94,6 @@
|
|||
|
||||
CBrowserImpl::CBrowserImpl()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
m_pBrowserFrameGlue = NULL;
|
||||
mWebBrowser = nsnull;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ NS_INTERFACE_MAP_END
|
|||
CDlgPrintListener::CDlgPrintListener(CPrintProgressDialog* aDlg) :
|
||||
m_PrintDlg(aDlg)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
//NS_ADDREF_THIS();
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,6 @@ NS_IMPL_ISUPPORTS1(CPromptService, nsIPromptService)
|
|||
CPromptService::CPromptService() :
|
||||
mWWatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID))
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CPromptService::~CPromptService() {
|
||||
|
@ -415,8 +414,6 @@ public:
|
|||
NS_IMPL_ISUPPORTS1(CPromptServiceFactory, nsIFactory)
|
||||
|
||||
CPromptServiceFactory::CPromptServiceFactory() {
|
||||
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CPromptServiceFactory::~CPromptServiceFactory() {
|
||||
|
|
|
@ -55,8 +55,6 @@
|
|||
|
||||
winEmbedFileLocProvider::winEmbedFileLocProvider(const char* productDirName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
strncpy(mProductDirName, productDirName, sizeof(mProductDirName) - 1);
|
||||
mProductDirName[sizeof(mProductDirName) - 1] = '\0';
|
||||
}
|
||||
|
|
|
@ -77,8 +77,6 @@
|
|||
|
||||
CBrowserImpl::CBrowserImpl()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
m_pBrowserFrameGlue = NULL;
|
||||
mWebBrowser = nsnull;
|
||||
}
|
||||
|
@ -382,4 +380,4 @@ NS_IMETHODIMP CBrowserImpl::SetVisibility(PRBool aVisibility)
|
|||
NS_IMETHODIMP CBrowserImpl::Blur()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,7 +125,6 @@ NS_IMPL_ISUPPORTS1(CHelperAppLauncherDialogFactory, nsIFactory)
|
|||
|
||||
CHelperAppLauncherDialogFactory::CHelperAppLauncherDialogFactory()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CHelperAppLauncherDialogFactory::~CHelperAppLauncherDialogFactory() {
|
||||
|
@ -163,7 +162,6 @@ NS_IMPL_ISUPPORTS1(CHelperAppLauncherDialog, nsIHelperAppLauncherDialog)
|
|||
CHelperAppLauncherDialog::CHelperAppLauncherDialog() :
|
||||
mWWatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID))
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CHelperAppLauncherDialog::~CHelperAppLauncherDialog()
|
||||
|
@ -510,8 +508,6 @@ CProgressDlg::CProgressDlg(nsIHelperAppLauncher *aLauncher, int aHandleContentOp
|
|||
CString& aFileName, CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CProgressDlg::IDD, pParent)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
m_HelperAppLauncher = aLauncher;
|
||||
m_HandleContentOp = aHandleContentOp;
|
||||
m_FileName = aFileName;
|
||||
|
|
|
@ -46,7 +46,6 @@ NS_INTERFACE_MAP_END
|
|||
CDlgPrintListener::CDlgPrintListener(CPrintProgressDialog* aDlg) :
|
||||
m_PrintDlg(aDlg)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
|
||||
|
|
|
@ -124,7 +124,6 @@ CPrintingPromptService::CPrintingPromptService() :
|
|||
mWWatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID)),
|
||||
m_PPDlg(NULL)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CPrintingPromptService::~CPrintingPromptService() {
|
||||
|
@ -385,8 +384,6 @@ public:
|
|||
NS_IMPL_ISUPPORTS1(CPrintingPromptServiceFactory, nsIFactory)
|
||||
|
||||
CPrintingPromptServiceFactory::CPrintingPromptServiceFactory() {
|
||||
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CPrintingPromptServiceFactory::~CPrintingPromptServiceFactory() {
|
||||
|
|
|
@ -93,7 +93,6 @@ NS_IMPL_ISUPPORTS1(CPromptService, nsIPromptService)
|
|||
CPromptService::CPromptService() :
|
||||
mWWatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID))
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CPromptService::~CPromptService() {
|
||||
|
@ -415,8 +414,6 @@ public:
|
|||
NS_IMPL_ISUPPORTS1(CPromptServiceFactory, nsIFactory)
|
||||
|
||||
CPromptServiceFactory::CPromptServiceFactory() {
|
||||
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CPromptServiceFactory::~CPromptServiceFactory() {
|
||||
|
|
|
@ -44,7 +44,6 @@ NS_IMPL_ISUPPORTS1(nsPrintProgressParams, nsIPrintProgressParams)
|
|||
|
||||
nsPrintProgressParams::nsPrintProgressParams()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPrintProgressParams::~nsPrintProgressParams()
|
||||
|
|
|
@ -62,8 +62,6 @@
|
|||
|
||||
winEmbedFileLocProvider::winEmbedFileLocProvider(const char* productDirName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
strncpy(mProductDirName, productDirName, sizeof(mProductDirName) - 1);
|
||||
mProductDirName[sizeof(mProductDirName) - 1] = '\0';
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
|
||||
WebBrowserChrome::WebBrowserChrome()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mNativeWindow = nsnull;
|
||||
mSizeSet = PR_FALSE;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
WindowCreator::WindowCreator()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
WindowCreator::~WindowCreator()
|
||||
|
|
|
@ -233,7 +233,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS2(ProfileChangeObserver, nsIObserver, nsISupportsWea
|
|||
|
||||
ProfileChangeObserver::ProfileChangeObserver()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -69,7 +69,6 @@ nsAccessProxy* nsAccessProxy::mInstance = nsnull;
|
|||
|
||||
nsAccessProxy::nsAccessProxy()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsAccessProxy::~nsAccessProxy()
|
||||
|
|
|
@ -53,7 +53,6 @@ nsCookie::nsCookie()
|
|||
cookiePath(0),
|
||||
cookieIsSecure(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsCookie::nsCookie
|
||||
|
@ -73,8 +72,6 @@ nsCookie::nsCookie
|
|||
cookiePath(path),
|
||||
cookieIsSecure(isSecure)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
cookieExpires = expires;
|
||||
cookieStatus = status;
|
||||
cookiePolicy = policy;
|
||||
|
|
|
@ -133,7 +133,6 @@ nsCookieHTTPNotify::Init()
|
|||
|
||||
nsCookieHTTPNotify::nsCookieHTTPNotify()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mCookieService = nsnull;
|
||||
#ifdef DEBUG_dp
|
||||
printf("CookieHTTPNotify Created.\n");
|
||||
|
|
|
@ -55,7 +55,6 @@ class nsCookieEnumerator : public nsISimpleEnumerator
|
|||
|
||||
nsCookieEnumerator() : mCookieCount(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
NS_IMETHOD HasMoreElements(PRBool *result)
|
||||
|
@ -108,7 +107,6 @@ NS_IMPL_ISUPPORTS2(nsCookieManager, nsICookieManager, nsISupportsWeakReference);
|
|||
|
||||
nsCookieManager::nsCookieManager()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsCookieManager::~nsCookieManager(void)
|
||||
|
|
|
@ -68,7 +68,6 @@ PRBool gCookieIconVisible = PR_FALSE;
|
|||
|
||||
nsCookieService::nsCookieService()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsCookieService::~nsCookieService(void)
|
||||
|
|
|
@ -64,7 +64,6 @@ NS_IMPL_ISUPPORTS2(nsImgManager,
|
|||
|
||||
nsImgManager::nsImgManager()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsImgManager::~nsImgManager(void)
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
NS_IMPL_ISUPPORTS2(nsPermission, nsIPermission, nsISupportsWeakReference);
|
||||
|
||||
nsPermission::nsPermission() {
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPermission::nsPermission
|
||||
|
@ -55,7 +54,6 @@ nsPermission::nsPermission
|
|||
permissionHost = host;
|
||||
permissionType = type;
|
||||
permissionCapability = capability;
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPermission::~nsPermission(void) {
|
||||
|
|
|
@ -61,7 +61,6 @@ class nsPermissionEnumerator : public nsISimpleEnumerator
|
|||
|
||||
nsPermissionEnumerator() : mHostCount(0), mTypeCount(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
NS_IMETHOD HasMoreElements(PRBool *result)
|
||||
|
@ -110,7 +109,6 @@ NS_IMPL_ISUPPORTS3(nsPermissionManager, nsIPermissionManager, nsIObserver, nsISu
|
|||
|
||||
nsPermissionManager::nsPermissionManager()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPermissionManager::~nsPermissionManager(void)
|
||||
|
|
|
@ -65,7 +65,6 @@ static const char sPrefChangedTopic[] = NS_PREFBRANCH_PREFCHANGE_TOPIC_ID;
|
|||
nsPopupWindowManager::nsPopupWindowManager() :
|
||||
mPolicy(ALLOW_POPUP)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPopupWindowManager::~nsPopupWindowManager(void)
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
|
||||
// nsDateTimeChannel methods
|
||||
nsDateTimeChannel::nsDateTimeChannel() {
|
||||
NS_INIT_ISUPPORTS();
|
||||
mContentLength = -1;
|
||||
mPort = -1;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsDateTimeHandler::nsDateTimeHandler() {
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsDateTimeHandler::~nsDateTimeHandler() {
|
||||
|
|
|
@ -50,7 +50,6 @@ nsFingerChannel::nsFingerChannel()
|
|||
mPort(-1),
|
||||
mStatus(NS_OK)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsFingerChannel::~nsFingerChannel() {
|
||||
|
|
|
@ -37,7 +37,6 @@ static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsFingerHandler::nsFingerHandler() {
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsFingerHandler::~nsFingerHandler() {
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
inBitmap::inBitmap()
|
||||
: mBits(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inBitmap::~inBitmap()
|
||||
|
|
|
@ -1,287 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Brian Ryner.
|
||||
* Portions created by Brian Ryner are Copyright (C) 2000 Brian Ryner.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Joe Hewitt <hewitt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "inBitmapChannel.h"
|
||||
#include "inIBitmapURI.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsMemory.h"
|
||||
#include "nsIStringStream.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIFileChannel.h"
|
||||
#include "nsIMIMEService.h"
|
||||
#include "nsCExternalHandlerService.h"
|
||||
#include "inIBitmap.h"
|
||||
#include "inIBitmapDepot.h"
|
||||
|
||||
inBitmapChannel::inBitmapChannel()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mStatus = NS_OK;
|
||||
}
|
||||
|
||||
inBitmapChannel::~inBitmapChannel()
|
||||
{}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(inBitmapChannel,
|
||||
nsIChannel,
|
||||
nsIRequest)
|
||||
|
||||
nsresult
|
||||
inBitmapChannel::Init(nsIURI* uri)
|
||||
{
|
||||
NS_ASSERTION(uri, "no uri");
|
||||
mUrl = uri;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIRequest
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetName(nsACString &result)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::IsPending(PRBool *result)
|
||||
{
|
||||
NS_NOTREACHED("inBitmapChannel::IsPending");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetStatus(nsresult *status)
|
||||
{
|
||||
*status = mStatus;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::Cancel(nsresult status)
|
||||
{
|
||||
NS_ASSERTION(NS_FAILED(status), "shouldn't cancel with a success code");
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
mStatus = status;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::Suspend(void)
|
||||
{
|
||||
NS_NOTREACHED("inBitmapChannel::Suspend");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::Resume(void)
|
||||
{
|
||||
NS_NOTREACHED("inBitmapChannel::Resume");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIChannel methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetOriginalURI(nsIURI* *aURI)
|
||||
{
|
||||
*aURI = mOriginalURI ? mOriginalURI : mUrl;
|
||||
NS_ADDREF(*aURI);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::SetOriginalURI(nsIURI* aURI)
|
||||
{
|
||||
mOriginalURI = aURI;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetURI(nsIURI* *aURI)
|
||||
{
|
||||
*aURI = mUrl;
|
||||
NS_IF_ADDREF(*aURI);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::Open(nsIInputStream **_retval)
|
||||
{
|
||||
printf("A OPENING BITMAP STREAM\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *ctxt)
|
||||
{
|
||||
nsCOMPtr<inIBitmapDepot> depot(do_GetService("@mozilla.org/inspector/bitmap-depot;1"));
|
||||
if (!depot)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<inIBitmapURI> uri(do_QueryInterface(mUrl));
|
||||
nsXPIDLString durl;
|
||||
uri->GetBitmapName(getter_Copies(durl));
|
||||
nsCOMPtr<inIBitmap> bitmap;
|
||||
depot->Get(durl, getter_AddRefs(bitmap));
|
||||
|
||||
if (!bitmap)
|
||||
return NS_ERROR_FAILURE;
|
||||
PRUint32 w, h;
|
||||
bitmap->GetWidth(&w);
|
||||
bitmap->GetHeight(&h);
|
||||
PRUint8* bitmapBuf;
|
||||
bitmap->GetBits(&bitmapBuf);
|
||||
|
||||
aListener->OnStartRequest(this, ctxt);
|
||||
|
||||
PRUint32 length = (w*h*3) + (sizeof(PRUint32)*2);
|
||||
PRUint8* buffer = new PRUint8[length];
|
||||
PRUint8* bufStart = buffer;
|
||||
PRUint32* wbuf = (PRUint32*) buffer;
|
||||
wbuf[0] = w;
|
||||
wbuf[1] = h;
|
||||
buffer = (PRUint8*)(wbuf+2);
|
||||
|
||||
for (PRUint32 i = 0; i < w*h; ++i) {
|
||||
buffer[0] = bitmapBuf[0];
|
||||
buffer[1] = bitmapBuf[1];
|
||||
buffer[2] = bitmapBuf[2];
|
||||
buffer += 3;
|
||||
bitmapBuf += 3;
|
||||
}
|
||||
|
||||
// turn our string into a stream...and make the appropriate calls on our consumer
|
||||
nsCOMPtr<nsISupports> streamSupports;
|
||||
NS_NewByteInputStream(getter_AddRefs(streamSupports), (const char*)bufStart, length);
|
||||
nsCOMPtr<nsIInputStream> inputStr (do_QueryInterface(streamSupports));
|
||||
aListener->OnDataAvailable(this, ctxt, inputStr, 0, length);
|
||||
aListener->OnStopRequest(this, ctxt, NS_OK);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::GetLoadFlags(PRUint32 *aLoadAttributes)
|
||||
{
|
||||
*aLoadAttributes = mLoadAttributes;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::SetLoadFlags(PRUint32 aLoadAttributes)
|
||||
{
|
||||
mLoadAttributes = aLoadAttributes;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::GetContentType(nsACString &aContentType)
|
||||
{
|
||||
aContentType = NS_LITERAL_CSTRING("image/inspector-bitmap");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::SetContentType(const nsACString &aContentType)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::GetContentCharset(nsACString &aContentCharset)
|
||||
{
|
||||
aContentCharset.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::SetContentCharset(const nsACString &aContentCharset)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapChannel::GetContentLength(PRInt32 *aContentLength)
|
||||
{
|
||||
*aContentLength = mContentLength;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::SetContentLength(PRInt32 aContentLength)
|
||||
{
|
||||
NS_NOTREACHED("inBitmapChannel::SetContentLength");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup)
|
||||
{
|
||||
*aLoadGroup = mLoadGroup;
|
||||
NS_IF_ADDREF(*aLoadGroup);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::SetLoadGroup(nsILoadGroup* aLoadGroup)
|
||||
{
|
||||
mLoadGroup = aLoadGroup;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetOwner(nsISupports* *aOwner)
|
||||
{
|
||||
*aOwner = mOwner.get();
|
||||
NS_IF_ADDREF(*aOwner);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::SetOwner(nsISupports* aOwner)
|
||||
{
|
||||
mOwner = aOwner;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetNotificationCallbacks(nsIInterfaceRequestor* *aNotificationCallbacks)
|
||||
{
|
||||
*aNotificationCallbacks = mCallbacks.get();
|
||||
NS_IF_ADDREF(*aNotificationCallbacks);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallbacks)
|
||||
{
|
||||
mCallbacks = aNotificationCallbacks;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
|
||||
{
|
||||
*aSecurityInfo = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
@ -39,7 +39,6 @@ NS_INTERFACE_MAP_END_THREADSAFE
|
|||
|
||||
inBitmapDecoder::inBitmapDecoder()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inBitmapDecoder::~inBitmapDecoder()
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Joe Hewitt <hewitt@netscape.com> (original author)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "inBitmapDepot.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "inIBitmap.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inBitmapDepot::inBitmapDepot()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inBitmapDepot::~inBitmapDepot()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(inBitmapDepot, inIBitmapDepot);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// inIBitmapDepot
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapDepot::Put(inIBitmap* aBitmap, const nsAString& aName)
|
||||
{
|
||||
nsStringKey key(aName);
|
||||
nsCOMPtr<inIBitmap> bitmap(aBitmap);
|
||||
nsCOMPtr<nsISupports> supports = do_QueryInterface(bitmap);
|
||||
mHash.Put(&key, supports);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapDepot::Get(const nsAString& aName, inIBitmap** _retval)
|
||||
{
|
||||
nsStringKey key(aName);
|
||||
nsCOMPtr<nsISupports> supports = mHash.Get(&key);
|
||||
nsCOMPtr<inIBitmap> bitmap = do_QueryInterface(supports);
|
||||
*_retval = bitmap;
|
||||
NS_IF_ADDREF(*_retval);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapDepot::Remove(const nsAString& aName, inIBitmap** _retval)
|
||||
{
|
||||
nsStringKey key(aName);
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
mHash.Remove(&key, getter_AddRefs(supports));
|
||||
nsCOMPtr<inIBitmap> bitmap = do_QueryInterface(supports);
|
||||
*_retval = bitmap;
|
||||
NS_IF_ADDREF(*_retval);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Brian Ryner.
|
||||
* Portions created by Brian Ryner are Copyright (C) 2000 Brian Ryner.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Joe Hewitt <hewitt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "inBitmapChannel.h"
|
||||
#include "inBitmapURI.h"
|
||||
#include "inBitmapProtocolHandler.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inBitmapProtocolHandler::inBitmapProtocolHandler()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inBitmapProtocolHandler::~inBitmapProtocolHandler()
|
||||
{}
|
||||
|
||||
NS_IMPL_ISUPPORTS2(inBitmapProtocolHandler, nsIProtocolHandler, nsISupportsWeakReference)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIProtocolHandler
|
||||
|
||||
NS_IMETHODIMP inBitmapProtocolHandler::GetScheme(nsACString &result)
|
||||
{
|
||||
result = "moz-bitmap";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapProtocolHandler::GetDefaultPort(PRInt32 *result)
|
||||
{
|
||||
*result = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapProtocolHandler::GetProtocolFlags(PRUint32 *result)
|
||||
{
|
||||
*result = URI_NORELATIVE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval)
|
||||
{
|
||||
// don't override anything.
|
||||
*_retval = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
const char *aOriginCharset, // ignored
|
||||
nsIURI *aBaseURI,
|
||||
nsIURI **result)
|
||||
{
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_NEWXPCOM(uri, inBitmapURI);
|
||||
if (!uri) return NS_ERROR_FAILURE;
|
||||
|
||||
nsresult rv = uri->SetSpec(aSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
*result = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
||||
*result = uri;
|
||||
NS_ADDREF(*result);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP inBitmapProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
|
||||
{
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
NS_NEWXPCOM(channel, inBitmapChannel);
|
||||
|
||||
if (channel)
|
||||
NS_STATIC_CAST(inBitmapChannel*,NS_STATIC_CAST(nsIChannel*, channel))->Init(url);
|
||||
|
||||
*result = channel;
|
||||
NS_IF_ADDREF(*result);
|
||||
|
||||
return NS_OK;
|
||||
}
|
|
@ -1,268 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* Contributors:
|
||||
* Joe Hewitt <hewitt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "inBitmapURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#define DEFAULT_IMAGE_SIZE 16
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS2(inBitmapURI, inIBitmapURI, nsIURI)
|
||||
|
||||
#define NS_BITMAP_SCHEME "moz-bitmap:"
|
||||
#define NS_BITMAP_DELIMITER '?'
|
||||
|
||||
inBitmapURI::inBitmapURI()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inBitmapURI::~inBitmapURI()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// inIBitmapURI
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetBitmapName(PRUnichar** aBitmapName)
|
||||
{
|
||||
*aBitmapName = ToNewUnicode(mBitmapName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
inBitmapURI::FormatSpec(nsACString &result)
|
||||
{
|
||||
result = NS_LITERAL_CSTRING(NS_BITMAP_SCHEME "//") + mBitmapName;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIURI
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetSpec(nsACString &aSpec)
|
||||
{
|
||||
return FormatSpec(aSpec);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetSpec(const nsACString &aSpec)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIIOService> ioService (do_GetService(kIOServiceCID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCAutoString scheme;
|
||||
rv = ioService->ExtractScheme(aSpec, scheme);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (strcmp("moz-bitmap", scheme.get()) != 0)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
nsACString::const_iterator end, colon, delim;
|
||||
aSpec.BeginReading(colon);
|
||||
aSpec.EndReading(end);
|
||||
|
||||
if (!FindCharInReadable(':', colon, end))
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
delim = ++colon;
|
||||
if (!FindCharInReadable(NS_BITMAP_DELIMITER, delim, end))
|
||||
delim = end;
|
||||
|
||||
mBitmapName = Substring(colon, delim);
|
||||
// TODO: parse out other parameters
|
||||
|
||||
if (mBitmapName.IsEmpty())
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetPrePath(nsACString &prePath)
|
||||
{
|
||||
prePath = NS_BITMAP_SCHEME;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetScheme(nsACString &aScheme)
|
||||
{
|
||||
aScheme = "moz-bitmap";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetScheme(const nsACString &aScheme)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetUsername(nsACString &aUsername)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetUsername(const nsACString &aUsername)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetPassword(nsACString &aPassword)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetPassword(const nsACString &aPassword)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetUserPass(nsACString &aUserPass)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetUserPass(const nsACString &aUserPass)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetHostPort(nsACString &aHostPort)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetHostPort(const nsACString &aHostPort)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetHost(nsACString &aHost)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetHost(const nsACString &aHost)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetPort(PRInt32 *aPort)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetPort(PRInt32 aPort)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetPath(nsACString &aPath)
|
||||
{
|
||||
aPath.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SetPath(const nsACString &aPath)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetAsciiSpec(nsACString &aSpec)
|
||||
{
|
||||
return GetSpec(aSpec);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetAsciiHost(nsACString &aHost)
|
||||
{
|
||||
return GetHost(aHost);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::GetOriginCharset(nsACString &result)
|
||||
{
|
||||
result.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::Equals(nsIURI *other, PRBool *result)
|
||||
{
|
||||
nsCAutoString spec1;
|
||||
nsCAutoString spec2;
|
||||
|
||||
other->GetSpec(spec2);
|
||||
GetSpec(spec1);
|
||||
|
||||
*result = !nsCRT::strcasecmp(spec1.get(), spec2.get());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::SchemeIs(const char *i_Scheme, PRBool *o_Equals)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(o_Equals);
|
||||
if (!i_Scheme) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
*o_Equals = PL_strcasecmp("moz-bitmap", i_Scheme) ? PR_FALSE : PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::Clone(nsIURI **result)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
inBitmapURI::Resolve(const nsACString &relativePath, nsACString &result)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
@ -59,8 +59,6 @@ inCSSValueSearch::inCSSValueSearch()
|
|||
mReturnRelativeURLs(PR_TRUE),
|
||||
mNormalizeChromeURLs(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
mProperties = new nsCSSProperty[100];
|
||||
mCSSUtils = do_GetService(kInspectorCSSUtilsCID);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ static NS_DEFINE_CID(kInspectorCSSUtilsCID, NS_INSPECTORCSSUTILS_CID);
|
|||
|
||||
inDOMUtils::inDOMUtils()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mCSSUtils = do_GetService(kInspectorCSSUtilsCID);
|
||||
}
|
||||
|
||||
|
|
|
@ -118,8 +118,6 @@ inDOMView::inDOMView() :
|
|||
mShowWhitespaceNodes(PR_TRUE),
|
||||
mFilters(PR_UINT16_MAX) // show all node types by default
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
kAnonymousAtom = NS_NewAtom("anonymous");
|
||||
kElementNodeAtom = NS_NewAtom("ELEMENT_NODE");
|
||||
kAttributeNodeAtom = NS_NewAtom("ATTRIBUTE_NODE");
|
||||
|
|
|
@ -54,8 +54,6 @@
|
|||
|
||||
inDeepTreeWalker::inDeepTreeWalker()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
mShowAnonymousContent = PR_FALSE;
|
||||
mShowSubDocuments = PR_FALSE;
|
||||
mWhatToShow = nsIDOMNodeFilter::SHOW_ALL;
|
||||
|
|
|
@ -57,7 +57,6 @@ inFileSearch::inFileSearch()
|
|||
mReturnRelativePaths(PR_FALSE),
|
||||
mSearchRecursive(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inFileSearch::~inFileSearch()
|
||||
|
|
|
@ -58,7 +58,6 @@ inFlasher::inFlasher() :
|
|||
mThickness(0),
|
||||
mInvert(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mCSSUtils = do_GetService(kInspectorCSSUtilsCID);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
|
||||
inPNGEncoder::inPNGEncoder()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
inPNGEncoder::~inPNGEncoder()
|
||||
|
|
|
@ -61,7 +61,6 @@ static NS_DEFINE_CID(kInspectorCSSUtilsCID, NS_INSPECTORCSSUTILS_CID);
|
|||
|
||||
inScreenCapturer::inScreenCapturer()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mCSSUtils = do_GetService(kInspectorCSSUtilsCID);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(nsGenericInterfaceInfoSet,
|
|||
|
||||
nsGenericInterfaceInfoSet::nsGenericInterfaceInfoSet()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mArena = XPT_NewArena(ARENA_BLOCK_SIZE, sizeof(double),
|
||||
"nsGenericInterfaceInfoSet Arena");
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
nsScriptableDataType(); // not implemented
|
||||
|
||||
nsScriptableDataType(const nsXPTType& aType)
|
||||
: mType(aType) {NS_INIT_ISUPPORTS();}
|
||||
: mType(aType) {}
|
||||
|
||||
virtual ~nsScriptableDataType() {}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
nsScriptableParamInfo(); // not implemented
|
||||
nsScriptableParamInfo(nsIInterfaceInfo* aInfo,
|
||||
const nsXPTParamInfo& aParam)
|
||||
: mInfo(aInfo), mParam(aParam) {NS_INIT_ISUPPORTS();}
|
||||
: mInfo(aInfo), mParam(aParam) {}
|
||||
virtual ~nsScriptableParamInfo() {}
|
||||
|
||||
private:
|
||||
|
@ -259,7 +259,7 @@ public:
|
|||
nsScriptableConstant(); // not implemented
|
||||
nsScriptableConstant(nsIInterfaceInfo* aInfo,
|
||||
const nsXPTConstant& aConst)
|
||||
: mInfo(aInfo), mConst(aConst) {NS_INIT_ISUPPORTS();}
|
||||
: mInfo(aInfo), mConst(aConst) {}
|
||||
virtual ~nsScriptableConstant() {}
|
||||
private:
|
||||
// Holding onto the interface info keeps the underlying const alive.
|
||||
|
@ -357,7 +357,7 @@ public:
|
|||
nsScriptableMethodInfo(); // not implemented
|
||||
nsScriptableMethodInfo(nsIInterfaceInfo* aInfo,
|
||||
const nsXPTMethodInfo& aMethod)
|
||||
: mInfo(aInfo), mMethod(aMethod) {NS_INIT_ISUPPORTS();}
|
||||
: mInfo(aInfo), mMethod(aMethod) {}
|
||||
virtual ~nsScriptableMethodInfo() {}
|
||||
private:
|
||||
// Holding onto the interface info keeps the underlying method alive.
|
||||
|
@ -471,13 +471,11 @@ NS_IMPL_ISUPPORTS1(nsScriptableInterfaceInfo, nsIScriptableInterfaceInfo)
|
|||
|
||||
nsScriptableInterfaceInfo::nsScriptableInterfaceInfo()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsScriptableInterfaceInfo::nsScriptableInterfaceInfo(nsIInterfaceInfo* aInfo)
|
||||
: mInfo(aInfo)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsScriptableInterfaceInfo::~nsScriptableInterfaceInfo()
|
||||
|
|
|
@ -1,437 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// ==============================
|
||||
// ! Scriptability related code !
|
||||
// ==============================
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//
|
||||
// This file implements the nsScriptablePeer object
|
||||
// The native methods of this class are supposed to
|
||||
// be callable from JavaScript
|
||||
//
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefService.h"
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIDebugPluginIID, NS_IDEBUGPLUGIN_IID);
|
||||
static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
nsScriptablePeer::nsScriptablePeer(nsPluginInstance* aPlugin)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mPlugin = aPlugin;
|
||||
|
||||
mDebugObj = do_GetService("@mozilla.org/debug/debugobject;1");
|
||||
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
nsScriptablePeer::~nsScriptablePeer()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsScriptablePeer)
|
||||
NS_IMPL_RELEASE(nsScriptablePeer)
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
* here nsScriptablePeer should return three interfaces it can be asked for by their iid's
|
||||
* static casts are necessary to ensure that correct pointer is returned
|
||||
*/
|
||||
NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
if(!aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if(aIID.Equals(kIDebugPluginIID)) {
|
||||
*aInstancePtr = static_cast<nsIDebugPlugin*>(this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if(aIID.Equals(kIClassInfoIID)) {
|
||||
*aInstancePtr = static_cast<nsIClassInfo*>(this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if(aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsIDebugPlugin*>(this));
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
* the following method will be callable from JavaScript
|
||||
*/
|
||||
NS_IMETHODIMP nsScriptablePeer::GetVersion(char * *aVersion)
|
||||
{
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::CreateDirectory(const PRUnichar *aFilePath,PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool retVal;
|
||||
|
||||
retVal = NS_ERROR_FAILURE;
|
||||
|
||||
if(mDebugObj){
|
||||
retVal = mDebugObj->CreateDirectory(aFilePath, aFlags);
|
||||
printf("Tested CreateDirectory\n");
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName,
|
||||
PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool retVal;
|
||||
|
||||
|
||||
if(mDebugObj){
|
||||
retVal = mDebugObj->DumpContent(aWindow,aFilePath,aFileName,aFlags);
|
||||
if (retVal == NS_OK) {
|
||||
*aResult= 0;
|
||||
} else if ( retVal == NS_ERROR_FILE_INVALID_PATH ) {
|
||||
*aResult = 2; // fatal error.. stop exection
|
||||
} else {
|
||||
*aResult = 1; // did not load.. keep going
|
||||
}
|
||||
printf("Tested DumpLayout\n");
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::OutputTextToFile(PRBool aNewFile,const PRUnichar *aFilePath, const PRUnichar *aFileName,
|
||||
const PRUnichar *aOutputString,PRInt32 *aResult)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool retVal;
|
||||
|
||||
|
||||
if(mDebugObj){
|
||||
retVal = mDebugObj->OutputTextToFile(aNewFile,aFilePath,aFileName,aOutputString);
|
||||
if (retVal == NS_OK) {
|
||||
*aResult= 0;
|
||||
} else {
|
||||
*aResult = 1; // not really fatal...
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath,
|
||||
const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool retVal = NS_ERROR_FAILURE;
|
||||
|
||||
if(mDebugObj){
|
||||
retVal = mDebugObj->CompareFrameModels(aBasePath,aVerPath,aBaseFile,aVerFile,aFlags);
|
||||
if (retVal == NS_OK) {
|
||||
*aResult= 0;
|
||||
} else {
|
||||
*aResult = 1;
|
||||
}
|
||||
printf("Tested CompareLayoutFiles\n");
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
* the following method will be callable from JavaScript
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::StartDirectorySearch(const char *aFilePath)
|
||||
{
|
||||
|
||||
nsXPIDLCString dirPath;
|
||||
nsresult rv;
|
||||
|
||||
nsCString dirStr(aFilePath);
|
||||
nsCOMPtr<nsIFile> theDir;
|
||||
rv = NS_GetFileFromURLSpec(dirStr, getter_AddRefs(theDir));
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("nsPluginInstance::StartDirectorySearch failed on creation of nsIFile [%s]\n", aFilePath);
|
||||
mIter = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
rv = theDir->GetDirectoryEntries(getter_AddRefs(mIter));
|
||||
if (NS_FAILED(rv)){
|
||||
printf("nsPluginInstance::StartDirectorySearch failed on GetDirectoryEntries of nsIFile [%s]\n", aFilePath);
|
||||
mIter = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
printf("Tested StartDirectory\n");
|
||||
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetNextFileInDirectory(char **aFilePath)
|
||||
{
|
||||
PRBool hasMore;
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
char* URLName;
|
||||
|
||||
*aFilePath = 0;
|
||||
if ( 0 ==mIter ){
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
while ( NS_SUCCEEDED(mIter->HasMoreElements(&hasMore)) ){
|
||||
rv = mIter->GetNext(getter_AddRefs(supports));
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
nsCOMPtr<nsIFile> dirEntry(do_QueryInterface(supports, &rv));
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
nsXPIDLCString filePath;
|
||||
char* afilepath;
|
||||
nsAutoString path;
|
||||
|
||||
|
||||
rv = dirEntry->GetPath(path);
|
||||
if (NS_FAILED(rv))
|
||||
continue;
|
||||
|
||||
afilepath = ToNewCString(path);
|
||||
|
||||
if( strstr(afilepath,".html") != 0 ) {
|
||||
*aFilePath = afilepath;
|
||||
nsCAutoString urlname;
|
||||
NS_GetURLSpecFromFile(dirEntry,urlname);
|
||||
URLName = ToNewCString(urlname);
|
||||
*aFilePath = URLName;
|
||||
break;
|
||||
} else {
|
||||
nsMemory::Free(afilepath);
|
||||
}
|
||||
}
|
||||
|
||||
printf("Tested NextDirectory\n");
|
||||
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP nsScriptablePeer::SetBoolPref(const PRUnichar *aPrefName, PRBool aVal)
|
||||
{
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (prefBranch) {
|
||||
nsCString prefName;
|
||||
prefName.AssignWithConversion(aPrefName);
|
||||
prefBranch->SetBoolPref(prefName.get(), aVal);
|
||||
return NS_OK;
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
* attribute boolean doRuntimeTests;
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetDoRuntimeTests(PRBool *aDoRuntimeTests)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetDoRuntimeTests(aDoRuntimeTests);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetDoRuntimeTests(PRBool aDoRuntimeTests)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetDoRuntimeTests(aDoRuntimeTests);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
* ttribute short testId;
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetTestId(PRInt16 *aTestId)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetTestId(aTestId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetTestId(PRInt16 aTestId)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetTestId(aTestId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
* attribute boolean printAsIs;
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetPrintAsIs(PRBool *aPrintAsIs)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetPrintAsIs(aPrintAsIs);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetPrintAsIs(PRBool aPrintAsIs)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetPrintAsIs(aPrintAsIs);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
/* attribute wstring printFileName; */
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetPrintFileName(PRUnichar * *aPrintFileName)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetPrintFileName(aPrintFileName);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetPrintFileName(const PRUnichar * aPrintFileName)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetPrintFileName(aPrintFileName);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
* See documentation in nsScriptablePeer.h
|
||||
* @update 9/25/02 dwc
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::PluginShutdown()
|
||||
{
|
||||
mPlugin = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,6 @@ nsDebugObject::nsDebugObject() :
|
|||
mRuntimeTestId(nsIDebugObject::PRT_RUNTIME_NONE),
|
||||
mFileName(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
|
|
|
@ -78,7 +78,6 @@ nsDebugObject::nsDebugObject() :
|
|||
mRuntimeTestId(nsIDebugObject::PRT_RUNTIME_NONE),
|
||||
mFileName(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
|
|
|
@ -89,7 +89,6 @@ NS_IMPL_ISUPPORTS3(nsP3PService,
|
|||
nsINetNotify);
|
||||
|
||||
nsP3PService::nsP3PService( ){
|
||||
NS_INIT_ISUPPORTS( );
|
||||
mCompactPolicy = nsnull;
|
||||
}
|
||||
|
||||
|
|
|
@ -342,8 +342,6 @@ NS_EXPORT nsresult NS_NewPICS(nsIPICS** aPICS)
|
|||
|
||||
nsPICS::nsPICS()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
mPrefs = nsnull;
|
||||
mPICSElementObserver = nsnull;
|
||||
mWebShellServicesURLTable = nsnull;
|
||||
|
|
|
@ -112,7 +112,6 @@ NS_PICS nsresult NS_NewPICSElementObserver(nsIObserver** anObserver)
|
|||
|
||||
nsPICSElementObserver::nsPICSElementObserver()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPICSElementObserver::~nsPICSElementObserver(void)
|
||||
|
@ -225,7 +224,6 @@ NS_IMPL_ISUPPORTS1(nsPICSElementObserverFactory, nsIFactory)
|
|||
|
||||
nsPICSElementObserverFactory::nsPICSElementObserverFactory(void)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPICSElementObserverFactory::~nsPICSElementObserverFactory(void)
|
||||
|
|
|
@ -60,7 +60,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS6(nsAutoConfig, nsIAutoConfig, nsITimerCallback, nsI
|
|||
|
||||
nsAutoConfig::nsAutoConfig()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsresult nsAutoConfig::Init()
|
||||
|
|
|
@ -63,7 +63,6 @@ NS_IMPL_ISUPPORTS1(AutoConfigSecMan, nsIXPCSecurityManager);
|
|||
|
||||
AutoConfigSecMan::AutoConfigSecMan()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -58,7 +58,6 @@ nsLDAPSyncQuery::nsLDAPSyncQuery() :
|
|||
mFinished(PR_FALSE), // This is a control variable for event loop
|
||||
mAttrCount(0), mAttrs(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
|
|
@ -105,7 +105,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS2(nsReadConfig, nsIReadConfig, nsIObserver)
|
|||
nsReadConfig::nsReadConfig() :
|
||||
mRead(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsresult nsReadConfig::Init()
|
||||
|
|
|
@ -76,7 +76,6 @@ PyG_Base::CreateNew(PyObject *pPyInstance, const nsIID &iid, void **ppResult)
|
|||
PyG_Base::PyG_Base(PyObject *instance, const nsIID &iid)
|
||||
{
|
||||
// Note that "instance" is the _policy_ instance!!
|
||||
NS_INIT_ISUPPORTS();
|
||||
PR_AtomicIncrement(&cGateways);
|
||||
m_pBaseObject = GetDefaultGateway(instance);
|
||||
// m_pWeakRef is an nsCOMPtr and needs no init.
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
PyXPCOM_GatewayWeakReference::PyXPCOM_GatewayWeakReference( PyG_Base *base )
|
||||
{
|
||||
m_pBase = base;
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
// bloat view uses 40 chars - stick "(WR)" at the end of this position.
|
||||
|
|
|
@ -33,7 +33,6 @@ nsSpellCheckController::nsSpellCheckController() :
|
|||
mOffset(0),
|
||||
mEndPoint(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSpellCheckController::~nsSpellCheckController()
|
||||
|
|
|
@ -62,7 +62,6 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
nsXPathEvaluator::nsXPathEvaluator()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsXPathEvaluator::~nsXPathEvaluator()
|
||||
|
|
|
@ -98,7 +98,6 @@ NS_IMPL_ISUPPORTS1(nsXPathExceptionProvider, nsIExceptionProvider)
|
|||
|
||||
nsXPathExceptionProvider::nsXPathExceptionProvider()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsXPathExceptionProvider::~nsXPathExceptionProvider()
|
||||
|
|
|
@ -60,7 +60,6 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
nsXPathExpression::nsXPathExpression(Expr* aExpression) : mExpression(aExpression)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsXPathExpression::~nsXPathExpression()
|
||||
|
|
|
@ -50,7 +50,6 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
nsXPathNSResolver::nsXPathNSResolver(nsIDOMNode* aNode)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mNode = do_QueryInterface(aNode);
|
||||
NS_ASSERTION(mNode, "Need a node to resolve namespaces.");
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
nsXPathNamespace::nsXPathNamespace()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsXPathNamespace::~nsXPathNamespace()
|
||||
|
|
|
@ -64,7 +64,6 @@ nsXPathResult::nsXPathResult() : mNumberValue(0),
|
|||
mResultType(ANY_TYPE),
|
||||
mInvalidIteratorState(PR_TRUE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsXPathResult::~nsXPathResult()
|
||||
|
|
|
@ -54,16 +54,12 @@ txMozillaTextOutput::txMozillaTextOutput(nsIDOMDocument* aSourceDocument,
|
|||
nsIDOMDocument* aResultDocument,
|
||||
nsITransformObserver* aObserver)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
mObserver = do_GetWeakReference(aObserver);
|
||||
createResultDocument(aSourceDocument, aResultDocument);
|
||||
}
|
||||
|
||||
txMozillaTextOutput::txMozillaTextOutput(nsIDOMDocumentFragment* aDest)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> doc;
|
||||
aDest->GetOwnerDocument(getter_AddRefs(doc));
|
||||
NS_ASSERTION(doc, "unable to get ownerdocument");
|
||||
|
|
|
@ -90,7 +90,6 @@ txMozillaXMLOutput::txMozillaXMLOutput(const String& aRootName,
|
|||
mInTransform(PR_FALSE),
|
||||
mCreatingNewDocument(PR_TRUE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mOutputFormat.merge(*aFormat);
|
||||
mOutputFormat.setFromDefaults();
|
||||
|
||||
|
@ -108,7 +107,6 @@ txMozillaXMLOutput::txMozillaXMLOutput(txOutputFormat* aFormat,
|
|||
mInTransform(PR_FALSE),
|
||||
mCreatingNewDocument(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mOutputFormat.merge(*aFormat);
|
||||
mOutputFormat.setFromDefaults();
|
||||
|
||||
|
|
|
@ -236,7 +236,6 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
txMozillaXSLTProcessor::txMozillaXSLTProcessor() : mVariables(PR_TRUE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
txMozillaXSLTProcessor::~txMozillaXSLTProcessor()
|
||||
|
|
|
@ -50,10 +50,6 @@ txUnknownHandler::txUnknownHandler(ProcessorState* aPs)
|
|||
: mTotal(0), mMax(kReasonableTransactions),
|
||||
mPs(aPs)
|
||||
{
|
||||
#ifndef TX_EXE
|
||||
NS_INIT_ISUPPORTS();
|
||||
#endif
|
||||
|
||||
mArray = new txOutputTransaction*[kReasonableTransactions];
|
||||
}
|
||||
|
||||
|
|
|
@ -156,8 +156,6 @@ nsTypeAheadFind::nsTypeAheadFind():
|
|||
mRepeatingMode(eRepeatingNone), mTimeoutLength(0),
|
||||
mSoundInterface(nsnull), mIsSoundInitialized(PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
#ifdef DEBUG
|
||||
// There should only ever be one instance of us
|
||||
static PRInt32 gInstanceCount;
|
||||
|
|
|
@ -263,7 +263,6 @@ void nsUniversalDetector::DataEnd()
|
|||
nsUniversalXPCOMDetector:: nsUniversalXPCOMDetector()
|
||||
: nsUniversalDetector()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mObserver = nsnull;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
|
@ -335,7 +334,6 @@ void nsUniversalXPCOMDetector::Report(const char* aCharset)
|
|||
nsUniversalXPCOMStringDetector:: nsUniversalXPCOMStringDetector()
|
||||
: nsUniversalDetector()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
nsUniversalXPCOMStringDetector::~nsUniversalXPCOMStringDetector()
|
||||
|
|
|
@ -63,7 +63,7 @@ class nsReporter : public nsICharsetDetectionObserver
|
|||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
public:
|
||||
nsReporter() { NS_INIT_ISUPPORTS(); };
|
||||
nsReporter() { };
|
||||
virtual ~nsReporter() { };
|
||||
|
||||
NS_IMETHOD Notify(const char* aCharset, nsDetectionConfident aConf)
|
||||
|
|
|
@ -1,203 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsIMemory.h"
|
||||
#include "plstr.h"
|
||||
#include <stdio.h>
|
||||
#include "nsICookieService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsCookieViewer.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CookieViewerImpl::CookieViewerImpl()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
CookieViewerImpl::~CookieViewerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(CookieViewerImpl, nsICookieViewer)
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::GetCookieValue(char** aValue)
|
||||
{
|
||||
NS_PRECONDITION(aValue != nsnull, "null ptr");
|
||||
if (!aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
nsAutoString cookieList;
|
||||
res = cookieservice->Cookie_GetCookieListForViewer(cookieList);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
*aValue = ToNewCString(cookieList);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::GetPermissionValue(PRInt32 type, char** aValue)
|
||||
{
|
||||
NS_PRECONDITION(aValue != nsnull, "null ptr");
|
||||
if (!aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
nsAutoString PermissionList;
|
||||
res = cookieservice->Cookie_GetPermissionListForViewer(PermissionList, type);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
*aValue = ToNewCString(PermissionList);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindowInternal* win)
|
||||
{
|
||||
/* process the value */
|
||||
NS_PRECONDITION(aValue != nsnull, "null ptr");
|
||||
if (! aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
nsAutoString netList; netList.AssignWithConversion(aValue);
|
||||
res = cookieservice->Cookie_CookieViewerReturn(netList);
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::BlockImage(const char* imageURL)
|
||||
{
|
||||
NS_PRECONDITION(imageURL != nsnull, "null ptr");
|
||||
if (! imageURL) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsresult res;
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &res);
|
||||
if (NS_FAILED(res)) {
|
||||
return res;
|
||||
}
|
||||
nsAutoString imageURLAutoString; imageURLAutoString.AssignWithConversion(imageURL);
|
||||
res = cookieservice->Image_Block(imageURLAutoString);
|
||||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CookieViewerImpl::AddPermission(nsIDOMWindowInternal* aWin, PRBool permission, PRInt32 type)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
/* all the following is just to get the url of the window */
|
||||
|
||||
NS_PRECONDITION(aWin != nsnull, "null ptr");
|
||||
if (!aWin) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject;
|
||||
scriptGlobalObject = do_QueryInterface(aWin);
|
||||
if(!scriptGlobalObject) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell;
|
||||
rv = scriptGlobalObject->GetDocShell(getter_AddRefs(docShell));
|
||||
if(NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
rv = docShell->GetPresShell(getter_AddRefs(presShell));
|
||||
if(NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
rv = presShell->GetDocument(getter_AddRefs(doc));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
if (!doc) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> docURL;
|
||||
doc->GetDocumentURL(getter_AddRefs(docURL));
|
||||
if (!docURL) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
char* spec;
|
||||
(void)docURL->GetSpec(&spec);
|
||||
nsAutoString objectURLAutoString; objectURLAutoString.AssignWithConversion(spec);
|
||||
Recycle(spec);
|
||||
|
||||
/* got the url at last, now pass it on to the Permission_Add routie */
|
||||
|
||||
nsCOMPtr<nsICookieService> cookieservice =
|
||||
do_GetService(kCookieServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
rv = cookieservice->Permission_Add(objectURLAutoString, permission, type);
|
||||
return rv;
|
||||
}
|
|
@ -55,7 +55,6 @@ static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
|
|||
|
||||
WalletEditorImpl::WalletEditorImpl()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
WalletEditorImpl::~WalletEditorImpl()
|
||||
|
|
|
@ -55,7 +55,6 @@ static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
|
|||
|
||||
SignonViewerImpl::SignonViewerImpl()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
SignonViewerImpl::~SignonViewerImpl()
|
||||
|
|
|
@ -45,7 +45,6 @@ NS_IMPL_ISUPPORTS1(nsBasicStreamGenerator, nsIKeyedStreamGenerator)
|
|||
|
||||
nsBasicStreamGenerator::nsBasicStreamGenerator()
|
||||
: mLevel(NS_SECURITY_LEVEL), mSalt(0), mPassword(), mState(0) {
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsBasicStreamGenerator::~nsBasicStreamGenerator() {
|
||||
|
|
|
@ -46,14 +46,12 @@
|
|||
NS_IMPL_ISUPPORTS2(nsPassword, nsIPassword, nsISupportsWeakReference);
|
||||
|
||||
nsPassword::nsPassword() {
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPassword::nsPassword(char * host, PRUnichar * user, PRUnichar * pswd) {
|
||||
passwordHost = host;
|
||||
passwordUser = user;
|
||||
passwordPswd = pswd;
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPassword::~nsPassword(void) {
|
||||
|
|
|
@ -51,7 +51,6 @@ class nsPasswordManagerEnumerator : public nsISimpleEnumerator
|
|||
|
||||
nsPasswordManagerEnumerator() : mHostCount(0), mUserCount(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
NS_IMETHOD HasMoreElements(PRBool *result)
|
||||
|
@ -107,7 +106,6 @@ class nsPasswordManagerRejectEnumerator : public nsISimpleEnumerator
|
|||
|
||||
nsPasswordManagerRejectEnumerator() : mRejectCount(0)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
NS_IMETHOD HasMoreElements(PRBool *result)
|
||||
|
@ -151,7 +149,6 @@ NS_IMPL_ISUPPORTS3(nsPasswordManager, nsIPasswordManager, nsIPasswordManagerInte
|
|||
|
||||
nsPasswordManager::nsPasswordManager()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsPasswordManager::~nsPasswordManager(void)
|
||||
|
|
|
@ -82,7 +82,7 @@ static NS_DEFINE_IID(kDocLoaderServiceCID, NS_DOCUMENTLOADER_SERVICE_CID);
|
|||
class nsSingleSignOnProfileObserver : public nsIObserver
|
||||
{
|
||||
public:
|
||||
nsSingleSignOnProfileObserver() { NS_INIT_ISUPPORTS(); }
|
||||
nsSingleSignOnProfileObserver() { }
|
||||
virtual ~nsSingleSignOnProfileObserver() {}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -128,7 +128,6 @@ static nsresult EnsureSingleSignOnProfileObserver()
|
|||
|
||||
nsWalletlibService::nsWalletlibService()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWalletlibService::~nsWalletlibService()
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
NS_DECL_NSIAUTHPROMPT
|
||||
NS_DECL_NSIAUTHPROMPTWRAPPER
|
||||
|
||||
nsSingleSignOnPrompt() { NS_INIT_ISUPPORTS(); }
|
||||
nsSingleSignOnPrompt() { }
|
||||
virtual ~nsSingleSignOnPrompt() {}
|
||||
|
||||
nsresult Init();
|
||||
|
|
|
@ -58,7 +58,6 @@ static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
|
|||
|
||||
WalletPreviewImpl::WalletPreviewImpl()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
WalletPreviewImpl::~WalletPreviewImpl()
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче