widget/xpwidgets/nsTransferable.cpp

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

mercurial