Bug 1397128 P1 Make CacheReadStream ipdl struct contain an OptionalIPCStream. r=tt
☠☠ backed out by ee4c8b6d9a08 ☠ ☠
authorBen Kelly <ben@wanderview.com>
Fri, 15 Sep 2017 09:11:22 -0700
changeset 665628 3f1e68da9634ed661ff2b4b1b128c43bf3e831bb
parent 665508 0e14317d2f6c454e86549fe84d6067e1745a76c5
child 665629 15edfaab92f6d812256252e8efc6b8574cd7c381
push id80127
push userbmo:ato@sny.no
push dateFri, 15 Sep 2017 19:43:59 +0000
reviewerstt
bugs1397128
milestone57.0a1
Bug 1397128 P1 Make CacheReadStream ipdl struct contain an OptionalIPCStream. r=tt
dom/cache/CacheTypes.ipdlh
dom/cache/ReadStream.cpp
--- a/dom/cache/CacheTypes.ipdlh
+++ b/dom/cache/CacheTypes.ipdlh
@@ -31,17 +31,17 @@ struct CacheQueryParams
   bool cacheNameSet;
   nsString cacheName;
 };
 
 struct CacheReadStream
 {
   nsID id;
   nullable PCacheStreamControl control;
-  IPCStream stream;
+  OptionalIPCStream stream;
 };
 
 union CacheReadStreamOrVoid
 {
   void_t;
   CacheReadStream;
 };
 
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -240,17 +240,17 @@ ReadStream::Inner::Serialize(CacheReadSt
   aReadStreamOut->id() = mId;
   mControl->SerializeControl(aReadStreamOut);
 
   {
     MutexAutoLock lock(mMutex);
     mControl->SerializeStream(aReadStreamOut, mStream, aStreamCleanupList);
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(aReadStreamOut->stream().type() ==
+  MOZ_DIAGNOSTIC_ASSERT(aReadStreamOut->stream().get_IPCStream().type() ==
                         IPCStream::TInputStreamParamsWithFds);
 
   // We're passing ownership across the IPC barrier with the control, so
   // do not signal that the stream is closed here.
   Forget();
 }
 
 void
@@ -469,17 +469,17 @@ ReadStream::Create(const CacheReadStream
 {
   // The parameter may or may not be for a Cache created stream.  The way we
   // tell is by looking at the stream control actor.  If the actor exists,
   // then we know the Cache created it.
   if (!aReadStream.controlChild() && !aReadStream.controlParent()) {
     return nullptr;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(aReadStream.stream().type() ==
+  MOZ_DIAGNOSTIC_ASSERT(aReadStream.stream().get_IPCStream().type() ==
                         IPCStream::TInputStreamParamsWithFds);
 
   // Control is guaranteed to survive this method as ActorDestroy() cannot
   // run on this thread until we complete.
   StreamControl* control;
   if (aReadStream.controlChild()) {
     auto actor = static_cast<CacheStreamControlChild*>(aReadStream.controlChild());
     control = actor;