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

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

Issue 15856002: First step of HTMLImports (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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
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

Powered by Google App Engine
This is Rietveld 408576698