diff --git a/widget/nsTransferable.cpp b/widget/nsTransferable.cpp index 4450836aaadc..08af4ed4e02d 100644 --- a/widget/nsTransferable.cpp +++ b/widget/nsTransferable.cpp @@ -56,10 +56,11 @@ DataStruct::~DataStruct() //------------------------------------------------------------------------- void -DataStruct::SetData ( nsISupports* aData, uint32_t aDataLen ) +DataStruct::SetData ( nsISupports* aData, uint32_t aDataLen, bool aIsPrivateData ) { // Now, check to see if we consider the data to be "too large" - if (aDataLen > kLargeDatasetSize) { + // as well as ensuring that private browsing mode is disabled + if (aDataLen > kLargeDatasetSize && !aIsPrivateData) { // if so, cache it to disk instead of memory if ( NS_SUCCEEDED(WriteCache(aData, aDataLen)) ) return; @@ -399,7 +400,7 @@ nsTransferable::SetTransferData(const char *aFlavor, nsISupports *aData, uint32_ for (size_t i = 0; i < mDataArray.Length(); ++i) { DataStruct& data = mDataArray.ElementAt(i); if ( data.GetFlavor().Equals(aFlavor) ) { - data.SetData ( aData, aDataLen ); + data.SetData ( aData, aDataLen, mPrivateData ); return NS_OK; } } @@ -415,7 +416,7 @@ nsTransferable::SetTransferData(const char *aFlavor, nsISupports *aData, uint32_ nsCOMPtr ConvertedData; uint32_t ConvertedLen; mFormatConv->Convert(aFlavor, aData, aDataLen, data.GetFlavor().get(), getter_AddRefs(ConvertedData), &ConvertedLen); - data.SetData(ConvertedData, ConvertedLen); + data.SetData(ConvertedData, ConvertedLen, mPrivateData); return NS_OK; } } diff --git a/widget/nsTransferable.h b/widget/nsTransferable.h index 4c34eabe24a8..da94ed27f66b 100644 --- a/widget/nsTransferable.h +++ b/widget/nsTransferable.h @@ -28,7 +28,7 @@ struct DataStruct ~DataStruct(); const nsCString& GetFlavor() const { return mFlavor; } - void SetData( nsISupports* inData, uint32_t inDataLen ); + void SetData( nsISupports* inData, uint32_t inDataLen, bool aIsPrivateData ); void GetData( nsISupports** outData, uint32_t *outDataLen ); already_AddRefed GetFileSpec(const char* aFileName); bool IsDataAvailable() const { return (mData && mDataLen > 0) || (!mData && mCacheFileName); } diff --git a/widget/tests/chrome.ini b/widget/tests/chrome.ini index 25a201e41a9f..37b932c858c9 100644 --- a/widget/tests/chrome.ini +++ b/widget/tests/chrome.ini @@ -83,3 +83,6 @@ skip-if = toolkit != "windows" [test_mouse_scroll.xul] skip-if = toolkit != "windows" support-files = window_mouse_scroll_win.html + +# Privacy relevant +[test_bug1123480.xul] diff --git a/widget/tests/test_bug1123480.xul b/widget/tests/test_bug1123480.xul new file mode 100644 index 000000000000..56ce0ed102e4 --- /dev/null +++ b/widget/tests/test_bug1123480.xul @@ -0,0 +1,79 @@ + + + + + + nsTransferable PBM Overflow Selection Test + + + + + Mozilla Bug 1123480 + +