widget/xpwidgets/nsTransferable.cpp

branch
TOR_BUG_9701
changeset 8
97036ab72558
parent 3
141e0f1194b1
child 9
a63d609f5ebe
equal deleted inserted replaced
1:5551497ed54d 2:cf1e223d6ad3
12 12
13 */ 13 */
14 14
15 15
16 #include "nsTransferable.h" 16 #include "nsTransferable.h"
17 #include "mozilla/Preferences.h"
17 #include "nsString.h" 18 #include "nsString.h"
18 #include "nsReadableUtils.h" 19 #include "nsReadableUtils.h"
19 #include "nsTArray.h" 20 #include "nsTArray.h"
20 #include "nsIFormatConverter.h" 21 #include "nsIFormatConverter.h"
21 #include "nsIComponentManager.h" 22 #include "nsIComponentManager.h"
56 57
57 //------------------------------------------------------------------------- 58 //-------------------------------------------------------------------------
58 void 59 void
59 DataStruct::SetData ( nsISupports* aData, uint32_t aDataLen ) 60 DataStruct::SetData ( nsISupports* aData, uint32_t aDataLen )
60 { 61 {
62 // First, prepare for conditional caching according to isolation mode
63 int32_t isolationState = mozilla::Preferences::GetInt("privacy.thirdparty.isolate");
64
61 // Now, check to see if we consider the data to be "too large" 65 // Now, check to see if we consider the data to be "too large"
62 if (aDataLen > kLargeDatasetSize) { 66 if (aDataLen > kLargeDatasetSize && isolationState == 0) {
63 // if so, cache it to disk instead of memory 67 // if so, cache it to disk instead of memory
64 if ( NS_SUCCEEDED(WriteCache(aData, aDataLen)) ) 68 if ( NS_SUCCEEDED(WriteCache(aData, aDataLen)) )
65 return; 69 return;
66 else 70 else
67 NS_WARNING("Oh no, couldn't write data to the cache file"); 71 NS_WARNING("Oh no, couldn't write data to the cache file");

mercurial