gecko/dom/base/URL.h
Robert O'Callahan 7b4c5ebb95 Bug 792675. Part 4: Refactor nsBlobURI/nsBlobProtocolHandler to nsHostObjectURI/nsHostObjectProtocolHandler. r=sicking
The code to handle MediaStream URIs is almost the same as for Blobs, so share it.
nsHostObjectProtocolHandler is modified a bit to simplify method names. Also
we make nsHostObjectProtocolHandler::AddDataEntry take responsibility for
generating the URI to avoid duplicating that code later.
We need separate subclasses for each kind of host object protocol handler,
but we don't need separate subclasses for each kind of host object URI.

--HG--
rename : content/base/public/nsBlobProtocolHandler.h => content/base/public/nsHostObjectProtocolHandler.h
rename : content/base/src/nsBlobProtocolHandler.cpp => content/base/src/nsHostObjectProtocolHandler.cpp
rename : content/base/src/nsBlobURI.cpp => content/base/src/nsHostObjectURI.cpp
rename : content/base/src/nsBlobURI.h => content/base/src/nsHostObjectURI.h
extra : rebase_source : bfb1d7ea2813100a35f9a2054a67584e38f5f330
2012-09-25 15:24:44 +12:00

38 lines
1.2 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef URL_h___
#define URL_h___
#include "nscore.h"
#include "mozilla/dom/URLBinding.h"
class nsIDOMBlob;
namespace mozilla {
namespace dom {
class URL MOZ_FINAL
{
public:
// WebIDL methods
static void CreateObjectURL(nsISupports* aGlobal, nsIDOMBlob* aBlob,
const objectURLOptions& aOptions,
nsAString& aResult,
ErrorResult& aError);
static void RevokeObjectURL(nsISupports* aGlobal, const nsAString& aURL);
private:
static void CreateObjectURLInternal(nsISupports* aGlobal, nsISupports* aObject,
const nsACString& aScheme,
const mozilla::dom::objectURLOptions& aOptions,
nsAString& aResult,
mozilla::ErrorResult& aError);
};
}
}
#endif /* URL_h___ */