#ifndef DOMURL_h
#define DOMURL_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/dom/DOMURLUtils.h"
#include "heap/Handle.h"
#include "platform/weborigin/KURL.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class Blob;
class ExceptionState;
class ExecutionContext;
class URLRegistrable;
class DOMURL FINAL : public RefCountedWillBeGarbageCollectedFinalized<DOMURL>, public ScriptWrappable, public DOMURLUtils {
public:
static PassRefPtrWillBeRawPtr<DOMURL> create(const String& url, ExceptionState& exceptionState)
{
return adoptRefWillBeNoop(new DOMURL(url, blankURL(), exceptionState));
}
static PassRefPtrWillBeRawPtr<DOMURL> create(const String& url, const String& base, ExceptionState& exceptionState)
{
return adoptRefWillBeNoop(new DOMURL(url, KURL(KURL(), base), exceptionState));
}
static PassRefPtrWillBeRawPtr<DOMURL> create(const String& url, PassRefPtrWillBeRawPtr<DOMURL> base, ExceptionState& exceptionState)
{
ASSERT(base);
return adoptRefWillBeNoop(new DOMURL(url, base->m_url, exceptionState));
}
static String createObjectURL(ExecutionContext*, Blob*, ExceptionState&);
static void revokeObjectURL(ExecutionContext*, const String&);
static String createPublicURL(ExecutionContext*, URLRegistrable*, const String& uuid = String());
static void revokeObjectUUID(ExecutionContext*, const String&);
virtual KURL url() const OVERRIDE { return m_url; }
virtual void setURL(const KURL& url) OVERRIDE { m_url = url; }
virtual String input() const OVERRIDE { return m_input; }
virtual void setInput(const String&) OVERRIDE;
void trace(Visitor*) { }
private:
DOMURL(const String& url, const KURL& base, ExceptionState&);
KURL m_url;
String m_input;
};
}
#endif