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"); |