Title: [156353] trunk/Source
Revision
156353
Author
ander...@apple.com
Date
2013-09-24 12:59:12 -0700 (Tue, 24 Sep 2013)

Log Message

Remove encoder create functions
https://bugs.webkit.org/show_bug.cgi?id=121853

Reviewed by Sam Weinig.

Source/WebKit2:

* Platform/CoreIPC/ArgumentEncoder.cpp:
* Platform/CoreIPC/ArgumentEncoder.h:
* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::dispatchWorkQueueMessageReceiverMessage):
(CoreIPC::Connection::createSyncMessageEncoder):
(CoreIPC::Connection::dispatchSyncMessage):
* Platform/CoreIPC/Connection.h:
(CoreIPC::Connection::send):
* Platform/CoreIPC/MessageEncoder.cpp:
(CoreIPC::MessageEncoder::setIsSyncMessage):
* Platform/CoreIPC/MessageEncoder.h:
* Platform/CoreIPC/MessageSender.h:
(CoreIPC::MessageSender::send):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC::Connection::open):
* Shared/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::send):
* Shared/WebConnection.cpp:
(WebKit::WebConnection::postMessage):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::postMessageToInjectedBundle):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::postMessage):
* WebProcess/WebPage/EncoderAdapter.cpp:
(WebKit::EncoderAdapter::EncoderAdapter):
(WebKit::EncoderAdapter::dataReference):
(WebKit::EncoderAdapter::encodeBytes):
(WebKit::EncoderAdapter::encodeBool):
(WebKit::EncoderAdapter::encodeUInt16):
(WebKit::EncoderAdapter::encodeUInt32):
(WebKit::EncoderAdapter::encodeUInt64):
(WebKit::EncoderAdapter::encodeInt32):
(WebKit::EncoderAdapter::encodeInt64):
(WebKit::EncoderAdapter::encodeFloat):
(WebKit::EncoderAdapter::encodeDouble):
(WebKit::EncoderAdapter::encodeString):
* WebProcess/WebPage/EncoderAdapter.h:

Source/WTF:

Add a variadic version of createOwned.

* wtf/OwnPtr.h:
(WTF::createOwned):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (156352 => 156353)


--- trunk/Source/WTF/ChangeLog	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WTF/ChangeLog	2013-09-24 19:59:12 UTC (rev 156353)
@@ -1,3 +1,15 @@
+2013-09-24  Anders Carlsson  <ander...@apple.com>
+
+        Remove encoder create functions
+        https://bugs.webkit.org/show_bug.cgi?id=121853
+
+        Reviewed by Sam Weinig.
+
+        Add a variadic version of createOwned.
+
+        * wtf/OwnPtr.h:
+        (WTF::createOwned):
+
 2013-09-24  Mark Rowe  <mr...@apple.com>
 
         <rdar://problem/14971518> WebKit should build against the Xcode default toolchain when targeting OS X 10.8

Modified: trunk/Source/WTF/wtf/OwnPtr.h (156352 => 156353)


--- trunk/Source/WTF/wtf/OwnPtr.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WTF/wtf/OwnPtr.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -44,14 +44,6 @@
         // See comment in PassOwnPtr.h for why this takes a const reference.
         template<typename U> OwnPtr(const PassOwnPtr<U>& o);
 
-#if !COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
-        // This copy constructor is used implicitly by gcc when it generates
-        // transients for assigning a PassOwnPtr<T> object to a stack-allocated
-        // OwnPtr<T> object. It should never be called explicitly and gcc
-        // should optimize away the constructor when generating code.
-        OwnPtr(const OwnPtr<ValueType>&);
-#endif
-
         ~OwnPtr() { deleteOwnedPtr(m_ptr); }
 
         PtrType get() const { return m_ptr; }
@@ -73,26 +65,23 @@
         OwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
         template<typename U> OwnPtr& operator=(const PassOwnPtr<U>&);
 
-#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
         OwnPtr(OwnPtr&&);
         template<typename U> OwnPtr(OwnPtr<U>&&);
 
         OwnPtr& operator=(OwnPtr&&);
         template<typename U> OwnPtr& operator=(OwnPtr<U>&&);
