https://bugs.webkit.org/show_bug.cgi?id=76587
<rdar://problem/9739135>
Reviewed by Sam Weinig.
* UIProcess/cf/WebPageProxyCF.cpp:
Change CurrentSessionStateDataVersion back to 2.
* WebProcess/WebPage/DecoderAdapter.cpp:
(WebKit::DecoderAdapter::decodeString):
* WebProcess/WebPage/EncoderAdapter.cpp:
(WebKit::EncoderAdapter::encodeString):
Backport the CoreIPC string encoding and decoding functions that were in place prior to r88886.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105339
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-18 Anders Carlsson <andersca@apple.com>
+
+ REGRESSION (r88886): Tabs restore blank when running Safari with a nightly build for the first time
+ https://bugs.webkit.org/show_bug.cgi?id=76587
+ <rdar://problem/9739135>
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/cf/WebPageProxyCF.cpp:
+ Change CurrentSessionStateDataVersion back to 2.
+
+ * WebProcess/WebPage/DecoderAdapter.cpp:
+ (WebKit::DecoderAdapter::decodeString):
+ * WebProcess/WebPage/EncoderAdapter.cpp:
+ (WebKit::EncoderAdapter::encodeString):
+ Backport the CoreIPC string encoding and decoding functions that were in place prior to r88886.
+
2012-01-17 Alexey Proskuryakov <ap@apple.com>
[Mac] Add a flag telling plug-in if it can enter sandbox
DEFINE_STATIC_GETTER(CFStringRef, SessionHistoryKey, (CFSTR("SessionHistory")));
DEFINE_STATIC_GETTER(CFStringRef, ProvisionalURLKey, (CFSTR("ProvisionalURL")));
-static const UInt32 CurrentSessionStateDataVersion = 3;
+static const UInt32 CurrentSessionStateDataVersion = 2;
PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback filter, void* context) const
{
#include "DataReference.h"
#include "WebCoreArgumentCoders.h"
+#include <wtf/text/WTFString.h>
namespace WebKit {
bool DecoderAdapter::decodeString(String& value)
{
- return m_decoder.decode(value);
+ // This mimics the CoreIPC binary encoding of Strings prior to r88886.
+ // Whenever the CoreIPC binary encoding changes, we'll have to "undo" the changes here.
+ // FIXME: We shouldn't use the CoreIPC binary encoding format for history,
+ // and we should come up with a migration strategy so we can actually bump the version number
+ // without breaking encoding/decoding of the history tree.
+
+ uint32_t length;
+ if (!m_decoder.decode(length))
+ return false;
+
+ if (length == std::numeric_limits<uint32_t>::max()) {
+ // This is the null string.
+ value = String();
+ return true;
+ }
+
+ uint64_t lengthInBytes;
+ if (!m_decoder.decode(lengthInBytes))
+ return false;
+
+ if (lengthInBytes % sizeof(UChar) || lengthInBytes / sizeof(UChar) != length) {
+ m_decoder.markInvalid();
+ return false;
+ }
+
+ if (!m_decoder.bufferIsLargeEnoughToContain<UChar>(length)) {
+ m_decoder.markInvalid();
+ return false;
+ }
+
+ UChar* buffer;
+ String string = String::createUninitialized(length, buffer);
+ if (!m_decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length * sizeof(UChar), __alignof(UChar)))
+ return false;
+
+ value = string;
+ return true;
}
}
#include "DataReference.h"
#include "WebCoreArgumentCoders.h"
+#include <wtf/text/WTFString.h>
namespace WebKit {
void EncoderAdapter::encodeString(const String& value)
{
- m_encoder->encode(value);
+ // This mimics the CoreIPC binary encoding of Strings prior to r88886.
+ // Whenever the CoreIPC binary encoding changes, we'll have to "undo" the changes here.
+ // FIXME: We shouldn't use the CoreIPC binary encoding format for history,
+ // and we should come up with a migration strategy so we can actually bump the version number
+ // without breaking encoding/decoding of the history tree.
+
+ // Special case the null string.
+ if (value.isNull()) {
+ m_encoder->encodeUInt32(std::numeric_limits<uint32_t>::max());
+ return;
+ }
+
+ uint32_t length = value.length();
+ m_encoder->encode(length);
+
+ uint64_t lengthInBytes = length * sizeof(UChar);
+ m_encoder->encode(lengthInBytes);
+ m_encoder->encodeFixedLengthData(reinterpret_cast<const uint8_t*>(value.characters()), length * sizeof(UChar), __alignof(UChar));
}
}