[UNIX] Simplify the file descriptor handling in SharedMemory
[WebKit-https.git] / Source / WebKit2 / Platform / SharedMemory.h
index 4db7452..e49fece 100644 (file)
@@ -69,17 +69,17 @@ public:
         static bool decode(IPC::ArgumentDecoder&, Handle&);
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-        IPC::Attachment releaseToAttachment() const;
-        void adoptFromAttachment(int fileDescriptor, size_t);
+        IPC::Attachment releaseAttachment() const;
+        void adoptAttachment(IPC::Attachment&&);
 #endif
     private:
         friend class SharedMemory;
 #if OS(DARWIN)
         mutable mach_port_t m_port;
+        size_t m_size;
 #elif USE(UNIX_DOMAIN_SOCKETS)
-        mutable int m_fileDescriptor;
+        mutable IPC::Attachment m_attachment;
 #endif
-        size_t m_size;
     };
 
     static RefPtr<SharedMemory> allocate(size_t);