-#endif
 
         void swap(OwnPtr& o) { std::swap(m_ptr, o.m_ptr); }
 
     private:
         explicit OwnPtr(PtrType ptr) : m_ptr(ptr) { }
 
+#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES)
+        template<typename U, typename... Args> friend OwnPtr<U> createOwned(Args&&... args);
+#else
         template<typename U> friend OwnPtr<U> createOwned();
         template<typename U, typename A1> friend OwnPtr<U> createOwned(A1&&);
         template<typename U, typename A1, typename A2> friend OwnPtr<U> createOwned(A1&&, A2&&);
-
-#if !COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
-        // If rvalue references are supported, noncopyable takes care of this.
-        OwnPtr& operator=(const OwnPtr&);
 #endif
 
         // We should never have two OwnPtrs for the same underlying object (otherwise we'll get
@@ -205,6 +194,13 @@
         return p.get();
     }
 
+#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES)
+template<typename T, typename... Args>
+inline OwnPtr<T> createOwned(Args&&... args)
+{
+    return OwnPtr<T>(new T(std::forward<Args>(args)...));
+}
+#else
 template<typename T>
 inline OwnPtr<T> createOwned()
 {
@@ -222,6 +218,7 @@
 {
     return OwnPtr<T>(new T(std::forward<A1>(a1), std::forward<A2>(a2)));
 }
+#endif
 
 } // namespace WTF
 

Modified: trunk/Source/WebKit2/ChangeLog (156352 => 156353)


--- trunk/Source/WebKit2/ChangeLog	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/ChangeLog	2013-09-24 19:59:12 UTC (rev 156353)
@@ -1,3 +1,49 @@
+2013-09-24  Anders Carlsson  <ander...@apple.com>
+
+        Remove encoder create functions
+        https://bugs.webkit.org/show_bug.cgi?id=121853
+
+        Reviewed by Sam Weinig.
+
+        * Platform/CoreIPC/ArgumentEncoder.cpp:
+        * Platform/CoreIPC/ArgumentEncoder.h:
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::dispatchWorkQueueMessageReceiverMessage):
+        (CoreIPC::Connection::createSyncMessageEncoder):
+        (CoreIPC::Connection::dispatchSyncMessage):
+        * Platform/CoreIPC/Connection.h:
+        (CoreIPC::Connection::send):
+        * Platform/CoreIPC/MessageEncoder.cpp:
+        (CoreIPC::MessageEncoder::setIsSyncMessage):
+        * Platform/CoreIPC/MessageEncoder.h:
+        * Platform/CoreIPC/MessageSender.h:
+        (CoreIPC::MessageSender::send):
+        * Platform/CoreIPC/mac/ConnectionMac.cpp:
+        (CoreIPC::Connection::open):
+        * Shared/ChildProcessProxy.h:
+        (WebKit::ChildProcessProxy::send):
+        * Shared/WebConnection.cpp:
+        (WebKit::WebConnection::postMessage):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::createNewWebProcess):
+        (WebKit::WebContext::postMessageToInjectedBundle):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::postMessage):
+        * WebProcess/WebPage/EncoderAdapter.cpp:
+        (WebKit::EncoderAdapter::EncoderAdapter):
+        (WebKit::EncoderAdapter::dataReference):
+        (WebKit::EncoderAdapter::encodeBytes):
+        (WebKit::EncoderAdapter::encodeBool):
+        (WebKit::EncoderAdapter::encodeUInt16):
+        (WebKit::EncoderAdapter::encodeUInt32):
+        (WebKit::EncoderAdapter::encodeUInt64):
+        (WebKit::EncoderAdapter::encodeInt32):
+        (WebKit::EncoderAdapter::encodeInt64):
+        (WebKit::EncoderAdapter::encodeFloat):
+        (WebKit::EncoderAdapter::encodeDouble):
+        (WebKit::EncoderAdapter::encodeString):
+        * WebProcess/WebPage/EncoderAdapter.h:
+
 2013-09-24  Enrica Casucci  <enr...@apple.com>
 
         Upstream changes to Pasteboard implementation for iOS.

Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -55,11 +55,6 @@
 #endif
 }
 
