nsresult PresentationRequestParent::DoRequest(const StartSessionRequest& aRequest) { MOZ_ASSERT(mService); mNeedRegisterBuilder = true; mSessionId = aRequest.sessionId(); nsCOMPtr<nsIDOMEventTarget> eventTarget; ContentProcessManager* cpm = ContentProcessManager::GetSingleton(); RefPtr<TabParent> tp = cpm->GetTopLevelTabParentByProcessAndTabId(mChildId, aRequest.tabId()); if (tp) { eventTarget = do_QueryInterface(tp->GetOwnerElement()); } return mService->StartSession(aRequest.urls(), aRequest.sessionId(), aRequest.origin(), aRequest.deviceId(), aRequest.windowId(), eventTarget, this); }
nsresult PresentationRequestParent::DoRequest(const StartSessionRequest& aRequest) { MOZ_ASSERT(mService); mSessionId = aRequest.sessionId(); nsCOMPtr<nsIDOMEventTarget> eventTarget; ContentProcessManager* cpm = ContentProcessManager::GetSingleton(); RefPtr<TabParent> tp = cpm->GetTopLevelTabParentByProcessAndTabId(mChildId, aRequest.tabId()); if (tp) { eventTarget = do_QueryInterface(tp->GetOwnerElement()); } RefPtr<PresentationParent> parent = static_cast<PresentationParent*>(Manager()); nsCOMPtr<nsIPresentationTransportBuilderConstructor> constructor = new PresentationTransportBuilderConstructorIPC(parent); return mService->StartSession(aRequest.urls(), aRequest.sessionId(), aRequest.origin(), aRequest.deviceId(), aRequest.windowId(), eventTarget, aRequest.principal(), this, constructor); }