Changeset 141482 in webkit
- Timestamp:
- Jan 31, 2013 2:00:22 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r141477 r141482 1 2013-01-31 Anders Carlsson <andersca@apple.com> 2 3 Use a Vector for IPC attachments 4 https://bugs.webkit.org/show_bug.cgi?id=108517 5 6 Reviewed by Sam Weinig. 7 8 * Platform/CoreIPC/ArgumentDecoder.cpp: 9 (CoreIPC::ArgumentDecoder::create): 10 (CoreIPC::ArgumentDecoder::ArgumentDecoder): 11 (CoreIPC::ArgumentDecoder::removeAttachment): 12 * Platform/CoreIPC/ArgumentDecoder.h: 13 (ArgumentDecoder): 14 * Platform/CoreIPC/Connection.h: 15 * Platform/CoreIPC/MessageDecoder.cpp: 16 (CoreIPC::MessageDecoder::create): 17 (CoreIPC::MessageDecoder::MessageDecoder): 18 * Platform/CoreIPC/MessageDecoder.h: 19 (MessageDecoder): 20 * Platform/CoreIPC/mac/ConnectionMac.cpp: 21 (CoreIPC::createMessageDecoder): 22 1 23 2013-01-31 Joseph Pecoraro <pecoraro@apple.com> 2 24 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp
r141209 r141482 34 34 PassOwnPtr<ArgumentDecoder> ArgumentDecoder::create(const uint8_t* buffer, size_t bufferSize) 35 35 { 36 Deque<Attachment> attachments;36 Vector<Attachment> attachments; 37 37 return adoptPtr(new ArgumentDecoder(buffer, bufferSize, attachments)); 38 38 } 39 39 40 ArgumentDecoder::ArgumentDecoder(const uint8_t* buffer, size_t bufferSize, Deque<Attachment>& attachments)40 ArgumentDecoder::ArgumentDecoder(const uint8_t* buffer, size_t bufferSize, Vector<Attachment>& attachments) 41 41 { 42 42 initialize(buffer, bufferSize); … … 225 225 return false; 226 226 227 attachment = m_attachments.takeFirst(); 228 return true; 229 } 230 231 #ifndef NDEBUG 232 void ArgumentDecoder::debug() 233 { 234 printf("ArgumentDecoder::debug()\n"); 235 printf("Number of Attachments: %d\n", (int)m_attachments.size()); 236 printf("Size of buffer: %d\n", (int)(m_bufferEnd - m_buffer)); 237 } 238 #endif 227 attachment = m_attachments.last(); 228 m_attachments.removeLast(); 229 return true; 230 } 239 231 240 232 } // namespace CoreIPC -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
r141209 r141482 29 29 #include "ArgumentCoder.h" 30 30 #include "Attachment.h" 31 #include <wtf/Deque.h>32 31 #include <wtf/PassOwnPtr.h> 33 32 #include <wtf/TypeTraits.h> … … 94 93 bool removeAttachment(Attachment&); 95 94 96 #ifndef NDEBUG97 void debug();98 #endif99 100 95 protected: 101 ArgumentDecoder(const uint8_t* buffer, size_t bufferSize, Deque<Attachment>&);96 ArgumentDecoder(const uint8_t* buffer, size_t bufferSize, Vector<Attachment>&); 102 97 103 98 void initialize(const uint8_t* buffer, size_t bufferSize); … … 116 111 uint8_t* m_bufferEnd; 117 112 118 Deque<Attachment> m_attachments;113 Vector<Attachment> m_attachments; 119 114 }; 120 115 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.h
r141472 r141482 34 34 #include "MessageReceiver.h" 35 35 #include "WorkQueue.h" 36 #include <wtf/Deque.h> 36 37 #include <wtf/PassRefPtr.h> 37 38 #include <wtf/OwnPtr.h> -
trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.cpp
r141209 r141482 36 36 PassOwnPtr<MessageDecoder> MessageDecoder::create(const DataReference& buffer) 37 37 { 38 Deque<Attachment> attachments;38 Vector<Attachment> attachments; 39 39 return adoptPtr(new MessageDecoder(buffer, attachments)); 40 40 } 41 41 42 PassOwnPtr<MessageDecoder> MessageDecoder::create(const DataReference& buffer, Deque<Attachment>& attachments)42 PassOwnPtr<MessageDecoder> MessageDecoder::create(const DataReference& buffer, Vector<Attachment>& attachments) 43 43 { 44 44 return adoptPtr(new MessageDecoder(buffer, attachments)); … … 49 49 } 50 50 51 MessageDecoder::MessageDecoder(const DataReference& buffer, Deque<Attachment>& attachments)51 MessageDecoder::MessageDecoder(const DataReference& buffer, Vector<Attachment>& attachments) 52 52 : ArgumentDecoder(buffer.data(), buffer.size(), attachments) 53 53 { -
trunk/Source/WebKit2/Platform/CoreIPC/MessageDecoder.h
r141165 r141482 37 37 public: 38 38 static PassOwnPtr<MessageDecoder> create(const DataReference& buffer); 39 static PassOwnPtr<MessageDecoder> create(const DataReference& buffer, Deque<Attachment>&);39 static PassOwnPtr<MessageDecoder> create(const DataReference& buffer, Vector<Attachment>&); 40 40 virtual ~MessageDecoder(); 41 41 … … 47 47 48 48 private: 49 MessageDecoder(const DataReference& buffer, Deque<Attachment>&);49 MessageDecoder(const DataReference& buffer, Vector<Attachment>&); 50 50 51 51 uint8_t m_messageFlags; -
trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp
r141472 r141482 300 300 ASSERT(numDescriptors); 301 301 302 // Build attachment list303 Deque<Attachment> attachments;304 302 uint8_t* descriptorData = reinterpret_cast<uint8_t*>(body + 1); 305 303 … … 309 307 --numDescriptors; 310 308 309 // Build attachment list 310 Vector<Attachment> attachments(numDescriptors); 311 311 312 for (mach_msg_size_t i = 0; i < numDescriptors; ++i) { 312 313 mach_msg_descriptor_t* descriptor = reinterpret_cast<mach_msg_descriptor_t*>(descriptorData); … … 314 315 switch (descriptor->type.type) { 315 316 case MACH_MSG_PORT_DESCRIPTOR: 316 attachments .append(Attachment(descriptor->port.name, descriptor->port.disposition));317 attachments[numDescriptors - i - 1] = Attachment(descriptor->port.name, descriptor->port.disposition); 317 318 descriptorData += sizeof(mach_msg_port_descriptor_t); 318 319 break; 319 320 case MACH_MSG_OOL_DESCRIPTOR: 320 attachments.append(Attachment(descriptor->out_of_line.address, descriptor->out_of_line.size, 321 descriptor->out_of_line.copy, descriptor->out_of_line.deallocate)); 321 attachments[numDescriptors - i - 1] = Attachment(descriptor->out_of_line.address, descriptor->out_of_line.size, descriptor->out_of_line.copy, descriptor->out_of_line.deallocate); 322 322 descriptorData += sizeof(mach_msg_ool_descriptor_t); 323 323 break;
Note: See TracChangeset
for help on using the changeset viewer.