-PassOwnPtr<ArgumentEncoder> ArgumentEncoder::create()
-{
-    return adoptPtr(new ArgumentEncoder);
-}
-
 ArgumentEncoder::ArgumentEncoder()
     : m_buffer(m_inlineBuffer)
     , m_bufferPointer(m_inlineBuffer)

Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -38,7 +38,7 @@
 
 class ArgumentEncoder {
 public:
-    static PassOwnPtr<ArgumentEncoder> create();
+    ArgumentEncoder();
     virtual ~ArgumentEncoder();
 
     void encodeFixedLengthData(const uint8_t*, size_t, unsigned alignment);
@@ -68,9 +68,6 @@
     void addAttachment(const Attachment&);
     Vector<Attachment> releaseAttachments();
 
-protected:
-    ArgumentEncoder();
-
 private:
     void encode(bool);
     void encode(uint8_t);

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -300,7 +300,7 @@
         return;
     }
 
-    OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "SyncMessageReply", syncRequestID);
+    auto replyEncoder = createOwned<MessageEncoder>("IPC", "SyncMessageReply", syncRequestID);
 
     // Hand off both the decoder and encoder to the work queue message receiver.
     workQueueMessageReceiver->didReceiveSyncMessage(this, *decoder, replyEncoder);
@@ -342,7 +342,7 @@
 
 OwnPtr<MessageEncoder> Connection::createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID)
 {
-    OwnPtr<MessageEncoder> encoder = MessageEncoder::create(messageReceiverName, messageName, destinationID);
+    auto encoder = createOwned<MessageEncoder>(messageReceiverName, messageName, destinationID);
     encoder->setIsSyncMessage(true);
 
     // Encode the sync request ID.
@@ -743,7 +743,7 @@
         return;
     }
 
