Bug 1029781: Set NS_LOAD_CLASSIFY_URI in image loader (r=seth)
authorMonica Chew <mmc@mozilla.com>
Fri, 27 Jun 2014 13:57:36 -0700
changeset 191314 f3192b2f919585d35da3efeaba0f5502ea7de77d
parent 191313 6810b2fa1afe8dcf8889e9198132b9f41a6c2de0
child 191315 28abd4f8ca40e5a7e570e55f4ac30603a7d53dd9
push id27041
push userphilringnalda@gmail.com
push dateSun, 29 Jun 2014 00:39:21 +0000
treeherdermozilla-central@afa67a2f7905 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1029781
milestone33.0a1
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
Bug 1029781: Set NS_LOAD_CLASSIFY_URI in image loader (r=seth)
image/src/imgLoader.cpp
image/test/unit/image_load_helpers.js
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -594,16 +594,17 @@ static nsresult NewImageChannel(nsIChann
   }
 
   // Pass in a nullptr loadgroup because this is the underlying network
   // request. This request may be referenced by several proxy image requests
   // (possibly in different documents).
   // If all of the proxy requests are canceled then this request should be
   // canceled too.
   //
+  aLoadFlags |= nsIChannel::LOAD_CLASSIFY_URI;
   rv = NS_NewChannel(aResult,
                      aURI,        // URI
                      nullptr,      // Cached IOService
                      nullptr,      // LoadGroup
                      callbacks,   // Notification Callbacks
                      aLoadFlags,
                      aPolicy);
   if (NS_FAILED(rv))
--- a/image/test/unit/image_load_helpers.js
+++ b/image/test/unit/image_load_helpers.js
@@ -11,16 +11,19 @@ const DATA_AVAILABLE = 0x04;
 // One bit per callback that imageListener below implements. Stored in
 // ImageListener.state.
 const SIZE_AVAILABLE = 0x01;
 const FRAME_UPDATE = 0x02;
 const FRAME_COMPLETE = 0x04;
 const LOAD_COMPLETE = 0x08;
 const DECODE_COMPLETE = 0x10;
 
+// Safebrowsing requires that the profile dir is set.
+do_get_profile();
+
 // An implementation of imgIScriptedNotificationObserver with the ability to
 // call specified functions on onStartRequest and onStopRequest.
 function ImageListener(start_callback, stop_callback)
 {
   this.sizeAvailable = function onSizeAvailable(aRequest)
   {
     do_check_false(this.synchronous);