The default bug view has changed. See this FAQ.

Status

()

Core
IPC
--
enhancement
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

unspecified
mozilla7
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-bs)

Attachments

(1 attachment, 2 obsolete attachments)

Created attachment 424275 [details] [diff] [review]
Patch

It would be nice to serialize nsID.
Attachment #424275 - Flags: review?(jones.chris.g)
Attachment #424275 - Flags: review?(bent.mozilla)
Just to make the rationale for doing this slightly more clear, in Bug 441197 we're going to need to pass a nsID to child processes so that their audio gets combined with the parent process's in the Vista audio system.
Comment on attachment 424275 [details] [diff] [review]
Patch

>diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h
>--- a/ipc/glue/IPCMessageUtils.h
>+++ b/ipc/glue/IPCMessageUtils.h
>@@ -39,16 +39,17 @@
>+template<>
>+struct ParamTraits<nsID>
>+{
>+  typedef nsID paramType;
>+
>+  static void Write(Message* aMsg, const paramType& aParam)
>+  {
>+    WriteParam(aMsg, aParam.m0);
>+    WriteParam(aMsg, aParam.m1);
>+    WriteParam(aMsg, aParam.m2);
>+    for (int i = 0; i < 8; i++) {
>+      WriteParam(aMsg, aParam.m3[i]);
>+    }
>+  }
>+

Nit: |i < NS_ARRAY_LENGTH(aParam.m3)|.

>+  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
>+  {
>+    if(!ReadParam(aMsg, aIter, &(aResult->m0)) ||
>+       !ReadParam(aMsg, aIter, &(aResult->m1)) ||
>+       !ReadParam(aMsg, aIter, &(aResult->m2)))
>+      return false;
>+
>+    for (int i = 0; i < 8; i++)
>+      if (!ReadParam(aMsg, aIter, &(aResult->m3[i])))
>+        return false;
>+
>+    return true;
>+  }
>+

|i < NS_ARRAY_LENGTH(aResult->m3)|.

>+  static void Log(const paramType& aParam, std::wstring* aLog)
>+  {
>+    aLog->append(L"{");
>+    aLog->append(StringPrintf(L"%8.8X-%4.4X-%4.4X-",
>+                              aParam.m0,
>+                              aParam.m1,
>+                              aParam.m2));
>+    for (int i = 0; i < 8; i++)
>+      aLog->append(StringPrintf(L"%2.2X", aParam.m3[i]));
>+    aLog->append(L"}");
>+  }
>+};
>+

Also here.
Attachment #424275 - Flags: review?(jones.chris.g) → review+
Comment on attachment 424275 [details] [diff] [review]
Patch

Yeah, r+ with cjones' comments addressed.
Attachment #424275 - Flags: review?(bent.mozilla) → review+
Created attachment 427977 [details] [diff] [review]
Patch w/nits

w/nits
Attachment #424275 - Attachment is obsolete: true
Attachment #427977 - Flags: review+
Created attachment 443670 [details] [diff] [review]
Patch

Unbitrotting and carrying review forward.  I've got a patch for the bug I wrote this for so I'll probably check this in fairly soon.
Attachment #427977 - Attachment is obsolete: true
Attachment #443670 - Flags: review+
http://hg.mozilla.org/projects/build-system/rev/87c28ff05bad
Whiteboard: fixed-in-bs
http://hg.mozilla.org/mozilla-central/rev/87c28ff05bad
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.