-    OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "SyncMessageReply", syncRequestID);
+    auto replyEncoder = createOwned<MessageEncoder>("IPC", "SyncMessageReply", syncRequestID);
 
     // Hand off both the decoder and encoder to the client.
     m_client->didReceiveSyncMessage(this, decoder, replyEncoder);

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.h (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -349,7 +349,7 @@
 {
     COMPILE_ASSERT(!T::isSync, AsyncMessageExpected);
 
-    OwnPtr<MessageEncoder> encoder = MessageEncoder::create(T::receiverName(), T::name(), destinationID);
+    auto encoder = createOwned<MessageEncoder>(T::receiverName(), T::name(), destinationID);
     encoder->encode(message);
     
     return sendMessage(encoder.release(), messageSendFlags);

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.cpp (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -34,11 +34,6 @@
 
 static uint8_t defaultMessageFlags = 0;
 
-PassOwnPtr<MessageEncoder> MessageEncoder::create(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID)
-{
-    return adoptPtr(new MessageEncoder(messageReceiverName, messageName, destinationID));
-}
-
 MessageEncoder::MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID)
 {
     ASSERT(!messageReceiverName.isEmpty());
@@ -59,7 +54,6 @@
         *buffer() |= SyncMessage;
     else
         *buffer() &= ~SyncMessage;
-
 }
 
 void MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply(bool shouldDispatchMessageWhenWaitingForSyncReply)

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.h (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageEncoder.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -35,15 +35,11 @@
 
 class MessageEncoder : public ArgumentEncoder {
 public:
-    static PassOwnPtr<MessageEncoder> create(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID);
+    MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID);
     virtual ~MessageEncoder();
 
     void setIsSyncMessage(bool);
     void setShouldDispatchMessageWhenWaitingForSyncReply(bool);
-
-private:
-    MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID);
-
 };
 
 } // namespace CoreIPC

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageSender.h (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageSender.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageSender.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -43,7 +43,7 @@
     template<typename U> bool send(const U& message, uint64_t destinationID)
     {
         COMPILE_ASSERT(!U::isSync, AsyncMessageExpected);
-        OwnPtr<MessageEncoder> encoder = MessageEncoder::create(U::receiverName(), U::name(), destinationID);
+        auto encoder = createOwned<MessageEncoder>(U::receiverName(), U::name(), destinationID);
         encoder->encode(message);
         
         return sendMessage(encoder.release());

Modified: trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp (156352 => 156353)


--- trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -141,7 +141,7 @@
         m_isConnected = true;
         
         // Send the initialize message, which contains a send right for the server to use.
-        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "InitializeConnection", 0);
+        auto encoder = createOwned<MessageEncoder>("IPC", "InitializeConnection", 0);
         encoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
 
         sendMessage(encoder.release());
@@ -159,7 +159,7 @@
     if (m_exceptionPort) {
         m_exceptionPortDataAvailableSource = createDataAvailableSource(m_exceptionPort, m_connectionQueue.get(), bind(&Connection::exceptionSourceEventHandler, this));
 
-        OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "SetExceptionPort", 0);
+        auto encoder = createOwned<MessageEncoder>("IPC", "SetExceptionPort", 0);
         encoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
 
         sendMessage(encoder.release());

Modified: trunk/Source/WebKit2/Shared/ChildProcessProxy.h (156352 => 156353)


--- trunk/Source/WebKit2/Shared/ChildProcessProxy.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Shared/ChildProcessProxy.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -94,7 +94,7 @@
 {
     COMPILE_ASSERT(!T::isSync, AsyncMessageExpected);
 
-    OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create(T::receiverName(), T::name(), destinationID);
+    auto encoder = createOwned<CoreIPC::MessageEncoder>(T::receiverName(), T::name(), destinationID);
     encoder->encode(message);
 
     return sendMessage(encoder.release(), messageSendFlags);

Modified: trunk/Source/WebKit2/Shared/WebConnection.cpp (156352 => 156353)


--- trunk/Source/WebKit2/Shared/WebConnection.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/Shared/WebConnection.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -51,7 +51,7 @@
     if (!hasValidConnection())
         return;
 
-    OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create(Messages::WebConnection::HandleMessage::receiverName(), Messages::WebConnection::HandleMessage::name(), 0);
+    auto encoder = createOwned<CoreIPC::MessageEncoder>(Messages::WebConnection::HandleMessage::receiverName(), Messages::WebConnection::HandleMessage::name(), 0);
     encoder->encode(messageName);
     encodeMessageBody(*encoder, messageBody);
 

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (156352 => 156353)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -558,11 +558,11 @@
         for (size_t i = 0; i != m_messagesToInjectedBundlePostedToEmptyContext.size(); ++i) {
             pair<String, RefPtr<APIObject>>& message = m_messagesToInjectedBundlePostedToEmptyContext[i];
 
-            OwnPtr<CoreIPC::ArgumentEncoder> messageData = CoreIPC::ArgumentEncoder::create();
+            CoreIPC::ArgumentEncoder messageData;
 
-            messageData->encode(message.first);
-            messageData->encode(WebContextUserMessageEncoder(message.second.get()));
-            process->send(Messages::WebProcess::PostInjectedBundleMessage(CoreIPC::DataReference(messageData->buffer(), messageData->bufferSize())), 0);
+            messageData.encode(message.first);
+            messageData.encode(WebContextUserMessageEncoder(message.second.get()));
+            process->send(Messages::WebProcess::PostInjectedBundleMessage(CoreIPC::DataReference(messageData.buffer(), messageData.bufferSize())), 0);
         }
         m_messagesToInjectedBundlePostedToEmptyContext.clear();
     } else
@@ -744,13 +744,12 @@
 
     // FIXME: Return early if the message body contains any references to WKPageRefs/WKFrameRefs etc. since they're local to a process.
 
-    OwnPtr<CoreIPC::ArgumentEncoder> messageData = CoreIPC::ArgumentEncoder::create();
-    messageData->encode(messageName);
-    messageData->encode(WebContextUserMessageEncoder(messageBody));
+    CoreIPC::ArgumentEncoder messageData;
+    messageData.encode(messageName);
+    messageData.encode(WebContextUserMessageEncoder(messageBody));
 
-    for (size_t i = 0; i < m_processes.size(); ++i) {
-        m_processes[i]->send(Messages::WebProcess::PostInjectedBundleMessage(CoreIPC::DataReference(messageData->buffer(), messageData->bufferSize())), 0);
-    }
+    for (size_t i = 0; i < m_processes.size(); ++i)
+        m_processes[i]->send(Messages::WebProcess::PostInjectedBundleMessage(CoreIPC::DataReference(messageData.buffer(), messageData.bufferSize())), 0);
 }
 
 // InjectedBundle client

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (156352 => 156353)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -101,7 +101,7 @@
 
 void InjectedBundle::postMessage(const String& messageName, APIObject* messageBody)
 {
-    OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create(WebContextLegacyMessages::messageReceiverName(), WebContextLegacyMessages::postMessageMessageName(), 0);
+    auto encoder = createOwned<CoreIPC::MessageEncoder>(WebContextLegacyMessages::messageReceiverName(), WebContextLegacyMessages::postMessageMessageName(), 0);
     encoder->encode(messageName);
     encoder->encode(InjectedBundleUserMessageEncoder(messageBody));
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp (156352 => 156353)


--- trunk/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp	2013-09-24 19:59:12 UTC (rev 156353)
@@ -33,61 +33,60 @@
 namespace WebKit {
 
 EncoderAdapter::EncoderAdapter()
-    : m_encoder(CoreIPC::ArgumentEncoder::create())
 {
     // Keep format compatibility by decoding an unused uint64_t value
     // that used to be encoded by the argument encoder.
-    *m_encoder << static_cast<uint64_t>(0);
+    m_encoder << static_cast<uint64_t>(0);
 }
 
 CoreIPC::DataReference EncoderAdapter::dataReference() const
 {
-    return CoreIPC::DataReference(m_encoder->buffer(), m_encoder->bufferSize());
+    return CoreIPC::DataReference(m_encoder.buffer(), m_encoder.bufferSize());
 }
 
 void EncoderAdapter::encodeBytes(const uint8_t* bytes, size_t size)
 {
-    *m_encoder << CoreIPC::DataReference(bytes, size);
+    m_encoder << CoreIPC::DataReference(bytes, size);
 }
 
 void EncoderAdapter::encodeBool(bool value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeUInt16(uint16_t value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeUInt32(uint32_t value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeUInt64(uint64_t value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeInt32(int32_t value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeInt64(int64_t value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeFloat(float value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeDouble(double value)
 {
-    *m_encoder << value;
+    m_encoder << value;
 }
 
 void EncoderAdapter::encodeString(const String& value)
@@ -100,16 +99,16 @@
 
     // Special case the null string.
     if (value.isNull()) {
-        *m_encoder << std::numeric_limits<uint32_t>::max();
+        m_encoder << std::numeric_limits<uint32_t>::max();
         return;
     }
 
     uint32_t length = value.length();
-    *m_encoder << length;
+    m_encoder << length;
 
     uint64_t lengthInBytes = length * sizeof(UChar);
-    *m_encoder << lengthInBytes;
-    m_encoder->encodeFixedLengthData(reinterpret_cast<const uint8_t*>(value.characters()), length * sizeof(UChar), __alignof(UChar)); 
+    m_encoder << lengthInBytes;
+    m_encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(value.characters()), length * sizeof(UChar), __alignof(UChar));
 }
 
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h (156352 => 156353)


--- trunk/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h	2013-09-24 19:43:25 UTC (rev 156352)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h	2013-09-24 19:59:12 UTC (rev 156353)
@@ -26,9 +26,9 @@
 #ifndef EncoderAdapter_h
 #define EncoderAdapter_h
 
+#include "ArgumentEncoder.h"
 #include <wtf/Encoder.h>
 #include <wtf/Forward.h>
-#include <wtf/OwnPtr.h>
 
 namespace CoreIPC {
     class ArgumentEncoder;
@@ -55,7 +55,7 @@
     virtual void encodeDouble(double);
     virtual void encodeString(const String&);
 
-    OwnPtr<CoreIPC::ArgumentEncoder> m_encoder;
+    CoreIPC::ArgumentEncoder m_encoder;
 };
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to