Closed Bug 574505 Opened 15 years ago Closed 15 years ago

Add messageManager attribute to nsITabChild

Categories

(Core :: IPC, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX
Tracking Status
fennec 2.0b1+ ---

People

(Reporter: azakai, Assigned: dougt)

Details

Attachments

(1 file, 1 obsolete file)

If nsITabChild had a messageManager attribute, we could get the relevant messageManager for a particular window, which would be very useful in JS code, with return aWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShell) .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsITabChild) .messageManager;
Attached patch Patch (obsolete) — Splinter Review
Patch apparently has something wrong with it, using the messageManager acquired this way leads to random crashes (do the same thing 5 times, work perfectly 4 times, crash on the 5th time) in seemingly unrelated things, ###!!! ASSERTION: didn't call Disconnect: '!mTarget', file /scratchbox/users/alon/home/alon/electrolysis/content/events/src/nsEventListenerManager.cpp, line 294 and crash with (gdb) where #0 0xb77e1832 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0xb53fcce6 in nanosleep () at ../sysdeps/unix/syscall-template.S:82 #2 0xb53fcb10 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138 #3 0xb5903fa5 in ah_crap_handler (signum=11) at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsSigHandlers.cpp:132 #4 0xb5903ffe in child_ah_crap_handler (signum=11) at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsSigHandlers.cpp:145 #5 <signal handler called> #6 0xb6d948df in NS_InvokeByIndex_P () at /scratchbox/users/alon/home/alon/electrolysis/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp:69 #7 0xb66685db in CallMethodHelper::Invoke (this=0xbfe53cb4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednative.cpp:2983 #8 0xb66668c4 in CallMethodHelper::Call (this=0xbfe53cb4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednative.cpp:2308 #9 0xb66627f2 in XPCWrappedNative::CallMethod (ccx=..., mode=XPCWrappedNative::CALL_GETTER) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednative.cpp:2272 #10 0xb66744d7 in XPCWrappedNative::GetAttribute (ccx=...) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcprivate.h:2565 #11 0xb6672bdb in XPC_WN_GetterSetter (cx=0xb12f0000, obj=0xb0e119a0, argc=0, argv=0xb10000c0, vp=0xb10000e0) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednativejsops.cpp:1833 #12 0xb5100192 in js_Invoke (cx=0xb12f0000, args=..., flags=2) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:654 #13 0xb51003a5 in js_InternalInvoke (cx=0xb12f0000, obj=0xb0e119a0, fval=-1327329056, flags=0, argc=0, argv=0x0, rval=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:694 #14 0xb51004c5 in js_InternalGetOrSet (cx=0xb12f0000, obj=0xb0e119a0, id=-1327447276, fval=-1327329056, mode=JSACC_READ, argc=0, argv=0x0, rval=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:730 #15 0xb51239ae in JSScopeProperty::get (this=0xb34ba4d0, cx=0xb12f0000, obj=0xb0e119a0, pobj=0xb0e11980, vp=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsscope.h:992 #16 0xb511d82a in js_NativeGet (cx=0xb12f0000, obj=0xb0e119a0, pobj=0xb0e11980, sprop=0xb34ba4d0, getHow=0, vp=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsobj.cpp:4758 #17 0xb50ee5b2 in js_Interpret (cx=0xb12f0000) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsops.cpp:2227 #18 0xb510021b in js_Invoke (cx=0xb12f0000, args=..., flags=0) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:664 #19 0xb51003a5 in js_InternalInvoke (cx=0xb12f0000, obj=0xb0e22380, fval=-1327327456, flags=0, argc=1, argv=0xbfe54750, rval=0xbfe547f4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:694 #20 0xb5075dca in JS_CallFunctionValue (cx=0xb12f0000, obj=0xb0e22380, fval=-1327327456, argc=1, argv=0xbfe54750, rval=0xbfe547f4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsapi.cpp:4634 #21 0xb5f51213 in nsFrameMessageManager::ReceiveMessage (this=0xb12ff700, aTarget=0xb0f57980, aMessage=..., aSync=0, aJSON=..., aObjectsArray=0xb0e3cc20, aJSONRetVal=0x0, aContext=0x0) ---Type <return> to continue, or q <return> to quit--- at /scratchbox/users/alon/home/alon/electrolysis/content/base/src/nsFrameMessageManager.cpp:430 #22 0xb6bbde41 in mozilla::dom::TabChild::RecvsendAsyncMessageToChild (this=0xb3f16e10, aMessage=..., aJSON=...) at /scratchbox/users/alon/home/alon/electrolysis/dom/ipc/TabChild.cpp:932 #23 0xb6cac527 in mozilla::dom::PIFrameEmbeddingChild::OnMessageReceived (this=0xb3f16e10, __msg=...) at PIFrameEmbeddingChild.cpp:839 #24 0xb6ca51ca in mozilla::dom::PContentProcessChild::OnMessageReceived (this=0xb3f2d038, __msg=...) at PContentProcessChild.cpp:536 #25 0xb6bdf66d in mozilla::ipc::AsyncChannel::OnDispatchMessage (this=0xb3f2d040, msg=...) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/AsyncChannel.cpp:262 #26 0xb6be793f in mozilla::ipc::RPCChannel::OnMaybeDequeueOne (this=0xb3f2d040) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/RPCChannel.cpp:438 #27 0xb6bed389 in void DispatchToMethod<mozilla::ipc::RPCChannel, bool (mozilla::ipc::RPCChannel::*)()>(mozilla::ipc::RPCChannel*, bool (mozilla::ipc::RPCChannel::*)(), Tuple0 const&) () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #28 0xb6bed315 in RunnableMethod<mozilla::ipc::RPCChannel, bool (mozilla::ipc::RPCChannel::*)(), Tuple0>::Run() () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #29 0xb6be90de in mozilla::ipc::RPCChannel::RefCountedTask::Run() () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #30 0xb6be91d6 in mozilla::ipc::RPCChannel::DequeueTask::Run() () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #31 0xb6de3d1e in MessageLoop::RunTask (this=0xbfe55944, task=0xaf406540) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:336 #32 0xb6de3d87 in MessageLoop::DeferOrRunPendingTask (this=0xbfe55944, pending_task=...) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:344 #33 0xb6de415d in MessageLoop::DoWork (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:444 #34 0xb6be4cf3 in mozilla::ipc::DoWorkRunnable::Run (this=0xb3f01800) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:75 #35 0xb6d77eba in nsThread::ProcessNextEvent (this=0xb3f381a0, mayWait=1, result=0xbfe54cfc) at /scratchbox/users/alon/home/alon/electrolysis/xpcom/threads/nsThread.cpp:547 #36 0xb6d0ba95 in NS_ProcessNextEvent_P (thread=0xb3f381a0, mayWait=1) at nsThreadUtils.cpp:250 #37 0xb6be5165 in mozilla::ipc::MessagePump::Run (this=0xb3f13130, aDelegate=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:142 #38 0xb6be5592 in mozilla::ipc::MessagePumpForChildProcess::Run (this=0xb3f13130, aDelegate=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:232 #39 0xb6de387b in MessageLoop::RunInternal (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:216 #40 0xb6de37fb in MessageLoop::RunHandler (this=0xbfe55944) ---Type <return> to continue, or q <return> to quit--- at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:199 #41 0xb6de379f in MessageLoop::Run (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:173 #42 0xb6a878ca in nsBaseAppShell::Run (this=0xb0f701f0) at /scratchbox/users/alon/home/alon/electrolysis/widget/src/xpwidgets/nsBaseAppShell.cpp:175 #43 0xb5905309 in XRE_RunAppShell () at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsEmbedFunctions.cpp:566 #44 0xb6be54b2 in mozilla::ipc::MessagePumpForChildProcess::Run (this=0xb3f13130, aDelegate=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:218 #45 0xb6de387b in MessageLoop::RunInternal (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:216 #46 0xb6de37fb in MessageLoop::RunHandler (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:199 #47 0xb6de379f in MessageLoop::Run (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:173 #48 0xb5904d71 in XRE_InitChildProcess (aArgc=1, aArgv=0xbfe55b74, aProcess=GeckoProcessType_Content) at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsEmbedFunctions.cpp:447 #49 0x08049270 in main (argc=3, argv=0xbfe55b74) at /scratchbox/users/alon/home/alon/electrolysis/ipc/app/MozillaRuntimeMain.cpp:87 (gdb) (gdb) where #0 0xb77e1832 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0xb53fcce6 in nanosleep () at ../sysdeps/unix/syscall-template.S:82 #2 0xb53fcb10 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138 #3 0xb5903fa5 in ah_crap_handler (signum=11) at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsSigHandlers.cpp:132 #4 0xb5903ffe in child_ah_crap_handler (signum=11) at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsSigHandlers.cpp:145 #5 <signal handler called> #6 0xb6d948df in NS_InvokeByIndex_P () at /scratchbox/users/alon/home/alon/electrolysis/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp:69 #7 0xb66685db in CallMethodHelper::Invoke (this=0xbfe53cb4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednative.cpp:2983 #8 0xb66668c4 in CallMethodHelper::Call (this=0xbfe53cb4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednative.cpp:2308 #9 0xb66627f2 in XPCWrappedNative::CallMethod (ccx=..., mode=XPCWrappedNative::CALL_GETTER) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednative.cpp:2272 #10 0xb66744d7 in XPCWrappedNative::GetAttribute (ccx=...) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcprivate.h:2565 #11 0xb6672bdb in XPC_WN_GetterSetter (cx=0xb12f0000, obj=0xb0e119a0, argc=0, argv=0xb10000c0, vp=0xb10000e0) at /scratchbox/users/alon/home/alon/electrolysis/js/src/xpconnect/src/xpcwrappednativejsops.cpp:1833 #12 0xb5100192 in js_Invoke (cx=0xb12f0000, args=..., flags=2) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:654 #13 0xb51003a5 in js_InternalInvoke (cx=0xb12f0000, obj=0xb0e119a0, fval=-1327329056, flags=0, argc=0, argv=0x0, rval=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:694 #14 0xb51004c5 in js_InternalGetOrSet (cx=0xb12f0000, obj=0xb0e119a0, id=-1327447276, fval=-1327329056, mode=JSACC_READ, argc=0, argv=0x0, rval=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:730 #15 0xb51239ae in JSScopeProperty::get (this=0xb34ba4d0, cx=0xb12f0000, obj=0xb0e119a0, pobj=0xb0e11980, vp=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsscope.h:992 #16 0xb511d82a in js_NativeGet (cx=0xb12f0000, obj=0xb0e119a0, pobj=0xb0e11980, sprop=0xb34ba4d0, getHow=0, vp=0xbfe54500) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsobj.cpp:4758 #17 0xb50ee5b2 in js_Interpret (cx=0xb12f0000) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsops.cpp:2227 #18 0xb510021b in js_Invoke (cx=0xb12f0000, args=..., flags=0) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:664 #19 0xb51003a5 in js_InternalInvoke (cx=0xb12f0000, obj=0xb0e22380, fval=-1327327456, flags=0, argc=1, argv=0xbfe54750, rval=0xbfe547f4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsinterp.cpp:694 #20 0xb5075dca in JS_CallFunctionValue (cx=0xb12f0000, obj=0xb0e22380, fval=-1327327456, argc=1, argv=0xbfe54750, rval=0xbfe547f4) at /scratchbox/users/alon/home/alon/electrolysis/js/src/jsapi.cpp:4634 #21 0xb5f51213 in nsFrameMessageManager::ReceiveMessage (this=0xb12ff700, aTarget=0xb0f57980, aMessage=..., aSync=0, aJSON=..., aObjectsArray=0xb0e3cc20, aJSONRetVal=0x0, aContext=0x0) ---Type <return> to continue, or q <return> to quit--- at /scratchbox/users/alon/home/alon/electrolysis/content/base/src/nsFrameMessageManager.cpp:430 #22 0xb6bbde41 in mozilla::dom::TabChild::RecvsendAsyncMessageToChild (this=0xb3f16e10, aMessage=..., aJSON=...) at /scratchbox/users/alon/home/alon/electrolysis/dom/ipc/TabChild.cpp:932 #23 0xb6cac527 in mozilla::dom::PIFrameEmbeddingChild::OnMessageReceived (this=0xb3f16e10, __msg=...) at PIFrameEmbeddingChild.cpp:839 #24 0xb6ca51ca in mozilla::dom::PContentProcessChild::OnMessageReceived (this=0xb3f2d038, __msg=...) at PContentProcessChild.cpp:536 #25 0xb6bdf66d in mozilla::ipc::AsyncChannel::OnDispatchMessage (this=0xb3f2d040, msg=...) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/AsyncChannel.cpp:262 #26 0xb6be793f in mozilla::ipc::RPCChannel::OnMaybeDequeueOne (this=0xb3f2d040) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/RPCChannel.cpp:438 #27 0xb6bed389 in void DispatchToMethod<mozilla::ipc::RPCChannel, bool (mozilla::ipc::RPCChannel::*)()>(mozilla::ipc::RPCChannel*, bool (mozilla::ipc::RPCChannel::*)(), Tuple0 const&) () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #28 0xb6bed315 in RunnableMethod<mozilla::ipc::RPCChannel, bool (mozilla::ipc::RPCChannel::*)(), Tuple0>::Run() () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #29 0xb6be90de in mozilla::ipc::RPCChannel::RefCountedTask::Run() () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #30 0xb6be91d6 in mozilla::ipc::RPCChannel::DequeueTask::Run() () from /scratchbox/users/alon/home/alon/mobilebase-gtk2-SLOW/dist/bin/libxul.so #31 0xb6de3d1e in MessageLoop::RunTask (this=0xbfe55944, task=0xaf406540) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:336 #32 0xb6de3d87 in MessageLoop::DeferOrRunPendingTask (this=0xbfe55944, pending_task=...) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:344 #33 0xb6de415d in MessageLoop::DoWork (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:444 #34 0xb6be4cf3 in mozilla::ipc::DoWorkRunnable::Run (this=0xb3f01800) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:75 #35 0xb6d77eba in nsThread::ProcessNextEvent (this=0xb3f381a0, mayWait=1, result=0xbfe54cfc) at /scratchbox/users/alon/home/alon/electrolysis/xpcom/threads/nsThread.cpp:547 #36 0xb6d0ba95 in NS_ProcessNextEvent_P (thread=0xb3f381a0, mayWait=1) at nsThreadUtils.cpp:250 #37 0xb6be5165 in mozilla::ipc::MessagePump::Run (this=0xb3f13130, aDelegate=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:142 #38 0xb6be5592 in mozilla::ipc::MessagePumpForChildProcess::Run (this=0xb3f13130, aDelegate=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:232 #39 0xb6de387b in MessageLoop::RunInternal (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:216 #40 0xb6de37fb in MessageLoop::RunHandler (this=0xbfe55944) ---Type <return> to continue, or q <return> to quit--- at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:199 #41 0xb6de379f in MessageLoop::Run (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:173 #42 0xb6a878ca in nsBaseAppShell::Run (this=0xb0f701f0) at /scratchbox/users/alon/home/alon/electrolysis/widget/src/xpwidgets/nsBaseAppShell.cpp:175 #43 0xb5905309 in XRE_RunAppShell () at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsEmbedFunctions.cpp:566 #44 0xb6be54b2 in mozilla::ipc::MessagePumpForChildProcess::Run (this=0xb3f13130, aDelegate=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/glue/MessagePump.cpp:218 #45 0xb6de387b in MessageLoop::RunInternal (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:216 #46 0xb6de37fb in MessageLoop::RunHandler (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:199 #47 0xb6de379f in MessageLoop::Run (this=0xbfe55944) at /scratchbox/users/alon/home/alon/electrolysis/ipc/chromium/src/base/message_loop.cc:173 #48 0xb5904d71 in XRE_InitChildProcess (aArgc=1, aArgv=0xbfe55b74, aProcess=GeckoProcessType_Content) at /scratchbox/users/alon/home/alon/electrolysis/toolkit/xre/nsEmbedFunctions.cpp:447 #49 0x08049270 in main (argc=3, argv=0xbfe55b74) at /scratchbox/users/alon/home/alon/electrolysis/ipc/app/MozillaRuntimeMain.cpp:87 (gdb)
> Patch apparently has something wrong with it Yes, you didn't addref your out param. That said, why does the JS code in comment 0 need the QI to nsIDocShell?
Also, do you really want to throw if there's no mTabChildGlobal instead of returning null?
(In reply to comment #2) > > Patch apparently has something wrong with it > > Yes, you didn't addref your out param. > Oops, I knew I was forgetting something, thanks. > That said, why does the JS code in comment 0 need the QI to nsIDocShell? > You are right, it doesn't, will fix. > Also, do you really want to throw if there's no mTabChildGlobal instead of returning null? Well, the only reason I did that is in the use case I have in mind that seems more natural. But I guess it should be consistent with other interfaces, would returning null be better?
Attached patch v2Splinter Review
Fixed version.
Attachment #453914 - Attachment is obsolete: true
Attachment #455037 - Flags: superreview?(Olli.Pettay)
Attachment #455037 - Flags: review?(doug.turner)
Attachment #455037 - Flags: superreview?(Olli.Pettay)
Attachment #455037 - Flags: superreview-
Attachment #455037 - Flags: review?(doug.turner)
Attachment #455037 - Flags: review-
Comment on attachment 455037 [details] [diff] [review] v2 >+ > // Sole purpose is to be able to identify the concrete class nsTabChild No longer true. >+ /** >+ * The message manager used by this tab. Scripts that need to send >+ * messages can use this, for example, if you have a window then >+ * you can get the relevant message manager with >+ * >+ * someWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor) >+ * .getInterface(Components.interfaces.nsIWebNavigation) >+ * .QueryInterface(Components.interfaces.nsIInterfaceRequestor) >+ * .getInterface(Components.interfaces.nsITabChild) >+ * .messageManager Every time I see this sort of mess, it makes me want to cry. Can we set it up so that the window has the messageManager attribute? Olli? > >+NS_IMETHODIMP >+TabChild::GetMessageManager(nsIContentFrameMessageManager** aMessageManager) >+{ >+ *aMessageManager = mTabChildGlobal; test for null: NS_ENSURE_ARG_POINTER(aMessageManager); Olli, other than this, i suppose this is fine, but I really want to see if we can clean up that Qi/Gi mess by adding something off of the window. >+ NS_IF_ADDREF(*aMessageManager); >+ >+ return NS_OK; >+} >+ >+ > TabChild::~TabChild() > { > destroyWidget(); >diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h >--- a/dom/ipc/TabChild.h >+++ b/dom/ipc/TabChild.h >@@ -167,6 +167,7 @@ > NS_DECL_NSIINTERFACEREQUESTOR > NS_DECL_NSIWINDOWPROVIDER > NS_DECL_NSIDIALOGCREATOR >+ NS_DECL_NSITABCHILD > > virtual bool RecvcreateWidget(const MagicWindowHandle& parentWidget); > virtual bool RecvloadURL(const nsCString& uri);
The rule of thumb that I've seen elsewhere is that outparams don't need arg validation.
we do use NS_ENSURE_ARG_POINTER a bunch for results.
(In reply to comment #6) > Every time I see this sort of mess, it makes me want to cry. Can we set it up > so that the window has the messageManager attribute? content window? No. nsIDocShell, maybe. And no need to check out param.
Hmm, I don't feel very strongly either way, but seems like at least putting it on the window makes it as convenient as possible. On the other hand leaving it in the nsITabChild seems to be the most 'logical' place. So either extreme sort of makes sense to me. But putting it on the window is kind of an odd compromise. But again, I don't feel strongly about it. Waiting to hear what you guys decide.
The second 'window' should be DocShell, oops.
Actually, perhaps docShell could have .tabChild attribute (readonly).
we need this for b1.
tracking-fennec: --- → ?
It still needs to be decided where this will go - on the DocShell or the TabChild.
i'd be happy to have what smaug mentioned in comment 12
I may have changed my mind. Since docshell may not "belong" to a tabChild, that attribute doesn't really make sense.
drats! if we put it on the tabchild, how does one get it from a random place without a window?
Where would you put it then? We're not adding a global content message manager in this bug.
tracking-fennec: ? → 2.0b1+
It isn't clear that we need this bug since we are fixing bug 585173. Alon/Smaug - do you see a need?
(In reply to comment #19) > It isn't clear that we need this bug since we are fixing bug 585173. > Alon/Smaug - do you see a need? I don't see a use for this right now.
Assignee: nobody → doug.turner
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: