Closed Bug 7105 Opened 26 years ago Closed 26 years ago

Patch for TestObserverService.cpp

Categories

(Core :: XPCOM, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: andreas.otte, Assigned: dp)

Details

Attachments

(1 file)

After the XPCOM 2.0 landing, this patch gets TestObserverService working: Index: TestObserverService.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/tests/TestObserverService.cpp,v retrieving revision 1.2 diff -r1.2 TestObserverService.cpp 0a1,18 > /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- > * > * 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. > */ > 10,11d27 < < 15,16d30 < #define BASE_DLL "raptorbase.dll" < 20c34 < nsIObserverService *anObserverService = NULL; --- > nsIObserverService *anObserverService = NULL; 23,32c37,44 < nsComponentManager::RegisterComponent(kObserverServiceCID, < "ObserverService", < NS_OBSERVERSERVICE_PROGID, < BASE_DLL,PR_FALSE, PR_FALSE); < < nsresult res = nsRepository::CreateInstance(kObserverServiceCID, < NULL, < kIObserverServiceIID, < (void **) &anObserverService); < --- > rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, > "components"); > if (NS_FAILED(rv)) return rv; > > nsresult res = nsComponentManager::CreateInstance(kObserverServiceCID, > NULL, > kIObserverServiceIID, > (void **) &anObserverService); 34c46 < if (res == NS_OK) { --- > if (res == NS_OK) { 42,46c54,57 < nsresult res = nsRepository::CreateInstance(kObserverCID, < NULL, < kIObserverIID, < (void **) &anObserver); < --- > nsresult res = nsRepository::CreateInstance(kObserverCID, > NULL, > kIObserverIID, > (void **) &anObserver); 49,51c60,62 < if (NS_FAILED(rv)) return rv; < < --- > > if (NS_FAILED(rv)) return rv; > 53c64 < if (NS_FAILED(rv)) return rv; --- > if (NS_FAILED(rv)) return rv; 55d65 < 57c67 < if (NS_FAILED(rv)) return rv; --- > if (NS_FAILED(rv)) return rv; 60,66c70,76 < if (NS_FAILED(rv)) return rv; < < nsIEnumerator* e; < rv = anObserverService->EnumerateObserverList(&e, &aTopic); < if (NS_FAILED(rv)) return rv; < nsISupports *inst; < --- > if (NS_FAILED(rv)) return rv; > > nsIEnumerator* e; > rv = anObserverService->EnumerateObserverList(&e, &aTopic); > if (NS_FAILED(rv)) return rv; > nsISupports *inst; > 70c80 < rv = inst->QueryInterface(nsIObserver::GetIID(), (void**)&anObse rver); --- > rv = inst->QueryInterface(nsIObserver::GetIID(),(void**)&anObser ver); 73c83 < } --- > } 76c86 < if (NS_FAILED(rv)) return rv; --- > if (NS_FAILED(rv)) return rv; 78,79d87 < rv = anObserverService->RemoveObserver(&bObserver, &aTopic); < if (NS_FAILED(rv)) return rv; 81,84c89,93 < < < } < return NS_OK; --- > rv = anObserverService->RemoveObserver(&bObserver, &aTopic); > if (NS_FAILED(rv)) return rv; > > } > return NS_OK; 86d94 <
Status: NEW → ASSIGNED
Target Milestone: M7
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Checking in TestObserverService.cpp; /cvsroot/mozilla/xpcom/tests/TestObserverService.cpp,v <-- TestObserverService.cpp new revision: 1.3; previous revision: 1.2 done
Status: RESOLVED → VERIFIED
code level fix, marking verified per developer input
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: