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

Side by Side Diff: Source/core/fetch/FetchRequest.h

Issue 1078633003: Added preloader support for sizes based RW values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google, Inc. All rights reserved. 2 * Copyright (C) 2012 Google, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 22 matching lines...) Expand all
33 #include "wtf/text/AtomicString.h" 33 #include "wtf/text/AtomicString.h"
34 34
35 namespace blink { 35 namespace blink {
36 class SecurityOrigin; 36 class SecurityOrigin;
37 37
38 class FetchRequest { 38 class FetchRequest {
39 public: 39 public:
40 enum DeferOption { NoDefer, LazyLoad, DeferredByClient }; 40 enum DeferOption { NoDefer, LazyLoad, DeferredByClient };
41 enum OriginRestriction { UseDefaultOriginRestrictionForType, RestrictToSameO rigin, NoOriginRestriction }; 41 enum OriginRestriction { UseDefaultOriginRestrictionForType, RestrictToSameO rigin, NoOriginRestriction };
42 42
43 struct ResourceWidth {
44 float width;
45 bool isSet;
46
47 ResourceWidth()
48 : width(0)
49 , isSet(false)
50 {
51 }
52 };
53
43 explicit FetchRequest(const ResourceRequest&, const AtomicString& initiator, const String& charset = String(), ResourceLoadPriority = ResourceLoadPriorityUn resolved); 54 explicit FetchRequest(const ResourceRequest&, const AtomicString& initiator, const String& charset = String(), ResourceLoadPriority = ResourceLoadPriorityUn resolved);
44 FetchRequest(const ResourceRequest&, const AtomicString& initiator, const Re sourceLoaderOptions&); 55 FetchRequest(const ResourceRequest&, const AtomicString& initiator, const Re sourceLoaderOptions&);
45 FetchRequest(const ResourceRequest&, const FetchInitiatorInfo&); 56 FetchRequest(const ResourceRequest&, const FetchInitiatorInfo&);
46 ~FetchRequest(); 57 ~FetchRequest();
47 58
48 ResourceRequest& mutableResourceRequest() { return m_resourceRequest; } 59 ResourceRequest& mutableResourceRequest() { return m_resourceRequest; }
49 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } 60 const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
50 const KURL& url() const { return m_resourceRequest.url(); } 61 const KURL& url() const { return m_resourceRequest.url(); }
51 const String& charset() const { return m_charset; } 62 const String& charset() const { return m_charset; }
52 void setCharset(const String& charset) { m_charset = charset; } 63 void setCharset(const String& charset) { m_charset = charset; }
53 const ResourceLoaderOptions& options() const { return m_options; } 64 const ResourceLoaderOptions& options() const { return m_options; }
54 void setOptions(const ResourceLoaderOptions& options) { m_options = options; } 65 void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
55 ResourceLoadPriority priority() const { return m_priority; } 66 ResourceLoadPriority priority() const { return m_priority; }
56 bool forPreload() const { return m_forPreload; } 67 bool forPreload() const { return m_forPreload; }
57 void setForPreload(bool forPreload) { m_forPreload = forPreload; } 68 void setForPreload(bool forPreload) { m_forPreload = forPreload; }
58 DeferOption defer() const { return m_defer; } 69 DeferOption defer() const { return m_defer; }
70 ResourceWidth resourceWidth() const { return m_resourceWidth; }
59 void setDefer(DeferOption defer) { m_defer = defer; } 71 void setDefer(DeferOption defer) { m_defer = defer; }
60 void setContentSecurityCheck(ContentSecurityPolicyDisposition contentSecurit yPolicyOption) { m_options.contentSecurityPolicyOption = contentSecurityPolicyOp tion; } 72 void setContentSecurityCheck(ContentSecurityPolicyDisposition contentSecurit yPolicyOption) { m_options.contentSecurityPolicyOption = contentSecurityPolicyOp tion; }
61 void setCrossOriginAccessControl(SecurityOrigin*, StoredCredentials, Credent ialRequest); 73 void setCrossOriginAccessControl(SecurityOrigin*, StoredCredentials, Credent ialRequest);
62 void setCrossOriginAccessControl(SecurityOrigin*, StoredCredentials); 74 void setCrossOriginAccessControl(SecurityOrigin*, StoredCredentials);
63 void setCrossOriginAccessControl(SecurityOrigin*, const AtomicString& crossO riginMode); 75 void setCrossOriginAccessControl(SecurityOrigin*, const AtomicString& crossO riginMode);
64 OriginRestriction originRestriction() const { return m_originRestriction; } 76 OriginRestriction originRestriction() const { return m_originRestriction; }
65 void setOriginRestriction(OriginRestriction restriction) { m_originRestricti on = restriction; } 77 void setOriginRestriction(OriginRestriction restriction) { m_originRestricti on = restriction; }
78 void setResourceWidth(ResourceWidth);
66 79
67 private: 80 private:
68 ResourceRequest m_resourceRequest; 81 ResourceRequest m_resourceRequest;
69 String m_charset; 82 String m_charset;
70 ResourceLoaderOptions m_options; 83 ResourceLoaderOptions m_options;
71 ResourceLoadPriority m_priority; 84 ResourceLoadPriority m_priority;
72 bool m_forPreload; 85 bool m_forPreload;
73 DeferOption m_defer; 86 DeferOption m_defer;
74 OriginRestriction m_originRestriction; 87 OriginRestriction m_originRestriction;
88 ResourceWidth m_resourceWidth;
75 }; 89 };
76 90
77 } // namespace blink 91 } // namespace blink
78 92
79 #endif 93 #endif
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/misc/resources/image-checks-for-rw.php ('k') | Source/core/fetch/FetchRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698