Changeset 214115 in webkit
- Timestamp:
- Mar 17, 2017, 1:42:50 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r214114 r214115 1 2017-03-17 Alex Christensen <achristensen@webkit.org> 2 3 Add encoder for SocketStreamError 4 https://bugs.webkit.org/show_bug.cgi?id=169831 5 6 Reviewed by Andy Estes. 7 8 This isn't used yet, but we'll soon need to send these across IPC. 9 10 * platform/network/SocketStreamError.h: 11 (WebCore::SocketStreamError::encode): 12 (WebCore::SocketStreamError::decode): 13 1 14 2017-03-17 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebCore/platform/network/SocketStreamError.h
r204501 r214115 38 38 class SocketStreamError { 39 39 public: 40 SocketStreamError() 41 { 42 } 40 SocketStreamError() = default; 43 41 44 42 explicit SocketStreamError(int errorCode) … … 61 59 const String& localizedDescription() const { return m_localizedDescription; } 62 60 61 template<class Encoder> void encode(Encoder&) const; 62 template<class Decoder> static bool decode(Decoder&, SocketStreamError&); 63 63 64 private: 64 65 int m_errorCode { 0 }; … … 68 69 }; 69 70 71 template<class Encoder> 72 void SocketStreamError::encode(Encoder& encoder) const 73 { 74 encoder << m_isNull; 75 if (m_isNull) 76 return; 77 encoder << m_errorCode; 78 encoder << m_failingURL; 79 encoder << m_localizedDescription; 70 80 } 81 82 template<class Decoder> 83 bool SocketStreamError::decode(Decoder& decoder, SocketStreamError& error) 84 { 85 if (!decoder.decode(error.m_isNull)) 86 return false; 87 if (error.m_isNull) 88 return true; 89 if (!decoder.decode(error.m_errorCode)) 90 return false; 91 if (!decoder.decode(error.m_failingURL)) 92 return false; 93 if (!decoder.decode(error.m_localizedDescription)) 94 return false; 95 return true; 96 } 97 98 }
Note:
See TracChangeset
for help on using the changeset viewer.