Bug 909003 - Part d: Remove some includes from nsHistory.h; r=bz

This commit is contained in:
Ms2ger 2013-09-06 08:43:16 +02:00
parent 69d3888665
commit ffdbcf4823
2 changed files with 21 additions and 12 deletions

View File

@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsHistory.h"
#include "jsapi.h"
#include "mozilla/dom/HistoryBinding.h"
#include "nsCOMPtr.h"
#include "nsPIDOMWindow.h"
@ -17,6 +19,7 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsReadableUtils.h"
#include "nsContentUtils.h"
#include "nsISHistory.h"
#include "nsISHistoryInternal.h"
#include "mozilla/Preferences.h"
@ -293,6 +296,16 @@ nsHistory::PushOrReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
aRv = docShell->AddState(aData, aTitle, aUrl, aReplace, aCx);
}
nsIDocShell*
nsHistory::GetDocShell() const
{
nsCOMPtr<nsPIDOMWindow> win = do_QueryReferent(mInnerWindow);
if (!win) {
return nullptr;
}
return win->GetDocShell();
}
already_AddRefed<nsISHistory>
nsHistory::GetSessionHistory() const
{

View File

@ -8,16 +8,17 @@
#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingUtils.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "nsIDOMHistory.h"
#include "nsString.h"
#include "nsISHistory.h"
#include "nsIWeakReference.h"
#include "nsPIDOMWindow.h"
#include "nsPIDOMWindow.h" // for GetParentObject
#include "nsStringFwd.h"
#include "nsWrapperCache.h"
class nsIDocShell;
class nsISHistory;
class nsIWeakReference;
class nsPIDOMWindow;
// Script "History" object
class nsHistory MOZ_FINAL : public nsIDOMHistory, // Empty, needed for extension
@ -49,12 +50,7 @@ public:
mozilla::ErrorResult& aRv);
protected:
nsIDocShell *GetDocShell() const {
nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mInnerWindow));
if (!win)
return nullptr;
return win->GetDocShell();
}
nsIDocShell* GetDocShell() const;
void PushOrReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
const nsAString& aTitle, const nsAString& aUrl,