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

Side by Side Diff: Source/platform/network/ResourceRequest.h

Issue 99733002: Update HTTPHeaderMap wrappers to use AtomicString type for header values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years 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
« no previous file with comments | « Source/platform/network/HTTPRequest.cpp ('k') | Source/platform/network/ResourceRequest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ResourceRequest(const String& urlString) 83 ResourceRequest(const String& urlString)
84 { 84 {
85 initialize(KURL(ParsedURLString, urlString), UseProtocolCachePolicy); 85 initialize(KURL(ParsedURLString, urlString), UseProtocolCachePolicy);
86 } 86 }
87 87
88 ResourceRequest(const KURL& url) 88 ResourceRequest(const KURL& url)
89 { 89 {
90 initialize(url, UseProtocolCachePolicy); 90 initialize(url, UseProtocolCachePolicy);
91 } 91 }
92 92
93 ResourceRequest(const KURL& url, const String& referrer, ResourceRequestCach ePolicy cachePolicy = UseProtocolCachePolicy) 93 ResourceRequest(const KURL& url, const AtomicString& referrer, ResourceReque stCachePolicy cachePolicy = UseProtocolCachePolicy)
94 { 94 {
95 initialize(url, cachePolicy); 95 initialize(url, cachePolicy);
96 setHTTPReferrer(referrer); 96 setHTTPReferrer(referrer);
97 } 97 }
98 98
99 static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceReque stData>); 99 static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceReque stData>);
100 100
101 // Gets a copy of the data suitable for passing to another thread. 101 // Gets a copy of the data suitable for passing to another thread.
102 PassOwnPtr<CrossThreadResourceRequestData> copyData() const; 102 PassOwnPtr<CrossThreadResourceRequestData> copyData() const;
103 103
104 bool isNull() const; 104 bool isNull() const;
105 bool isEmpty() const; 105 bool isEmpty() const;
106 106
107 const KURL& url() const; 107 const KURL& url() const;
108 void setURL(const KURL& url); 108 void setURL(const KURL& url);
109 109
110 void removeCredentials(); 110 void removeCredentials();
111 111
112 ResourceRequestCachePolicy cachePolicy() const; 112 ResourceRequestCachePolicy cachePolicy() const;
113 void setCachePolicy(ResourceRequestCachePolicy cachePolicy); 113 void setCachePolicy(ResourceRequestCachePolicy cachePolicy);
114 114
115 double timeoutInterval() const; // May return 0 when using platform default. 115 double timeoutInterval() const; // May return 0 when using platform default.
116 void setTimeoutInterval(double timeoutInterval); 116 void setTimeoutInterval(double timeoutInterval);
117 117
118 const KURL& firstPartyForCookies() const; 118 const KURL& firstPartyForCookies() const;
119 void setFirstPartyForCookies(const KURL& firstPartyForCookies); 119 void setFirstPartyForCookies(const KURL& firstPartyForCookies);
120 120
121 const String& httpMethod() const; 121 const AtomicString& httpMethod() const;
122 void setHTTPMethod(const String& httpMethod); 122 void setHTTPMethod(const AtomicString&);
123 123
124 const HTTPHeaderMap& httpHeaderFields() const; 124 const HTTPHeaderMap& httpHeaderFields() const;
125 String httpHeaderField(const AtomicString& name) const; 125 AtomicString httpHeaderField(const AtomicString& name) const;
126 String httpHeaderField(const char* name) const; 126 const AtomicString& httpHeaderField(const char* name) const;
127 void setHTTPHeaderField(const AtomicString& name, const String& value); 127 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value) ;
128 void setHTTPHeaderField(const char* name, const String& value); 128 void setHTTPHeaderField(const char* name, const AtomicString& value);
129 void addHTTPHeaderField(const AtomicString& name, const String& value); 129 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value) ;
130 void addHTTPHeaderFields(const HTTPHeaderMap& headerFields); 130 void addHTTPHeaderFields(const HTTPHeaderMap& headerFields);
131 void clearHTTPHeaderField(const AtomicString& name); 131 void clearHTTPHeaderField(const AtomicString& name);
132 132
133 void clearHTTPAuthorization(); 133 void clearHTTPAuthorization();
134 134
135 String httpContentType() const { return httpHeaderField("Content-Type"); } 135 AtomicString httpContentType() const { return httpHeaderField("Content-Type" ); }
136 void setHTTPContentType(const String& httpContentType) { setHTTPHeaderField( "Content-Type", httpContentType); } 136 void setHTTPContentType(const AtomicString& httpContentType) { setHTTPHeader Field("Content-Type", httpContentType); }
137 void clearHTTPContentType(); 137 void clearHTTPContentType();
138 138
139 String httpReferrer() const { return httpHeaderField("Referer"); } 139 AtomicString httpReferrer() const { return httpHeaderField("Referer"); }
140 void setHTTPReferrer(const String& httpReferrer) { setHTTPHeaderField("Refer er", httpReferrer); } 140 void setHTTPReferrer(const AtomicString& httpReferrer) { setHTTPHeaderField( "Referer", httpReferrer); }
141 void clearHTTPReferrer(); 141 void clearHTTPReferrer();
142 142
143 String httpOrigin() const { return httpHeaderField("Origin"); } 143 AtomicString httpOrigin() const { return httpHeaderField("Origin"); }
144 void setHTTPOrigin(const String& httpOrigin) { setHTTPHeaderField("Origin", httpOrigin); } 144 void setHTTPOrigin(const AtomicString& httpOrigin) { setHTTPHeaderField("Ori gin", httpOrigin); }
145 void clearHTTPOrigin(); 145 void clearHTTPOrigin();
146 146
147 String httpUserAgent() const { return httpHeaderField("User-Agent"); } 147 AtomicString httpUserAgent() const { return httpHeaderField("User-Agent"); }
148 void setHTTPUserAgent(const String& httpUserAgent) { setHTTPHeaderField("Use r-Agent", httpUserAgent); } 148 void setHTTPUserAgent(const AtomicString& httpUserAgent) { setHTTPHeaderFiel d("User-Agent", httpUserAgent); }
149 void clearHTTPUserAgent(); 149 void clearHTTPUserAgent();
150 150
151 String httpAccept() const { return httpHeaderField("Accept"); } 151 AtomicString httpAccept() const { return httpHeaderField("Accept"); }
152 void setHTTPAccept(const String& httpAccept) { setHTTPHeaderField("Accept", httpAccept); } 152 void setHTTPAccept(const AtomicString& httpAccept) { setHTTPHeaderField("Acc ept", httpAccept); }
153 void clearHTTPAccept(); 153 void clearHTTPAccept();
154 154
155 FormData* httpBody() const; 155 FormData* httpBody() const;
156 void setHTTPBody(PassRefPtr<FormData> httpBody); 156 void setHTTPBody(PassRefPtr<FormData> httpBody);
157 157
158 bool allowCookies() const; 158 bool allowCookies() const;
159 void setAllowCookies(bool allowCookies); 159 void setAllowCookies(bool allowCookies);
160 160
161 ResourceLoadPriority priority() const; 161 ResourceLoadPriority priority() const;
162 void setPriority(ResourceLoadPriority); 162 void setPriority(ResourceLoadPriority);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 int m_requestorProcessID; 265 int m_requestorProcessID;
266 int m_appCacheHostID; 266 int m_appCacheHostID;
267 ResourceRequest::TargetType m_targetType; 267 ResourceRequest::TargetType m_targetType;
268 }; 268 };
269 269
270 unsigned initializeMaximumHTTPConnectionCountPerHost(); 270 unsigned initializeMaximumHTTPConnectionCountPerHost();
271 271
272 } // namespace WebCore 272 } // namespace WebCore
273 273
274 #endif // ResourceRequest_h 274 #endif // ResourceRequest_h
OLDNEW
« no previous file with comments | « Source/platform/network/HTTPRequest.cpp ('k') | Source/platform/network/ResourceRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698