void Transfer::ret_status(const Uuid& tranId, unsigned int step, int status) { // P_STATUS data; data.status = status; // Message m(TRANSFER_RET_STATUS, sizeof(data), &data); // Manager()->Result(tranId, step, Id(), &m); }
NS_IMETHODIMP SmsRequestParent::NotifySendMessageFailed(int32_t aError, nsISupports *aMessage) { NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE); ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager()); MobileMessageData data; if (!GetMobileMessageDataFromMessage(parent, aMessage, data)) { return SendReply(ReplyMessageSendFail(aError, OptionalMobileMessageData(void_t()))); } return SendReply(ReplyMessageSendFail(aError, OptionalMobileMessageData(data))); }
NS_IMETHODIMP SmsRequestParent::NotifyMessageSent(nsISupports *aMessage) { NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE); ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager()); MobileMessageData data; if (GetMobileMessageDataFromMessage(parent, aMessage, data)) { return SendReply(ReplyMessageSend(data)); } return NS_ERROR_FAILURE; }
gfxRect ThebesLayerComposite::GetCompositionBounds() { // Walk up the tree, looking for a display-port - if we find one, we know // that this layer represents a content node and we can use its first // scrollable child, in conjunction with its content area and viewport offset // to establish the screen coordinates to which the content area will be // rendered. gfxRect compositionBounds; ContainerLayer* scrollableLayer = nullptr; for (ContainerLayer* parent = GetParent(); parent; parent = parent->GetParent()) { const FrameMetrics& parentMetrics = parent->GetFrameMetrics(); if (parentMetrics.IsScrollable()) scrollableLayer = parent; if (!parentMetrics.mDisplayPort.IsEmpty() && scrollableLayer) { // Get the composition bounds, so as not to waste rendering time. compositionBounds = gfxRect(parentMetrics.mCompositionBounds.x, parentMetrics.mCompositionBounds.y, parentMetrics.mCompositionBounds.width, parentMetrics.mCompositionBounds.height); // Calculate the scale transform applied to the root layer to determine // the content resolution. Layer* rootLayer = Manager()->GetRoot(); const gfx3DMatrix& rootTransform = rootLayer->GetTransform(); LayerToCSSScale scale(rootTransform.GetXScale(), rootTransform.GetYScale()); // Get the content document bounds, in screen-space. const FrameMetrics& metrics = scrollableLayer->GetFrameMetrics(); const LayerIntRect content = RoundedToInt(metrics.mScrollableRect / scale); // !!! WTF. this code is just wrong. See bug 881451. gfx::Point scrollOffset = gfx::Point((metrics.mScrollOffset.x * metrics.LayersPixelsPerCSSPixel().scale) / scale.scale, (metrics.mScrollOffset.y * metrics.LayersPixelsPerCSSPixel().scale) / scale.scale); const nsIntPoint contentOrigin( content.x - NS_lround(scrollOffset.x), content.y - NS_lround(scrollOffset.y)); gfxRect contentRect = gfxRect(contentOrigin.x, contentOrigin.y, content.width, content.height); gfxRect contentBounds = scrollableLayer->GetEffectiveTransform(). TransformBounds(contentRect); // Clip the composition bounds to the content bounds compositionBounds.IntersectRect(compositionBounds, contentBounds); break; } } return compositionBounds; }
void DocAccessibleParent::MaybeInitWindowEmulation() { if (!nsWinUtils::IsWindowEmulationStarted()) { return; } // XXX get the bounds from the tabParent instead of poking at accessibles // which might not exist yet. Accessible* outerDoc = OuterDocOfRemoteBrowser(); if (!outerDoc) { return; } RootAccessible* rootDocument = outerDoc->RootAccessible(); MOZ_ASSERT(rootDocument); bool isActive = true; nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0); if (Compatibility::IsDolphin()) { rect = Bounds(); nsIntRect rootRect = rootDocument->Bounds(); rect.x = rootRect.x - rect.x; rect.y -= rootRect.y; auto tab = static_cast<dom::TabParent*>(Manager()); tab->GetDocShellIsActive(&isActive); } IAccessibleHolder hWndAccHolder; HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow()); HWND hWnd = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd, rect.x, rect.y, rect.width, rect.height, isActive); if (hWnd) { // Attach accessible document to the emulated native window ::SetPropW(hWnd, kPropNameDocAccParent, (HANDLE)this); SetEmulatedWindowHandle(hWnd); IAccessible* rawHWNDAcc = nullptr; if (SUCCEEDED(::AccessibleObjectFromWindow(hWnd, OBJID_WINDOW, IID_IAccessible, (void**)&rawHWNDAcc))) { hWndAccHolder.Set(IAccessibleHolder::COMPtrType(rawHWNDAcc)); } } Unused << SendEmulatedWindow(reinterpret_cast<uintptr_t>(mEmulatedWindowHandle), hWndAccHolder); }
mozilla::ipc::IPCResult DocAccessibleParent::RecvShutdown() { Destroy(); auto mgr = static_cast<dom::TabParent*>(Manager()); if (!mgr->IsDestroyed()) { if (!PDocAccessibleParent::Send__delete__(this)) { return IPC_FAIL_NO_REASON(mgr); } } return IPC_OK(); }
bool TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bool& aUseSSL, const nsString& aBinaryType) { // We don't have browser actors in xpcshell, and hence can't run automated // tests without this loophole. if (net::UsingNeckoIPCSecurity() && !AssertAppProcessPermission(Manager()->Manager(), "tcp-socket")) { FireInteralError(this, __LINE__); return true; } // Obtain App ID uint32_t appId = nsIScriptSecurityManager::NO_APP_ID; const PContentParent *content = Manager()->Manager(); const InfallibleTArray<PBrowserParent*>& browsers = content->ManagedPBrowserParent(); if (browsers.Length() > 0) { TabParent *tab = static_cast<TabParent*>(browsers[0]); appId = tab->OwnAppId(); } nsresult rv; mIntermediary = do_CreateInstance("@mozilla.org/tcp-socket-intermediary;1", &rv); if (NS_FAILED(rv)) { FireInteralError(this, __LINE__); return true; } rv = mIntermediary->Open(this, aHost, aPort, aUseSSL, aBinaryType, appId, getter_AddRefs(mSocket)); if (NS_FAILED(rv) || !mSocket) { FireInteralError(this, __LINE__); return true; } return true; }
void ErrorPopUpScreen::Draw(float totalTime, float elapsedTime) { UNREFERENCED_PARAMETER(totalTime); UNREFERENCED_PARAMETER(elapsedTime); auto screenManager = Manager(); auto spriteBatch = screenManager->GetSpriteBatch(); auto spriteFont = screenManager->GetSpriteFont(); auto blendStates = screenManager->GetCommonStates(); auto viewportBounds = screenManager->GetScreenBounds(); float viewportWidth = float(viewportBounds.right); float viewportHeight = float(viewportBounds.bottom); auto scaleMatrix = DX::GetScaleMatrixForWindow(screenManager->GetWindowBounds()); // calculate position and size of error message XMFLOAT2 errorMsgPosition = XMFLOAT2(0, viewportHeight / 2.0f); XMVECTORF32 errorMsgColor = Colors::Yellow; XMFLOAT2 origin = XMFLOAT2(0, spriteFont->GetLineSpacing() / 2.0f); XMVECTOR size = spriteFont->MeasureString(m_errorMessage.c_str()); errorMsgPosition.x = viewportWidth / 2.0f - XMVectorGetX(size) / 2.0f; // create a rectangle representing the screen dimensions of the error message background rectangle long rectangleWidth = long(std::min(std::max(XMVectorGetX(size) + 100.0f, 600.0f), viewportWidth)); long rectangleHeight = long(spriteFont->GetLineSpacing() * 6.0f); long rectangleLeft = long(viewportWidth / 2.0f) - (rectangleWidth / 2); long rectangleTop = long(errorMsgPosition.y + spriteFont->GetLineSpacing()) - (rectangleHeight / 2); RECT backgroundRectangle = { rectangleLeft, rectangleTop, rectangleLeft + rectangleWidth, rectangleTop + rectangleHeight }; spriteBatch->Begin(SpriteSortMode_Deferred, blendStates->NonPremultiplied(), nullptr, nullptr, nullptr, nullptr, scaleMatrix); // draw a background color for the rectangle spriteBatch->Draw(m_backgroundTexture->GetResourceViewTemporary(), backgroundRectangle, BackgroundColor); // draw error message in the middle of the screen spriteFont->DrawString(spriteBatch.get(), m_errorMessage.c_str(), errorMsgPosition, errorMsgColor, 0, origin); // draw continuation prompt winrt::hstring continuePrompt = L"Press (A) to Continue"; if (!InputState::IsAnyGamepadConnected()) { continuePrompt = L"Press Enter to Continue"; } errorMsgPosition.y += spriteFont->GetLineSpacing(); size = spriteFont->MeasureString(continuePrompt.c_str()); errorMsgPosition.x = viewportWidth / 2.0f - XMVectorGetX(size) / 2.0f; spriteFont->DrawString(spriteBatch.get(), continuePrompt.c_str(), errorMsgPosition, Colors::Yellow, 0, origin); spriteBatch->End(); }
gfxRect ThebesLayerComposite::GetDisplayPort() { // We use GetTransform instead of GetEffectiveTransform in this function // as we want the transform of the shadowable layers and not that of the // shadow layers, which may have been modified due to async scrolling/ // zooming. gfx3DMatrix transform = GetTransform(); // Find out the area of the nearest display-port to invalidate retained // tiles. gfxRect displayPort; gfxSize parentResolution = GetEffectiveResolution(); for (ContainerLayer* parent = GetParent(); parent; parent = parent->GetParent()) { const FrameMetrics& metrics = parent->GetFrameMetrics(); if (displayPort.IsEmpty()) { if (!metrics.mDisplayPort.IsEmpty()) { // We use the bounds to cut down on complication/computation time. // This will be incorrect when the transform involves rotation, but // it'd be quite hard to retain invalid tiles correctly in this // situation anyway. displayPort = gfxRect(metrics.mDisplayPort.x, metrics.mDisplayPort.y, metrics.mDisplayPort.width, metrics.mDisplayPort.height); displayPort.ScaleRoundOut(parentResolution.width, parentResolution.height); } parentResolution.width /= metrics.mResolution.scale; parentResolution.height /= metrics.mResolution.scale; } if (parent->UseIntermediateSurface()) { transform.PreMultiply(parent->GetTransform()); } } // If no display port was found, use the widget size from the layer manager. if (displayPort.IsEmpty()) { LayerManagerComposite* manager = static_cast<LayerManagerComposite*>(Manager()); const nsIntSize& widgetSize = manager->GetWidgetSize(); displayPort.width = widgetSize.width; displayPort.height = widgetSize.height; } // Transform the display port into layer space. displayPort = transform.Inverse().TransformBounds(displayPort); return displayPort; }
int main(int argc, char **argv) { PoleaxeManager = Manager(new manager()); Alleg::Init(); Mouse m = Mouse(new mouse()); Keyboard k = Keyboard(new keyboard()); Display disp = Display(new display()); Timer t = Timer(new timer()); disp->SetDisplayMode(840, 525, 32); Window w = Window(new window("test window", 10, 10, 300, 200, 0)); PoleaxeManager->AddWindow(w); disp->SetBackground("background.bmp"); w->Draw(); PoleaxeManager->MessageLoop(); return 0; }
mozilla::ipc::IPCResult BrowserStreamParent::RecvStreamDestroyed() { if (DYING != mState) { NS_ERROR("Unexpected state"); return IPC_FAIL_NO_REASON(this); } mStreamPeer = nullptr; mState = DELETING; IProtocol* mgr = Manager(); if (!Send__delete__(this)) { return IPC_FAIL_NO_REASON(mgr); } return IPC_OK(); }
nsresult DOMStorageDBParent::Observe(const char* aTopic, const nsACString& aScopePrefix) { if (mIPCOpen) { #ifdef MOZ_NUWA_PROCESS if (!(static_cast<ContentParent*>(Manager())->IsNuwaProcess() && ContentParent::IsNuwaReady())) { #endif mozilla::unused << SendObserve(nsDependentCString(aTopic), nsCString(aScopePrefix)); #ifdef MOZ_NUWA_PROCESS } #endif } return NS_OK; }
PFTPChannelParent* NeckoParent::AllocPFTPChannelParent(PBrowserParent* aBrowser, const SerializedLoadContext& aSerialized, const FTPChannelCreationArgs& aOpenArgs) { nsCOMPtr<nsILoadContext> loadContext; const char *error = CreateChannelLoadContext(aBrowser, Manager(), aSerialized, loadContext); if (error) { printf_stderr("NeckoParent::AllocPFTPChannelParent: " "FATAL error: %s: KILLING CHILD PROCESS\n", error); return nullptr; } PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(aSerialized); FTPChannelParent *p = new FTPChannelParent(loadContext, overrideStatus); p->AddRef(); return p; }
void WebBrowserPersistDocumentChild::Start(nsIWebBrowserPersistDocument* aDocument) { MOZ_ASSERT(!mDocument); if (!aDocument) { SendInitFailure(NS_ERROR_FAILURE); return; } nsCOMPtr<nsIPrincipal> principal; WebBrowserPersistDocumentAttrs attrs; nsCOMPtr<nsIInputStream> postDataStream; #define ENSURE(e) do { \ nsresult rv = (e); \ if (NS_FAILED(rv)) { \ SendInitFailure(rv); \ return; \ } \ } while(0) ENSURE(aDocument->GetIsPrivate(&(attrs.isPrivate()))); ENSURE(aDocument->GetDocumentURI(attrs.documentURI())); ENSURE(aDocument->GetBaseURI(attrs.baseURI())); ENSURE(aDocument->GetContentType(attrs.contentType())); ENSURE(aDocument->GetCharacterSet(attrs.characterSet())); ENSURE(aDocument->GetTitle(attrs.title())); ENSURE(aDocument->GetReferrer(attrs.referrer())); ENSURE(aDocument->GetContentDisposition(attrs.contentDisposition())); ENSURE(aDocument->GetCacheKey(&(attrs.cacheKey()))); ENSURE(aDocument->GetPersistFlags(&(attrs.persistFlags()))); ENSURE(aDocument->GetPrincipal(getter_AddRefs(principal))); ENSURE(ipc::PrincipalToPrincipalInfo(principal, &(attrs.principal()))); ENSURE(aDocument->GetPostData(getter_AddRefs(postDataStream))); #undef ENSURE mozilla::ipc::AutoIPCStream autoStream; autoStream.Serialize(postDataStream, static_cast<mozilla::dom::ContentChild*>(Manager())); mDocument = aDocument; SendAttributes(attrs, autoStream.TakeOptionalValue()); }
bool FlyWebPublishedServerParent::RecvFetchResponse(const IPCInternalResponse& aResponse, const uint64_t& aRequestId) { MOZ_ASSERT(!mActorDestroyed); RefPtr<InternalRequest> request; mPendingRequests.Remove(aRequestId, getter_AddRefs(request)); if (!request) { static_cast<ContentParent*>(Manager())->KillHard("unknown request id"); return false; } RefPtr<InternalResponse> response = InternalResponse::FromIPC(aResponse); mPublishedServer->OnFetchResponse(request, response); return true; }
PWebSocketParent* NeckoParent::AllocPWebSocketParent(PBrowserParent* browser, const SerializedLoadContext& serialized) { nsCOMPtr<nsILoadContext> loadContext; const char *error = CreateChannelLoadContext(browser, Manager(), serialized, loadContext); if (error) { printf_stderr("NeckoParent::AllocPWebSocketParent: " "FATAL error: %s: KILLING CHILD PROCESS\n", error); return nullptr; } TabParent* tabParent = static_cast<TabParent*>(browser); PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(serialized); WebSocketChannelParent* p = new WebSocketChannelParent(tabParent, loadContext, overrideStatus); p->AddRef(); return p; }
bool DocAccessibleChild::ConstructChildDocInParentProcess( DocAccessibleChild* aNewChildDoc, uint64_t aUniqueID, uint32_t aMsaaID) { if (IsConstructedInParentProcess()) { // We may send the constructor immediately auto tabChild = static_cast<dom::TabChild*>(Manager()); MOZ_ASSERT(tabChild); bool result = tabChild->SendPDocAccessibleConstructor(aNewChildDoc, this, aUniqueID, aMsaaID, IAccessibleHolder()); if (result) { aNewChildDoc->SetConstructedInParentProcess(); } return result; } PushDeferredEvent(MakeUnique<SerializedChildDocConstructor>(aNewChildDoc, this, aUniqueID, aMsaaID)); return true; }
NS_IMETHODIMP SmsRequestParent::NotifyMessageGot(nsISupports *aMessage) { nsCOMPtr<nsIDOMMozMmsMessage> mms = do_QueryInterface(aMessage); if (mms) { MmsMessage *msg = static_cast<MmsMessage*>(mms.get()); ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager()); MmsMessageData data; if (!msg->GetData(parent, data)) { return NS_ERROR_FAILURE; } return SendReply(ReplyGetMessage(MobileMessageData(data))); } nsCOMPtr<nsIDOMMozSmsMessage> sms = do_QueryInterface(aMessage); if (sms) { SmsMessage* msg = static_cast<SmsMessage*>(sms.get()); return SendReply(ReplyGetMessage(MobileMessageData(msg->GetData()))); } return NS_ERROR_FAILURE; }
bool TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bool& aUseSSL, const bool& aUseArrayBuffers) { // We don't have browser actors in xpcshell, and hence can't run automated // tests without this loophole. if (net::UsingNeckoIPCSecurity() && !AssertAppProcessPermission(Manager()->Manager(), "tcp-socket")) { FireInteralError(this, __LINE__); return true; } // Obtain App ID uint32_t appId = GetAppId(); bool inIsolatedMozBrowser = GetInIsolatedMozBrowser(); mSocket = new TCPSocket(nullptr, aHost, aPort, aUseSSL, aUseArrayBuffers); mSocket->SetAppIdAndBrowser(appId, inIsolatedMozBrowser); mSocket->SetSocketBridgeParent(this); NS_ENSURE_SUCCESS(mSocket->Init(), true); return true; }
void program(){ HashTablePtr H = Initialize(5); int identity; char name[NameSize]; printf("***********************************\n" "*Welcome to User Management system*\n" "***********************************\n" "* Please press any key to continue*\n" "***********************************\n\n\n"); getchar(); identity = IdentityCheck(); Read(H); while(identity != 3) { switch (identity) { case 1: Manager(H); break; case 2: getchar(); printf("Input your name:\n"); scanf("%[^\n]", name); if(Find(name,NameSize,H) != NULL) { User(Find(name,NameSize,H),H); }else{ printf("Can't find!!!\n"); } break; default: printf("Invalid identity!!!\n"); break; } identity = IdentityCheck(); } Destroy(H); }
bool TCPSocketParent::RecvOpen(const nsString& aHost, const uint16_t& aPort, const bool& aUseSSL, const nsString& aBinaryType) { // We don't have browser actors in xpcshell, and hence can't run automated // tests without this loophole. if (net::UsingNeckoIPCSecurity() && !AssertAppProcessPermission(Manager()->Manager(), "tcp-socket")) { FireInteralError(this, __LINE__); return true; } // Obtain App ID uint32_t appId = GetAppId(); bool inBrowser = GetInBrowser(); if (NS_IsAppOffline(appId)) { NS_ERROR("Can't open socket because app is offline"); FireInteralError(this, __LINE__); return true; } nsresult rv; mIntermediary = do_CreateInstance("@mozilla.org/tcp-socket-intermediary;1", &rv); if (NS_FAILED(rv)) { FireInteralError(this, __LINE__); return true; } rv = mIntermediary->Open(this, aHost, aPort, aUseSSL, aBinaryType, appId, inBrowser, getter_AddRefs(mSocket)); if (NS_FAILED(rv) || !mSocket) { FireInteralError(this, __LINE__); return true; } return true; }
/** * @param aCOMProxy COM Proxy to the document in the content process. */ void DocAccessibleParent::SendParentCOMProxy() { // Make sure that we're not racing with a tab shutdown auto tab = static_cast<dom::TabParent*>(Manager()); MOZ_ASSERT(tab); if (tab->IsDestroyed()) { return; } Accessible* outerDoc = OuterDocOfRemoteBrowser(); if (!outerDoc) { return; } IAccessible* rawNative = nullptr; outerDoc->GetNativeInterface((void**) &rawNative); MOZ_ASSERT(rawNative); IAccessibleHolder::COMPtrType ptr(rawNative); IAccessibleHolder holder(Move(ptr)); Unused << PDocAccessibleParent::SendParentCOMProxy(holder); }
void FlyWebPublishedServerChild::OnFetchResponse(InternalRequest* aRequest, InternalResponse* aResponse) { LOG_I("FlyWebPublishedServerChild::OnFetchResponse(%p)", this); if (mActorDestroyed) { LOG_I("FlyWebPublishedServerChild::OnFetchResponse(%p) - No actor!", this); return; } uint64_t id = mPendingRequests.Get(aRequest); MOZ_ASSERT(id); mPendingRequests.Remove(aRequest); IPCInternalResponse ipcResp; UniquePtr<mozilla::ipc::AutoIPCStream> autoStream; aResponse->ToIPC(&ipcResp, Manager(), autoStream); Unused << SendFetchResponse(ipcResp, id); if (autoStream) { autoStream->TakeOptionalValue(); } }
MOZ_WARN_UNUSED_RESULT bool CookieServiceParent::GetOriginAttributesFromParams(const IPC::SerializedLoadContext &aLoadContext, OriginAttributes& aAttrs, bool& aIsPrivate) { aIsPrivate = false; const char* error = NeckoParent::GetValidatedAppInfo(aLoadContext, Manager()->Manager(), aAttrs); if (error) { NS_WARNING(nsPrintfCString("CookieServiceParent: GetOriginAttributesFromParams: " "FATAL error: %s: KILLING CHILD PROCESS\n", error).get()); return false; } if (aLoadContext.IsPrivateBitValid()) { aIsPrivate = aLoadContext.mUsePrivateBrowsing; } return true; }
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); }
NS_IMETHODIMP MobileMessageCursorParent::NotifyCursorResult(nsISupports* aResult) { // The child process could die before this asynchronous notification, in which // case ActorDestroy() was called and mContinueCallback is now null. Return an // error here to avoid sending a message to the dead process. NS_ENSURE_TRUE(mContinueCallback, NS_ERROR_FAILURE); nsCOMPtr<nsIDOMMozSmsMessage> iSms = do_QueryInterface(aResult); if (iSms) { SmsMessage* message = static_cast<SmsMessage*>(aResult); return SendNotifyResult(MobileMessageCursorData(message->GetData())) ? NS_OK : NS_ERROR_FAILURE; } nsCOMPtr<nsIDOMMozMmsMessage> iMms = do_QueryInterface(aResult); if (iMms) { MmsMessage* message = static_cast<MmsMessage*>(aResult); ContentParent* parent = static_cast<ContentParent*>(Manager()->Manager()); MmsMessageData data; if (!message->GetData(parent, data)) { return NS_ERROR_FAILURE; } return SendNotifyResult(MobileMessageCursorData(data)) ? NS_OK : NS_ERROR_FAILURE; } nsCOMPtr<nsIDOMMozMobileMessageThread> iThread = do_QueryInterface(aResult); if (iThread) { MobileMessageThread* thread = static_cast<MobileMessageThread*>(aResult); return SendNotifyResult(MobileMessageCursorData(thread->GetData())) ? NS_OK : NS_ERROR_FAILURE; } MOZ_NOT_REACHED("Received invalid response parameters!"); return NS_ERROR_FAILURE; }
void BroadcastChannelParent::Deliver(const ClonedMessageData& aData) { AssertIsOnBackgroundThread(); // Duplicate the data for this parent. ClonedMessageData newData(aData); // Create new BlobParent objects for this message. for (uint32_t i = 0, len = newData.blobsParent().Length(); i < len; ++i) { RefPtr<BlobImpl> impl = static_cast<BlobParent*>(newData.blobsParent()[i])->GetBlobImpl(); PBlobParent* blobParent = BackgroundParent::GetOrCreateActorForBlobImpl(Manager(), impl); if (!blobParent) { return; } newData.blobsParent()[i] = blobParent; } Unused << SendNotify(newData); }
bool SmsParent::GetMobileMessageDataFromMessage(nsISupports *aMsg, MobileMessageData &aData) { nsCOMPtr<nsIDOMMozMmsMessage> mmsMsg = do_QueryInterface(aMsg); if (mmsMsg) { MmsMessageData data; ContentParent *parent = static_cast<ContentParent*>(Manager()); if (!static_cast<MmsMessage*>(mmsMsg.get())->GetData(parent, data)) { return false; } aData = data; return true; } nsCOMPtr<nsIDOMMozSmsMessage> smsMsg = do_QueryInterface(aMsg); if (smsMsg) { aData = static_cast<SmsMessage*>(smsMsg.get())->GetData(); return true; } NS_WARNING("Cannot get MobileMessageData"); return false; }
Manager Manager::instance(){ return Manager(); }
mozilla::dom::TabParent* PluginWidgetParent::GetTabParent() { return static_cast<mozilla::dom::TabParent*>(Manager()); }