Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: Source/core/html/DOMURL.h

Issue 24066010: Implement URLUtils and URL interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates based on code review comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/html/DOMURL.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/DOMURL.h
diff --git a/Source/core/html/DOMURL.h b/Source/core/html/DOMURL.h
index a3784de69e5db10db6cd870aecb8ded94829b105..4b0c36d6b1f5645e28fbb0aefa3dcdcacef2716e 100644
--- a/Source/core/html/DOMURL.h
+++ b/Source/core/html/DOMURL.h
@@ -27,25 +27,54 @@
#ifndef DOMURL_h
#define DOMURL_h
+#include "bindings/v8/ScriptWrappable.h"
+#include "core/html/DOMURLUtils.h"
+#include "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 ScriptExecutionContext;
class URLRegistrable;
-class DOMURL : public RefCounted<DOMURL> {
+class DOMURL : public ScriptWrappable, public DOMURLUtils, public RefCounted<DOMURL> {
public:
- static PassRefPtr<DOMURL> create() { return adoptRef(new DOMURL); }
+ static PassRefPtr<DOMURL> create(const String& url, ExceptionState& es)
+ {
+ return adoptRef(new DOMURL(url, blankURL(), es));
+ }
+ static PassRefPtr<DOMURL> create(const String& url, const String& base, ExceptionState& es)
+ {
+ return adoptRef(new DOMURL(url, KURL(KURL(), base), es));
+ }
+ static PassRefPtr<DOMURL> create(const String& url, PassRefPtr<DOMURL> base, ExceptionState& es)
+ {
+ ASSERT(base);
+ return adoptRef(new DOMURL(url, base->m_url, es));
+ }
static String createObjectURL(ScriptExecutionContext*, Blob*);
static void revokeObjectURL(ScriptExecutionContext*, const String&);
static String createPublicURL(ScriptExecutionContext*, URLRegistrable*);
+
+ 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;
+
+private:
+ DOMURL(const String& url, const KURL& base, ExceptionState&);
+
+ KURL m_url;
+ String m_input;
};
} // namespace WebCore
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/html/DOMURL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698