Backout e9291f227d63 (Bug 725597). rs=dcamp a=mfinkle
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Fri, 20 Apr 2012 07:46:46 +0200
changeset 95346 46e19522aa98e5e551ab747f57ac6e6792155907
parent 95345 e5af6f193e2a17b86444ad12481042bec3f69135
child 95347 8c00bd3fa27052d97039395244c9428bede75e6c
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdcamp, mfinkle
bugs725597
milestone14.0a1
backs oute9291f227d6304d0aea43a3dcb6a96ed97fdffb7
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout e9291f227d63 (Bug 725597). rs=dcamp a=mfinkle
toolkit/components/url-classifier/Classifier.cpp
toolkit/components/url-classifier/LookupCache.cpp
toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
--- a/toolkit/components/url-classifier/Classifier.cpp
+++ b/toolkit/components/url-classifier/Classifier.cpp
@@ -582,18 +582,17 @@ Classifier::ApplyTableUpdates(nsTArray<T
 
   // At this point the store is updated and written out to disk, but
   // the data is still in memory.  Build our quick-lookup table here.
   rv = prefixSet->Build(store->AddPrefixes(), store->AddCompletes());
   NS_ENSURE_SUCCESS(rv, rv);
 #if defined(DEBUG) && defined(PR_LOGGING)
   prefixSet->Dump();
 #endif
-  rv = prefixSet->WriteFile();
-  NS_ENSURE_SUCCESS(rv, rv);
+  prefixSet->WriteFile();
 
   // This will drop all the temporary storage used during the update.
   rv = store->FinishUpdate();
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (updateFreshness) {
     PRInt64 now = (PR_Now() / PR_USEC_PER_SEC);
     LOG(("Successfully updated %s", PromiseFlatCString(store->TableName()).get()));
--- a/toolkit/components/url-classifier/LookupCache.cpp
+++ b/toolkit/components/url-classifier/LookupCache.cpp
@@ -254,23 +254,16 @@ nsresult
 LookupCache::WriteFile()
 {
   nsCOMPtr<nsIFile> storeFile;
   nsresult rv = mStoreDirectory->Clone(getter_AddRefs(storeFile));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = storeFile->AppendNative(mTableName + NS_LITERAL_CSTRING(CACHE_SUFFIX));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Need to close the inputstream here *before* rewriting its file.
-  // Windows will fail if we don't.
-  if (mInputStream) {
-    rv = mInputStream->Close();
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
   nsCOMPtr<nsIOutputStream> out;
   rv = NS_NewSafeLocalFileOutputStream(getter_AddRefs(out), storeFile,
                                        PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   UpdateHeader();
   LOG(("Writing %d completions", mHeader.numCompletions));
 
--- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
+++ b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
@@ -31,18 +31,18 @@ function delFile(name) {
     file.append(name);
     if (file.exists())
       file.remove(false);
   } catch(e) {
   }
 }
 
 function cleanUp() {
+  delFile("classifier.hashkey");
   delFile("urlclassifier3.sqlite");
-  delFile("safebrowsing/classifier.hashkey");
   delFile("safebrowsing/test-phish-simple.sbstore");
   delFile("safebrowsing/test-malware-simple.sbstore");
   delFile("safebrowsing/test-phish-simple.cache");
   delFile("safebrowsing/test-malware-simple.cache");
   delFile("safebrowsing/test-phish-simple.pset");
   delFile("safebrowsing/test-malware-simple.pset");
 }