зеркало из https://github.com/mozilla/gecko-dev.git
Bug 937688 - Refactor some code to extract a TabChild::GetDocument method. r=botond
This commit is contained in:
Родитель
31f4ad7953
Коммит
5231178e52
|
@ -371,9 +371,7 @@ TabChild::Observe(nsISupports *aSubject,
|
|||
} else if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
|
||||
if (IsAsyncPanZoomEnabled()) {
|
||||
nsCOMPtr<nsIDocument> subject(do_QueryInterface(aSubject));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
mWebNav->GetDocument(getter_AddRefs(domDoc));
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
|
||||
nsCOMPtr<nsIDocument> doc(GetDocument());
|
||||
|
||||
if (SameCOMIdentity(subject, doc)) {
|
||||
nsCOMPtr<nsIDOMWindowUtils> utils(GetDOMWindowUtils());
|
||||
|
@ -1068,6 +1066,15 @@ TabChild::GetDOMWindowUtils()
|
|||
return utils.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
TabChild::GetDocument()
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
mWebNav->GetDocument(getter_AddRefs(domDoc));
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
|
||||
return doc.forget();
|
||||
}
|
||||
|
||||
static nsInterfaceHashtable<nsPtrHashKey<PContentDialogChild>, nsIDialogParamBlock>* gActiveDialogs;
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -451,6 +451,8 @@ private:
|
|||
|
||||
// Get the DOMWindowUtils for the top-level window in this tab.
|
||||
already_AddRefed<nsIDOMWindowUtils> GetDOMWindowUtils();
|
||||
// Get the Document for the top-level window in this tab.
|
||||
already_AddRefed<nsIDocument> GetDocument();
|
||||
|
||||
class CachedFileDescriptorInfo;
|
||||
class CachedFileDescriptorCallbackRunnable;
|
||||
|
|
Загрузка…
Ссылка в новой задаче