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

Side by Side Diff: Source/core/loader/cache/CachedResourceRequest.h

Issue 14672042: Prepare to add more initiator info to CachedResource(Request) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 unified diff | Download patch | Annotate | Revision Log
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 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef CachedResourceRequest_h 26 #ifndef CachedResourceRequest_h
27 #define CachedResourceRequest_h 27 #define CachedResourceRequest_h
28 28
29 #include "core/dom/Element.h" 29 #include "core/dom/Element.h"
30 #include "core/loader/ResourceLoaderOptions.h" 30 #include "core/loader/ResourceLoaderOptions.h"
31 #include "core/loader/cache/CachedResourceInitiatorInfo.h"
31 #include "core/platform/network/ResourceLoadPriority.h" 32 #include "core/platform/network/ResourceLoadPriority.h"
32 #include "core/platform/network/ResourceRequest.h" 33 #include "core/platform/network/ResourceRequest.h"
33 #include <wtf/RefPtr.h> 34 #include <wtf/RefPtr.h>
34 #include <wtf/text/AtomicString.h> 35 #include <wtf/text/AtomicString.h>
35 36
36 namespace WebCore { 37 namespace WebCore {
37 class Document; 38 class Document;
38 39
39 class CachedResourceRequest { 40 class CachedResourceRequest {
40 public: 41 public:
41 enum DeferOption { NoDefer, DeferredByClient }; 42 enum DeferOption { NoDefer, DeferredByClient };
42 43
43 explicit CachedResourceRequest(const ResourceRequest&, const String& charset = String(), ResourceLoadPriority = ResourceLoadPriorityUnresolved); 44 explicit CachedResourceRequest(const ResourceRequest&, const AtomicString& i nitiator, const String& charset = String(), ResourceLoadPriority = ResourceLoadP riorityUnresolved);
44 CachedResourceRequest(const ResourceRequest&, const ResourceLoaderOptions&); 45 CachedResourceRequest(const ResourceRequest&, const AtomicString& initiator, const ResourceLoaderOptions&);
45 CachedResourceRequest(const ResourceRequest&, ResourceLoadPriority); 46 CachedResourceRequest(const ResourceRequest&, const AtomicString& initiator, ResourceLoadPriority);
46 ~CachedResourceRequest(); 47 ~CachedResourceRequest();
47 48
48 ResourceRequest& mutableResourceRequest() { return m_resourceRequest; } 49 ResourceRequest& mutableResourceRequest() { return m_resourceRequest; }
49 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } 50 const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
50 const String& charset() const { return m_charset; } 51 const String& charset() const { return m_charset; }
51 void setCharset(const String& charset) { m_charset = charset; } 52 void setCharset(const String& charset) { m_charset = charset; }
52 const ResourceLoaderOptions& options() const { return m_options; } 53 const ResourceLoaderOptions& options() const { return m_options; }
53 void setOptions(const ResourceLoaderOptions& options) { m_options = options; } 54 void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
54 void setPriority(ResourceLoadPriority priority) { m_priority = priority; } 55 void setPriority(ResourceLoadPriority priority) { m_priority = priority; }
55 ResourceLoadPriority priority() const { return m_priority; } 56 ResourceLoadPriority priority() const { return m_priority; }
56 bool forPreload() const { return m_forPreload; } 57 bool forPreload() const { return m_forPreload; }
57 void setForPreload(bool forPreload) { m_forPreload = forPreload; } 58 void setForPreload(bool forPreload) { m_forPreload = forPreload; }
58 DeferOption defer() const { return m_defer; } 59 DeferOption defer() const { return m_defer; }
59 void setDefer(DeferOption defer) { m_defer = defer; } 60 void setDefer(DeferOption defer) { m_defer = defer; }
60 void setInitiator(PassRefPtr<Element>); 61 const CachedResourceInitiatorInfo& initiatorInfo() const { return m_initiato rInfo; }
61 void setInitiator(const AtomicString& name);
62 const AtomicString& initiatorName() const;
63 PassRefPtr<Element> initiatorElement();
64 void setContentSecurityCheck(ContentSecurityPolicyCheck contentSecurityPolic yOption) { m_options.contentSecurityPolicyOption = contentSecurityPolicyOption; } 62 void setContentSecurityCheck(ContentSecurityPolicyCheck contentSecurityPolic yOption) { m_options.contentSecurityPolicyOption = contentSecurityPolicyOption; }
65 63
66 private: 64 private:
67 ResourceRequest m_resourceRequest; 65 ResourceRequest m_resourceRequest;
68 String m_charset; 66 String m_charset;
69 ResourceLoaderOptions m_options; 67 ResourceLoaderOptions m_options;
70 ResourceLoadPriority m_priority; 68 ResourceLoadPriority m_priority;
71 bool m_forPreload; 69 bool m_forPreload;
72 DeferOption m_defer; 70 DeferOption m_defer;
73 RefPtr<Element> m_initiatorElement; 71 CachedResourceInitiatorInfo m_initiatorInfo;
74 AtomicString m_initiatorName;
75 }; 72 };
76 73
77 } // namespace WebCore 74 } // namespace WebCore
78 75
79 #endif 76 #endif
OLDNEW
« no previous file with comments | « Source/core/loader/cache/CachedResourceLoader.cpp ('k') | Source/core/loader/cache/CachedResourceRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698