Index: Source/core/html/LinkResource.h |
diff --git a/Source/modules/donottrack/NavigatorDoNotTrack.h b/Source/core/html/LinkResource.h |
similarity index 62% |
copy from Source/modules/donottrack/NavigatorDoNotTrack.h |
copy to Source/core/html/LinkResource.h |
index 0c044e7cd8edef2f8860c374d59f077e1e963816..509bbf57405bb98a55df2c08059bbb4909e334de 100644 |
--- a/Source/modules/donottrack/NavigatorDoNotTrack.h |
+++ b/Source/core/html/LinkResource.h |
@@ -28,32 +28,53 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef NavigatorDoNotTrack_h |
-#define NavigatorDoNotTrack_h |
+#ifndef LinkResource_h |
+#define LinkResource_h |
-#include "core/page/DOMWindowProperty.h" |
-#include "core/platform/Supplementable.h" |
+#include "core/loader/cache/CachedResourceRequest.h" |
+#include "core/platform/KURL.h" |
+#include "wtf/Forward.h" |
+#include "wtf/RefCounted.h" |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-class Frame; |
-class Navigator; |
+class HTMLLinkElement; |
-class NavigatorDoNotTrack : public Supplement<Navigator>, public DOMWindowProperty { |
+class LinkResource : public RefCounted<LinkResource> { |
+ WTF_MAKE_FAST_ALLOCATED; |
public: |
- virtual ~NavigatorDoNotTrack(); |
- static NavigatorDoNotTrack* from(Navigator*); |
+ enum Type { |
+ Style, |
+ Import |
+ }; |
- static String doNotTrack(Navigator*); |
+ explicit LinkResource(HTMLLinkElement*); |
+ virtual ~LinkResource(); |
- String doNotTrack(); |
+ virtual Type type() const = 0; |
+ virtual void process() = 0; |
+ virtual void ownerRemoved() = 0; |
+ |
+protected: |
+ HTMLLinkElement* m_owner; |
+}; |
+ |
+class LinkRequestBuilder { |
dglazkov
2013/05/23 18:32:00
I wonder if this could be just folded into LinkRes
Hajime Morrita
2013/05/24 02:28:27
That makes LinkResource bigger. I'd make this a sh
|
+public: |
+ explicit LinkRequestBuilder(HTMLLinkElement* owner); |
+ |
+ bool isValid() const { return !m_url.isEmpty() && m_url.isValid(); } |
+ const KURL& url() const { return m_url; } |
+ const String& charset() const { return m_charset; } |
+ CachedResourceRequest build(bool blocking) const; |
private: |
- explicit NavigatorDoNotTrack(Frame*); |
- static const char* supplementName(); |
+ HTMLLinkElement* m_owner; |
+ KURL m_url; |
+ String m_charset; |
}; |
} // namespace WebCore |
-#endif // NavigatorDoNotTrack_h |
+#endif // LinkResource_h |