From 1bdfbda8b21d82c20dacfa821d9b1113afd6fe8d Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 3 Jul 2003 20:34:52 +0000 Subject: [PATCH] Return already_AddRefed instead of a raw addrefed pointer. Bug 211195, r+sr=bryner --- content/events/src/nsEventStateManager.cpp | 4 ++-- content/events/src/nsEventStateManager.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 391756fd2ee..dd7ea6ae506 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -795,7 +795,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, // focused sub-window and sub-element for this top-level // window. - nsCOMPtr focusController = dont_AddRef(GetFocusControllerForDocument(mDocument)); + nsCOMPtr focusController = GetFocusControllerForDocument(mDocument); if (focusController) focusController->SetSuppressFocus(PR_TRUE, "Deactivate Suppression"); @@ -5482,7 +5482,7 @@ nsEventStateManager::ShiftFocusByDoc(PRBool aForward) } // Get the FocusController given an nsIDocument -nsIFocusController* +already_AddRefed nsEventStateManager::GetFocusControllerForDocument(nsIDocument* aDocument) { nsCOMPtr container; diff --git a/content/events/src/nsEventStateManager.h b/content/events/src/nsEventStateManager.h index 64a0b34848d..9754abbfa3a 100644 --- a/content/events/src/nsEventStateManager.h +++ b/content/events/src/nsEventStateManager.h @@ -47,6 +47,7 @@ #include "nsWeakReference.h" #include "nsHashtable.h" #include "nsITimer.h" +#include "nsCOMPtr.h" #include "nsIDocument.h" #include "nsCOMArray.h" @@ -185,7 +186,7 @@ protected: void EnsureDocument(nsIPresShell* aPresShell); void EnsureDocument(nsIPresContext* aPresContext); void FlushPendingEvents(nsIPresContext* aPresContext); - nsIFocusController* GetFocusControllerForDocument(nsIDocument* aDocument); + already_AddRefed GetFocusControllerForDocument(nsIDocument* aDocument); typedef enum { eAccessKeyProcessingNormal = 0,