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