Bug 716570 - Rename blob URI scheme from "moz-filedata" to "blob" per spec. r=sicking
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 12 Jan 2012 11:36:03 +0100
changeset 84333 feba786cfdc8667873f84cb1979b4105ad7bbfac
parent 84332 024745e78d82f85a88ad23fba9099da4fb3d4067
child 84334 fb5bcf9ae739c64ffb6718e4f7030f2b84cae4f9
child 84337 4089da57bff1caf1da11ddaa259fd5c84649db7f
push id21839
push usermbrubeck@mozilla.com
push dateThu, 12 Jan 2012 16:24:29 +0000
treeherdermozilla-central@fb5bcf9ae739 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs716570
milestone12.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 716570 - Rename blob URI scheme from "moz-filedata" to "blob" per spec. r=sicking
content/base/public/nsIDOMFile.idl
content/base/public/nsIDocument.h
content/base/src/Makefile.in
content/base/src/nsBlobProtocolHandler.cpp
content/base/src/nsBlobProtocolHandler.h
content/base/src/nsDOMFile.cpp
content/base/src/nsDOMFileReader.cpp
content/base/src/nsDataDocumentContentPolicy.cpp
content/base/src/nsDocument.cpp
content/base/src/nsFileDataProtocolHandler.cpp
content/base/src/nsFileDataProtocolHandler.h
dom/base/nsGlobalWindow.cpp
layout/build/nsLayoutModule.cpp
layout/forms/nsICapturePicker.idl
layout/reftests/svg/as-image/img-blobBuilder-1.html
layout/reftests/svg/as-image/img-blobBuilder-2.html
netwerk/test/unit/test_URIs.js
netwerk/test/unit/test_bug660066.js
--- a/content/base/public/nsIDOMFile.idl
+++ b/content/base/public/nsIDOMFile.idl
@@ -63,17 +63,17 @@ interface nsIDOMBlob;
 [scriptable, builtinclass, uuid(f62c6887-e3bc-495a-802c-287e12e969a0)]
 interface nsIDOMBlob : nsISupports
 {
   readonly attribute unsigned long long size;
   readonly attribute DOMString type;
 
   [noscript] readonly attribute nsIInputStream internalStream;
   // The caller is responsible for releasing the internalUrl from the
-  // moz-filedata: protocol handler
+  // blob: protocol handler
   [noscript] DOMString getInternalUrl(in nsIPrincipal principal);
 
   [optional_argc] nsIDOMBlob mozSlice([optional] in long long start,
                                       [optional] in long long end,
                                       [optional] in DOMString contentType);
 
   // Get internal id of stored file. Returns -1 if it is not a stored file.
   // Intended only for testing. It can be called on any thread.
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -1490,17 +1490,17 @@ public:
   virtual nsEventStates GetDocumentState() = 0;
 
   virtual nsISupports* GetCurrentContentSink() = 0;
 
   /**
    * Register/Unregister a filedata uri as being "owned" by this document. 
    * I.e. that its lifetime is connected with this document. When the document
    * goes away it should "kill" the uri by calling
-   * nsFileDataProtocolHandler::RemoveFileDataEntry
+   * nsBlobProtocolHandler::RemoveFileDataEntry
    */
   virtual void RegisterFileDataUri(const nsACString& aUri) = 0;
   virtual void UnregisterFileDataUri(const nsACString& aUri) = 0;
 
   virtual void SetScrollToRef(nsIURI *aDocumentURI) = 0;
   virtual void ScrollToRef() = 0;
   virtual void ResetScrolledToRefAlready() = 0;
   virtual void SetChangeScrollPosWhenScrollingToRef(bool aValue) = 0;
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -146,17 +146,17 @@ CPPSRCS		= \
 		nsTreeSanitizer.cpp \
 		nsTreeWalker.cpp \
 		nsWebSocket.cpp \
 		nsXHTMLContentSerializer.cpp \
 		nsXMLContentSerializer.cpp \
 		nsXMLHttpRequest.cpp \
 		nsXMLNameSpaceMap.cpp \
 		Link.cpp \
-		nsFileDataProtocolHandler.cpp \
+		nsBlobProtocolHandler.cpp \
 		nsFrameMessageManager.cpp \
 		nsInProcessTabChildGlobal.cpp \
 		ThirdPartyUtil.cpp \
 		nsEventSource.cpp \
 		FileIOObject.cpp \
 		$(NULL)
 
 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
rename from content/base/src/nsFileDataProtocolHandler.cpp
rename to content/base/src/nsBlobProtocolHandler.cpp
--- a/content/base/src/nsFileDataProtocolHandler.cpp
+++ b/content/base/src/nsBlobProtocolHandler.cpp
@@ -29,17 +29,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "nsFileDataProtocolHandler.h"
+#include "nsBlobProtocolHandler.h"
 #include "nsSimpleURI.h"
 #include "nsDOMError.h"
 #include "nsCOMPtr.h"
 #include "nsClassHashtable.h"
 #include "nsNetUtil.h"
 #include "nsIURIWithPrincipal.h"
 #include "nsIPrincipal.h"
 #include "nsIDOMFile.h"
@@ -55,17 +55,17 @@ struct FileDataInfo
 {
   nsCOMPtr<nsIDOMBlob> mFile;
   nsCOMPtr<nsIPrincipal> mPrincipal;
 };
 
 static nsClassHashtable<nsCStringHashKey, FileDataInfo>* gFileDataTable;
 
 void
-nsFileDataProtocolHandler::AddFileDataEntry(nsACString& aUri,
+nsBlobProtocolHandler::AddFileDataEntry(nsACString& aUri,
 					    nsIDOMBlob* aFile,
                                             nsIPrincipal* aPrincipal)
 {
   if (!gFileDataTable) {
     gFileDataTable = new nsClassHashtable<nsCStringHashKey, FileDataInfo>;
     gFileDataTable->Init();
   }
 
@@ -73,29 +73,29 @@ nsFileDataProtocolHandler::AddFileDataEn
 
   info->mFile = aFile;
   info->mPrincipal = aPrincipal;
 
   gFileDataTable->Put(aUri, info);
 }
 
 void
-nsFileDataProtocolHandler::RemoveFileDataEntry(nsACString& aUri)
+nsBlobProtocolHandler::RemoveFileDataEntry(nsACString& aUri)
 {
   if (gFileDataTable) {
     gFileDataTable->Remove(aUri);
     if (gFileDataTable->Count() == 0) {
       delete gFileDataTable;
       gFileDataTable = nsnull;
     }
   }
 }
 
 nsIPrincipal*
-nsFileDataProtocolHandler::GetFileDataEntryPrincipal(nsACString& aUri)
+nsBlobProtocolHandler::GetFileDataEntryPrincipal(nsACString& aUri)
 {
   if (!gFileDataTable) {
     return nsnull;
   }
   
   FileDataInfo* res;
   gFileDataTable->Get(aUri, &res);
   if (!res) {
@@ -104,308 +104,308 @@ nsFileDataProtocolHandler::GetFileDataEn
 
   return res->mPrincipal;
 }
 
 static FileDataInfo*
 GetFileDataInfo(const nsACString& aUri)
 {
   NS_ASSERTION(StringBeginsWith(aUri,
-                                NS_LITERAL_CSTRING(FILEDATA_SCHEME ":")),
+                                NS_LITERAL_CSTRING(BLOBURI_SCHEME ":")),
                "Bad URI");
   
   if (!gFileDataTable) {
     return nsnull;
   }
   
   FileDataInfo* res;
   gFileDataTable->Get(aUri, &res);
   return res;
 }
 
 // -----------------------------------------------------------------------
 // Uri
 
-#define NS_FILEDATAURI_CID \
+#define NS_BLOBURI_CID \
 { 0xf5475c51, 0x59a7, 0x4757, \
   { 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } }
 
-static NS_DEFINE_CID(kFILEDATAURICID, NS_FILEDATAURI_CID);
+static NS_DEFINE_CID(kBLOBURICID, NS_BLOBURI_CID);
 
-class nsFileDataURI : public nsSimpleURI,
+class nsBlobURI : public nsSimpleURI,
                       public nsIURIWithPrincipal
 {
 public:
-  nsFileDataURI(nsIPrincipal* aPrincipal) :
+  nsBlobURI(nsIPrincipal* aPrincipal) :
       nsSimpleURI(), mPrincipal(aPrincipal)
   {}
-  virtual ~nsFileDataURI() {}
+  virtual ~nsBlobURI() {}
 
   // For use only from deserialization
-  nsFileDataURI() : nsSimpleURI() {}
+  nsBlobURI() : nsSimpleURI() {}
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIURIWITHPRINCIPAL
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
   // Override CloneInternal() and EqualsInternal()
   virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
                                  nsIURI** aClone);
   virtual nsresult EqualsInternal(nsIURI* aOther,
                                   RefHandlingEnum aRefHandlingMode,
                                   bool* aResult);
 
-  // Override StartClone to hand back a nsFileDataURI
+  // Override StartClone to hand back a nsBlobURI
   virtual nsSimpleURI* StartClone(RefHandlingEnum /* unused */)
-  { return new nsFileDataURI(); }
+  { return new nsBlobURI(); }
 
   nsCOMPtr<nsIPrincipal> mPrincipal;
 };
 
 static NS_DEFINE_CID(kThisSimpleURIImplementationCID,
                      NS_THIS_SIMPLEURI_IMPLEMENTATION_CID);
 
-NS_IMPL_ADDREF_INHERITED(nsFileDataURI, nsSimpleURI)
-NS_IMPL_RELEASE_INHERITED(nsFileDataURI, nsSimpleURI)
+NS_IMPL_ADDREF_INHERITED(nsBlobURI, nsSimpleURI)
+NS_IMPL_RELEASE_INHERITED(nsBlobURI, nsSimpleURI)
 
-NS_INTERFACE_MAP_BEGIN(nsFileDataURI)
+NS_INTERFACE_MAP_BEGIN(nsBlobURI)
   NS_INTERFACE_MAP_ENTRY(nsIURIWithPrincipal)
-  if (aIID.Equals(kFILEDATAURICID))
+  if (aIID.Equals(kBLOBURICID))
     foundInterface = static_cast<nsIURI*>(this);
   else if (aIID.Equals(kThisSimpleURIImplementationCID)) {
     // Need to return explicitly here, because if we just set foundInterface
     // to null the NS_INTERFACE_MAP_END_INHERITING will end up calling into
     // nsSimplURI::QueryInterface and finding something for this CID.
     *aInstancePtr = nsnull;
     return NS_NOINTERFACE;
   }
   else
 NS_INTERFACE_MAP_END_INHERITING(nsSimpleURI)
 
 // nsIURIWithPrincipal methods:
 
 NS_IMETHODIMP
-nsFileDataURI::GetPrincipal(nsIPrincipal** aPrincipal)
+nsBlobURI::GetPrincipal(nsIPrincipal** aPrincipal)
 {
   NS_IF_ADDREF(*aPrincipal = mPrincipal);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFileDataURI::GetPrincipalUri(nsIURI** aUri)
+nsBlobURI::GetPrincipalUri(nsIURI** aUri)
 {
   if (mPrincipal) {
     mPrincipal->GetURI(aUri);
   }
   else {
     *aUri = nsnull;
   }
 
   return NS_OK;
 }
 
 // nsISerializable methods:
 
 NS_IMETHODIMP
-nsFileDataURI::Read(nsIObjectInputStream* aStream)
+nsBlobURI::Read(nsIObjectInputStream* aStream)
 {
   nsresult rv = nsSimpleURI::Read(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_ReadOptionalObject(aStream, true, getter_AddRefs(mPrincipal));
 }
 
 NS_IMETHODIMP
-nsFileDataURI::Write(nsIObjectOutputStream* aStream)
+nsBlobURI::Write(nsIObjectOutputStream* aStream)
 {
   nsresult rv = nsSimpleURI::Write(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_WriteOptionalCompoundObject(aStream, mPrincipal,
                                         NS_GET_IID(nsIPrincipal),
                                         true);
 }
 
 // nsIURI methods:
 nsresult
-nsFileDataURI::CloneInternal(nsSimpleURI::RefHandlingEnum aRefHandlingMode,
+nsBlobURI::CloneInternal(nsSimpleURI::RefHandlingEnum aRefHandlingMode,
                              nsIURI** aClone)
 {
   nsCOMPtr<nsIURI> simpleClone;
   nsresult rv =
     nsSimpleURI::CloneInternal(aRefHandlingMode, getter_AddRefs(simpleClone));
   NS_ENSURE_SUCCESS(rv, rv);
 
 #ifdef DEBUG
-  nsRefPtr<nsFileDataURI> uriCheck;
-  rv = simpleClone->QueryInterface(kFILEDATAURICID, getter_AddRefs(uriCheck));
+  nsRefPtr<nsBlobURI> uriCheck;
+  rv = simpleClone->QueryInterface(kBLOBURICID, getter_AddRefs(uriCheck));
   NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv) && uriCheck,
 		    "Unexpected!");
 #endif
 
-  nsFileDataURI* fileDataURI = static_cast<nsFileDataURI*>(simpleClone.get());
+  nsBlobURI* blobURI = static_cast<nsBlobURI*>(simpleClone.get());
 
-  fileDataURI->mPrincipal = mPrincipal;
+  blobURI->mPrincipal = mPrincipal;
 
   simpleClone.forget(aClone);
   return NS_OK;
 }
 
 /* virtual */ nsresult
-nsFileDataURI::EqualsInternal(nsIURI* aOther,
+nsBlobURI::EqualsInternal(nsIURI* aOther,
                               nsSimpleURI::RefHandlingEnum aRefHandlingMode,
                               bool* aResult)
 {
   if (!aOther) {
     *aResult = false;
     return NS_OK;
   }
   
-  nsRefPtr<nsFileDataURI> otherFileDataUri;
-  aOther->QueryInterface(kFILEDATAURICID, getter_AddRefs(otherFileDataUri));
-  if (!otherFileDataUri) {
+  nsRefPtr<nsBlobURI> otherBlobUri;
+  aOther->QueryInterface(kBLOBURICID, getter_AddRefs(otherBlobUri));
+  if (!otherBlobUri) {
     *aResult = false;
     return NS_OK;
   }
 
   // Compare the member data that our base class knows about.
-  if (!nsSimpleURI::EqualsInternal(otherFileDataUri, aRefHandlingMode)) {
+  if (!nsSimpleURI::EqualsInternal(otherBlobUri, aRefHandlingMode)) {
     *aResult = false;
     return NS_OK;
    }
 
   // Compare the piece of additional member data that we add to base class.
-  if (mPrincipal && otherFileDataUri->mPrincipal) {
+  if (mPrincipal && otherBlobUri->mPrincipal) {
     // Both of us have mPrincipals. Compare them.
-    return mPrincipal->Equals(otherFileDataUri->mPrincipal, aResult);
+    return mPrincipal->Equals(otherBlobUri->mPrincipal, aResult);
   }
   // else, at least one of us lacks a principal; only equal if *both* lack it.
-  *aResult = (!mPrincipal && !otherFileDataUri->mPrincipal);
+  *aResult = (!mPrincipal && !otherBlobUri->mPrincipal);
   return NS_OK;
 }
 
 // nsIClassInfo methods:
 NS_IMETHODIMP 
-nsFileDataURI::GetInterfaces(PRUint32 *count, nsIID * **array)
+nsBlobURI::GetInterfaces(PRUint32 *count, nsIID * **array)
 {
   *count = 0;
   *array = nsnull;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
+nsBlobURI::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
 {
   *_retval = nsnull;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetContractID(char * *aContractID)
+nsBlobURI::GetContractID(char * *aContractID)
 {
   // Make sure to modify any subclasses as needed if this ever
   // changes.
   *aContractID = nsnull;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetClassDescription(char * *aClassDescription)
+nsBlobURI::GetClassDescription(char * *aClassDescription)
 {
   *aClassDescription = nsnull;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetClassID(nsCID * *aClassID)
+nsBlobURI::GetClassID(nsCID * *aClassID)
 {
   // Make sure to modify any subclasses as needed if this ever
   // changes to not call the virtual GetClassIDNoAlloc.
   *aClassID = (nsCID*) nsMemory::Alloc(sizeof(nsCID));
   NS_ENSURE_TRUE(*aClassID, NS_ERROR_OUT_OF_MEMORY);
 
   return GetClassIDNoAlloc(*aClassID);
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetImplementationLanguage(PRUint32 *aImplementationLanguage)
+nsBlobURI::GetImplementationLanguage(PRUint32 *aImplementationLanguage)
 {
   *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetFlags(PRUint32 *aFlags)
+nsBlobURI::GetFlags(PRUint32 *aFlags)
 {
   *aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
+nsBlobURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
 {
-  *aClassIDNoAlloc = kFILEDATAURICID;
+  *aClassIDNoAlloc = kBLOBURICID;
   return NS_OK;
 }
 
 // -----------------------------------------------------------------------
 // Protocol handler
 
-NS_IMPL_ISUPPORTS1(nsFileDataProtocolHandler, nsIProtocolHandler)
+NS_IMPL_ISUPPORTS1(nsBlobProtocolHandler, nsIProtocolHandler)
 
 NS_IMETHODIMP
-nsFileDataProtocolHandler::GetScheme(nsACString &result)
+nsBlobProtocolHandler::GetScheme(nsACString &result)
 {
-  result.AssignLiteral(FILEDATA_SCHEME);
+  result.AssignLiteral(BLOBURI_SCHEME);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFileDataProtocolHandler::GetDefaultPort(PRInt32 *result)
+nsBlobProtocolHandler::GetDefaultPort(PRInt32 *result)
 {
   *result = -1;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFileDataProtocolHandler::GetProtocolFlags(PRUint32 *result)
+nsBlobProtocolHandler::GetProtocolFlags(PRUint32 *result)
 {
   *result = URI_NORELATIVE | URI_NOAUTH | URI_LOADABLE_BY_SUBSUMERS |
             URI_IS_LOCAL_RESOURCE | URI_NON_PERSISTABLE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFileDataProtocolHandler::NewURI(const nsACString& aSpec,
+nsBlobProtocolHandler::NewURI(const nsACString& aSpec,
                                   const char *aCharset,
                                   nsIURI *aBaseURI,
                                   nsIURI **aResult)
 {
   *aResult = nsnull;
   nsresult rv;
 
   FileDataInfo* info =
     GetFileDataInfo(aSpec);
 
-  nsRefPtr<nsFileDataURI> uri =
-    new nsFileDataURI(info ? info->mPrincipal.get() : nsnull);
+  nsRefPtr<nsBlobURI> uri =
+    new nsBlobURI(info ? info->mPrincipal.get() : nsnull);
 
   rv = uri->SetSpec(aSpec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_TryToSetImmutable(uri);
   uri.forget(aResult);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFileDataProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+nsBlobProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
 {
   *result = nsnull;
 
   nsCString spec;
   uri->GetSpec(spec);
 
   FileDataInfo* info =
     GetFileDataInfo(spec);
@@ -443,15 +443,15 @@ nsFileDataProtocolHandler::NewChannel(ns
   channel->SetOriginalURI(uri);
   channel->SetContentType(NS_ConvertUTF16toUTF8(type));
   channel.forget(result);
   
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsFileDataProtocolHandler::AllowPort(PRInt32 port, const char *scheme,
+nsBlobProtocolHandler::AllowPort(PRInt32 port, const char *scheme,
                                      bool *_retval)
 {
     // don't override anything.  
     *_retval = false;
     return NS_OK;
 }
rename from content/base/src/nsFileDataProtocolHandler.h
rename to content/base/src/nsBlobProtocolHandler.h
--- a/content/base/src/nsFileDataProtocolHandler.h
+++ b/content/base/src/nsBlobProtocolHandler.h
@@ -29,44 +29,44 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef nsFileDataProtocolHandler_h___
-#define nsFileDataProtocolHandler_h___
+#ifndef nsBlobProtocolHandler_h
+#define nsBlobProtocolHandler_h
 
 #include "nsIProtocolHandler.h"
 
-#define FILEDATA_SCHEME "moz-filedata"
+#define BLOBURI_SCHEME "blob"
 
 class nsIDOMBlob;
 class nsIPrincipal;
 
-class nsFileDataProtocolHandler : public nsIProtocolHandler
+class nsBlobProtocolHandler : public nsIProtocolHandler
 {
 public:
   NS_DECL_ISUPPORTS
 
   // nsIProtocolHandler methods:
   NS_DECL_NSIPROTOCOLHANDLER
 
-  // nsFileDataProtocolHandler methods:
-  nsFileDataProtocolHandler() {}
-  virtual ~nsFileDataProtocolHandler() {}
+  // nsBlobProtocolHandler methods:
+  nsBlobProtocolHandler() {}
+  virtual ~nsBlobProtocolHandler() {}
 
   // Methods for managing uri->file mapping
   static void AddFileDataEntry(nsACString& aUri,
 			       nsIDOMBlob* aFile,
                                nsIPrincipal* aPrincipal);
   static void RemoveFileDataEntry(nsACString& aUri);
   static nsIPrincipal* GetFileDataEntryPrincipal(nsACString& aUri);
   
 };
 
-#define NS_FILEDATAPROTOCOLHANDLER_CID \
+#define NS_BLOBPROTOCOLHANDLER_CID \
 { 0xb43964aa, 0xa078, 0x44b2, \
   { 0xb0, 0x6b, 0xfd, 0x4d, 0x1b, 0x17, 0x2e, 0x66 } }
 
-#endif /* nsFileDataProtocolHandler_h___ */
+#endif /* nsBlobProtocolHandler_h */
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -55,17 +55,17 @@
 #include "nsIMIMEService.h"
 #include "nsIPlatformCharset.h"
 #include "nsISeekableStream.h"
 #include "nsIUnicharInputStream.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIUUIDGenerator.h"
-#include "nsFileDataProtocolHandler.h"
+#include "nsBlobProtocolHandler.h"
 #include "nsStringStream.h"
 #include "CheckedInt.h"
 #include "nsJSUtils.h"
 #include "mozilla/Preferences.h"
 
 #include "plbase64.h"
 #include "prmem.h"
 
@@ -283,20 +283,20 @@ nsDOMFileBase::GetInternalUrl(nsIPrincip
   
   nsID id;
   rv = uuidgen->GenerateUUIDInPlace(&id);
   NS_ENSURE_SUCCESS(rv, rv);
   
   char chars[NSID_LENGTH];
   id.ToProvidedString(chars);
     
-  nsCString url = NS_LITERAL_CSTRING(FILEDATA_SCHEME ":") +
+  nsCString url = NS_LITERAL_CSTRING(BLOBURI_SCHEME ":") +
     Substring(chars + 1, chars + NSID_LENGTH - 2);
 
-  nsFileDataProtocolHandler::AddFileDataEntry(url, this,
+  nsBlobProtocolHandler::AddFileDataEntry(url, this,
                                               aPrincipal);
 
   CopyASCIItoUTF16(url, aURL);
   
   return NS_OK;
 }
 
 NS_IMETHODIMP_(PRInt64)
@@ -663,11 +663,11 @@ nsDOMFileInternalUrlHolder::nsDOMFileInt
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   aFile->GetInternalUrl(aPrincipal, mUrl);
 }
  
 nsDOMFileInternalUrlHolder::~nsDOMFileInternalUrlHolder() {
   if (!mUrl.IsEmpty()) {
     nsCAutoString narrowUrl;
     CopyUTF16toUTF8(mUrl, narrowUrl);
-    nsFileDataProtocolHandler::RemoveFileDataEntry(narrowUrl);
+    nsBlobProtocolHandler::RemoveFileDataEntry(narrowUrl);
   }
 }
--- a/content/base/src/nsDOMFileReader.cpp
+++ b/content/base/src/nsDOMFileReader.cpp
@@ -69,17 +69,17 @@
 #include "nsIJSContextStack.h"
 #include "nsJSEnvironment.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsCExternalHandlerService.h"
 #include "nsIStreamConverterService.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsLayoutStatics.h"
 #include "nsIScriptObjectPrincipal.h"
-#include "nsFileDataProtocolHandler.h"
+#include "nsBlobProtocolHandler.h"
 #include "mozilla/Preferences.h"
 #include "xpcpublic.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsDOMJSUtils.h"
 
 #include "jstypedarray.h"
 
 using namespace mozilla;
--- a/content/base/src/nsDataDocumentContentPolicy.cpp
+++ b/content/base/src/nsDataDocumentContentPolicy.cpp
@@ -97,17 +97,17 @@ nsDataDocumentContentPolicy::ShouldLoad(
     return NS_OK;
   }
 
   if (doc->IsBeingUsedAsImage()) {
     // We only allow SVG images to load content from URIs that are local and
     // also satisfy one of the following conditions:
     //  - URI inherits security context, e.g. data URIs
     //   OR
-    //  - URI loadable by subsumers, e.g. moz-filedata URIs
+    //  - URI loadable by subsumers, e.g. blob URIs
     // Any URI that doesn't meet these requirements will be rejected below.
     if (!HasFlags(aContentLocation,
                   nsIProtocolHandler::URI_IS_LOCAL_RESOURCE) ||
         (!HasFlags(aContentLocation,
                    nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT) &&
          !HasFlags(aContentLocation,
                    nsIProtocolHandler::URI_LOADABLE_BY_SUBSUMERS))) {
       *aDecision = nsIContentPolicy::REJECT_TYPE;
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -139,17 +139,17 @@
 #include "nsContentCreatorFunctions.h"
 
 #include "nsIScriptContext.h"
 #include "nsBindingManager.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIRequest.h"
 #include "nsILink.h"
-#include "nsFileDataProtocolHandler.h"
+#include "nsBlobProtocolHandler.h"
 
 #include "nsICharsetAlias.h"
 #include "nsIParser.h"
 #include "nsIContentSink.h"
 
 #include "nsDateTimeFormatCID.h"
 #include "nsIDateTimeFormat.h"
 #include "nsEventDispatcher.h"
@@ -1664,17 +1664,17 @@ nsDocument::~nsDocument()
   if (mBoxObjectTable) {
     mBoxObjectTable->EnumerateRead(ClearAllBoxObjects, nsnull);
     delete mBoxObjectTable;
   }
 
   mPendingTitleChangeEvent.Revoke();
 
   for (PRUint32 i = 0; i < mFileDataUris.Length(); ++i) {
-    nsFileDataProtocolHandler::RemoveFileDataEntry(mFileDataUris[i]);
+    nsBlobProtocolHandler::RemoveFileDataEntry(mFileDataUris[i]);
   }
 
   // We don't want to leave residual locks on images. Make sure we're in an
   // unlocked state, and then clear the table.
   SetImageLockingState(false);
   mImageTracker.Clear();
 }
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -175,17 +175,17 @@
 #include "nsIScriptError.h"
 #include "nsIConsoleService.h"
 #include "nsIControllers.h"
 #include "nsIControllerContext.h"
 #include "nsGlobalWindowCommands.h"
 #include "nsAutoPtr.h"
 #include "nsContentUtils.h"
 #include "nsCSSProps.h"
-#include "nsFileDataProtocolHandler.h"
+#include "nsBlobProtocolHandler.h"
 #include "nsIDOMFile.h"
 #include "nsIDOMFileList.h"
 #include "nsIURIFixup.h"
 #include "mozilla/FunctionTimer.h"
 #include "nsCDefaultURIFixup.h"
 #include "nsEventDispatcher.h"
 #include "nsIObserverService.h"
 #include "nsIXULAppInfo.h"
@@ -684,25 +684,25 @@ nsDOMMozURLProperty::RevokeObjectURL(con
   NS_LossyConvertUTF16toASCII asciiurl(aURL);
 
   nsIPrincipal* winPrincipal = mWindow->GetPrincipal();
   if (!winPrincipal) {
     return NS_OK;
   }
 
   nsIPrincipal* principal =
-    nsFileDataProtocolHandler::GetFileDataEntryPrincipal(asciiurl);
+    nsBlobProtocolHandler::GetFileDataEntryPrincipal(asciiurl);
   bool subsumes;
   if (principal && winPrincipal &&
       NS_SUCCEEDED(winPrincipal->Subsumes(principal, &subsumes)) &&
       subsumes) {
     if (mWindow->mDoc) {
       mWindow->mDoc->UnregisterFileDataUri(asciiurl);
     }
-    nsFileDataProtocolHandler::RemoveFileDataEntry(asciiurl);
+    nsBlobProtocolHandler::RemoveFileDataEntry(asciiurl);
   }
 
   return NS_OK;
 }
 
 /**
  * An indirect observer object that means we don't have to implement nsIObserver
  * on nsGlobalWindow, where any script could see it.
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -109,17 +109,17 @@
 #include "nsViewsCID.h"
 #include "nsViewManager.h"
 #include "nsContentCreatorFunctions.h"
 
 // DOM includes
 #include "nsDOMException.h"
 #include "nsDOMFileReader.h"
 #include "nsFormData.h"
-#include "nsFileDataProtocolHandler.h"
+#include "nsBlobProtocolHandler.h"
 #include "nsGlobalWindowCommands.h"
 #include "nsIControllerCommandTable.h"
 #include "nsJSProtocolHandler.h"
 #include "nsScriptNameSpaceManager.h"
 #include "nsIControllerContext.h"
 #include "nsDOMScriptObjectFactory.h"
 #include "nsDOMStorage.h"
 #include "nsJSON.h"
@@ -269,17 +269,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(txMozilla
 NS_GENERIC_AGGREGATED_CONSTRUCTOR_INIT(nsXPathEvaluator, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(txNodeSetAdaptor, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMSerializer)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsXMLHttpRequest, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsEventSource)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebSocket)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDOMFileReader, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFormData)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileDataProtocolHandler)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsBlobProtocolHandler)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMParser)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDOMStorageManager,
                                          nsDOMStorageManager::GetInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(IndexedDatabaseManager,
                                          IndexedDatabaseManager::FactoryCreate)
 #ifdef MOZ_B2G_RIL
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager,
@@ -733,17 +733,17 @@ NS_DEFINE_NAMED_CID(NS_VIDEODOCUMENT_CID
 #endif
 NS_DEFINE_NAMED_CID(NS_STYLESHEETSERVICE_CID);
 NS_DEFINE_NAMED_CID(TRANSFORMIIX_XSLT_PROCESSOR_CID);
 NS_DEFINE_NAMED_CID(TRANSFORMIIX_XPATH_EVALUATOR_CID);
 NS_DEFINE_NAMED_CID(TRANSFORMIIX_NODESET_CID);
 NS_DEFINE_NAMED_CID(NS_XMLSERIALIZER_CID);
 NS_DEFINE_NAMED_CID(NS_FILEREADER_CID);
 NS_DEFINE_NAMED_CID(NS_FORMDATA_CID);
-NS_DEFINE_NAMED_CID(NS_FILEDATAPROTOCOLHANDLER_CID);
+NS_DEFINE_NAMED_CID(NS_BLOBPROTOCOLHANDLER_CID);
 NS_DEFINE_NAMED_CID(NS_XMLHTTPREQUEST_CID);
 NS_DEFINE_NAMED_CID(NS_EVENTSOURCE_CID);
 NS_DEFINE_NAMED_CID(NS_WEBSOCKET_CID);
 NS_DEFINE_NAMED_CID(NS_DOMPARSER_CID);
 NS_DEFINE_NAMED_CID(NS_DOMSTORAGE_CID);
 NS_DEFINE_NAMED_CID(NS_DOMSTORAGE2_CID);
 NS_DEFINE_NAMED_CID(NS_DOMSTORAGEMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_DOMJSON_CID);
@@ -1004,17 +1004,17 @@ static const mozilla::Module::CIDEntry k
 #endif
   { &kNS_STYLESHEETSERVICE_CID, false, NULL, nsStyleSheetServiceConstructor },
   { &kTRANSFORMIIX_XSLT_PROCESSOR_CID, false, NULL, txMozillaXSLTProcessorConstructor },
   { &kTRANSFORMIIX_XPATH_EVALUATOR_CID, false, NULL, nsXPathEvaluatorConstructor },
   { &kTRANSFORMIIX_NODESET_CID, false, NULL, txNodeSetAdaptorConstructor },
   { &kNS_XMLSERIALIZER_CID, false, NULL, nsDOMSerializerConstructor },
   { &kNS_FILEREADER_CID, false, NULL, nsDOMFileReaderConstructor },
   { &kNS_FORMDATA_CID, false, NULL, nsFormDataConstructor },
-  { &kNS_FILEDATAPROTOCOLHANDLER_CID, false, NULL, nsFileDataProtocolHandlerConstructor },
+  { &kNS_BLOBPROTOCOLHANDLER_CID, false, NULL, nsBlobProtocolHandlerConstructor },
   { &kNS_XMLHTTPREQUEST_CID, false, NULL, nsXMLHttpRequestConstructor },
   { &kNS_EVENTSOURCE_CID, false, NULL, nsEventSourceConstructor },
   { &kNS_WEBSOCKET_CID, false, NULL, nsWebSocketConstructor },
   { &kNS_DOMPARSER_CID, false, NULL, nsDOMParserConstructor },
   { &kNS_DOMSTORAGE_CID, false, NULL, NS_NewDOMStorage },
   { &kNS_DOMSTORAGE2_CID, false, NULL, NS_NewDOMStorage2 },
   { &kNS_DOMSTORAGEMANAGER_CID, false, NULL, nsDOMStorageManagerConstructor },
   { &kNS_DOMJSON_CID, false, NULL, NS_NewJSON },
@@ -1140,17 +1140,17 @@ static const mozilla::Module::ContractID
   { PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },
   { NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID },
   { TRANSFORMIIX_XSLT_PROCESSOR_CONTRACTID, &kTRANSFORMIIX_XSLT_PROCESSOR_CID },
   { NS_XPATH_EVALUATOR_CONTRACTID, &kTRANSFORMIIX_XPATH_EVALUATOR_CID },
   { TRANSFORMIIX_NODESET_CONTRACTID, &kTRANSFORMIIX_NODESET_CID },
   { NS_XMLSERIALIZER_CONTRACTID, &kNS_XMLSERIALIZER_CID },
   { NS_FILEREADER_CONTRACTID, &kNS_FILEREADER_CID },
   { NS_FORMDATA_CONTRACTID, &kNS_FORMDATA_CID },
-  { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX FILEDATA_SCHEME, &kNS_FILEDATAPROTOCOLHANDLER_CID },
+  { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX BLOBURI_SCHEME, &kNS_BLOBPROTOCOLHANDLER_CID },
   { NS_XMLHTTPREQUEST_CONTRACTID, &kNS_XMLHTTPREQUEST_CID },
   { NS_EVENTSOURCE_CONTRACTID, &kNS_EVENTSOURCE_CID },
   { NS_WEBSOCKET_CONTRACTID, &kNS_WEBSOCKET_CID },
   { NS_DOMPARSER_CONTRACTID, &kNS_DOMPARSER_CID },
   { "@mozilla.org/dom/storage;1", &kNS_DOMSTORAGE_CID },
   { "@mozilla.org/dom/storage;2", &kNS_DOMSTORAGE2_CID },
   { "@mozilla.org/dom/storagemanager;1", &kNS_DOMSTORAGEMANAGER_CID },
   { "@mozilla.org/dom/json;1", &kNS_DOMJSON_CID },
--- a/layout/forms/nsICapturePicker.idl
+++ b/layout/forms/nsICapturePicker.idl
@@ -81,15 +81,15 @@ interface nsICapturePicker : nsISupports
    *
    * @return false if the requested mode can definitely not be captured,
    *         true otherwise.
    */
   boolean modeMayBeAvailable(in unsigned long mode);
 
   /**
    * Get the captured image/video/audio.  This may be a data URI, file URI,
-   * or a moz-filedata reference URI.
+   * or a blob reference URI.
    */
   readonly attribute nsIDOMFile file;
 
   // The MIME type of the captured content.  Cannot be set after calling show()
   attribute AString type;
 };
--- a/layout/reftests/svg/as-image/img-blobBuilder-1.html
+++ b/layout/reftests/svg/as-image/img-blobBuilder-1.html
@@ -1,29 +1,29 @@
 <!DOCTYPE html>
 <!-- This test checks to be sure we can render SVG-as-an-image
-     from a MozBlobBuilder-generated 'moz-filedata' URI. -->
+     from a MozBlobBuilder-generated 'blob' URI. -->
 <html class="reftest-wait">
 <head>
   <script>
     function go() {
-      // Generate a moz-filedata URL encoding of an SVG document
+      // Generate a blob URL encoding of an SVG document
       var filedataURL = generateMozFiledataURL();
 
       // Tell our img element to render the URL
       var img = document.getElementsByTagName("img")[0]
       img.src = filedataURL;
 
       // Once our img loads, take reftest snapshot.
       img.addEventListener("load", function() {
         document.documentElement.removeAttribute("class");
       });
     }
 
-    // Helper function -- returns a moz-filedata URL representing a
+    // Helper function -- returns a blob URL representing a
     // 100x100 fully-lime SVG document.
     function generateMozFiledataURL() {
       var blobBuilder = new self.MozBlobBuilder;
       var svg =
         '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
           '<rect height="100%" width="100%" fill="lime"/>' +
         '</svg>';
       blobBuilder.append(svg);
--- a/layout/reftests/svg/as-image/img-blobBuilder-2.html
+++ b/layout/reftests/svg/as-image/img-blobBuilder-2.html
@@ -1,19 +1,19 @@
 <!DOCTYPE html>
 <!-- This test checks to be sure we allow MozBlobBuilder-generated
-     'moz-filedata' URIs *inside of* SVG-as-an-image. -->
+     'blob' URIs *inside of* SVG-as-an-image. -->
 <html class="reftest-wait">
 <head>
   <script>
     function go() {
-      // Generate a moz-filedata URL encoding of an SVG document
+      // Generate a blob URL encoding of an SVG document
       var filedataURL = generateMozFiledataURL();
 
-      // Now generate a data URI, containing our moz-filedata URI
+      // Now generate a data URI, containing our blob URI
       var outerSVG =
         '<svg xmlns="http://www.w3.org/2000/svg" ' +
              'xmlns:xlink="http://www.w3.org/1999/xlink" ' +
              'width="100" height="100">' +
           '<image height="100" width="100" ' +
              'xlink:href="' + filedataURL + '"/>' +
         '</svg>';
 
@@ -22,17 +22,17 @@
       img.src = "data:image/svg+xml," + outerSVG;
 
       // Once our img loads, take reftest snapshot.
       img.addEventListener("load", function() {
         document.documentElement.removeAttribute("class");
       });
     }
 
-    // Helper function -- returns a moz-filedata URL representing a
+    // Helper function -- returns a blob URL representing a
     // 100x100 fully-lime SVG document.
     function generateMozFiledataURL() {
       var blobBuilder = new self.MozBlobBuilder;
       var svg =
         '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
           '<rect height="100%" width="100%" fill="lime"/>' +
         '</svg>';
       blobBuilder.append(svg);
--- a/netwerk/test/unit/test_URIs.js
+++ b/netwerk/test/unit/test_URIs.js
@@ -218,19 +218,19 @@ var gTests = [
     ref:     "",
     nsIURL:  false, nsINestedURI: false },
   { spec:    "javascript:new Date()",
     scheme:  "javascript",
     prePath: "javascript:",
     path:    "new%20Date()",
     ref:     "",
     nsIURL:  false, nsINestedURI: false },
-  { spec:    "moz-filedata:123456",
-    scheme:  "moz-filedata",
-    prePath: "moz-filedata:",
+  { spec:    "blob:123456",
+    scheme:  "blob",
+    prePath: "blob:",
     path:    "123456",
     ref:     "",
     nsIURL:  false, nsINestedURI: false, immutable: true },
   { spec:    "place:redirectsMode=2&sort=8&maxResults=10",
     scheme:  "place",
     prePath: "place:",
     path:    "redirectsMode=2&sort=8&maxResults=10",
     ref:     "",
--- a/netwerk/test/unit/test_bug660066.js
+++ b/netwerk/test/unit/test_bug660066.js
@@ -1,13 +1,13 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 const Ci = Components.interfaces;
 const SIMPLEURI_SPEC = "data:text/plain,hello world";
-const FILEDATA_SPEC = "moz-filedata:123456";
+const BLOBURI_SPEC = "blob:123456";
 
 function do_info(text, stack) {
   if (!stack)
     stack = Components.stack.caller;
 
   dump( "\n" +
        "TEST-INFO | " + stack.filename + " | [" + stack.name + " : " +
        stack.lineNumber + "] " + text + "\n");
@@ -22,22 +22,22 @@ function do_check_uri_neq(uri1, uri2)
   do_info("Checking equality in reverse direction...");
   do_check_false(uri2.equals(uri1));
   do_check_false(uri2.equalsExceptRef(uri1));
 }
 
 function run_test()
 {
   var simpleURI = NetUtil.newURI(SIMPLEURI_SPEC);
-  var fileDataURI = NetUtil.newURI(FILEDATA_SPEC);
+  var fileDataURI = NetUtil.newURI(BLOBURI_SPEC);
 
-  do_info("Checking that " + SIMPLEURI_SPEC + " != " + FILEDATA_SPEC);
+  do_info("Checking that " + SIMPLEURI_SPEC + " != " + BLOBURI_SPEC);
   do_check_uri_neq(simpleURI, fileDataURI);
 
   do_info("Changing the nsSimpleURI spec to match the nsFileDataURI");
-  simpleURI.spec = FILEDATA_SPEC;
+  simpleURI.spec = BLOBURI_SPEC;
 
   do_info("Verifying that .spec matches");
   do_check_eq(simpleURI.spec, fileDataURI.spec);
 
   do_info("Checking that nsSimpleURI != nsFileDataURI despite their .spec matching")
   do_check_uri_neq(simpleURI, fileDataURI);
 }