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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebURLRequest.cpp

Issue 2811463002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/exported (Closed)
Patch Set: rebase Created 3 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void WebURLRequest::SetHTTPMethod(const WebString& http_method) { 155 void WebURLRequest::SetHTTPMethod(const WebString& http_method) {
156 resource_request_->SetHTTPMethod(http_method); 156 resource_request_->SetHTTPMethod(http_method);
157 } 157 }
158 158
159 WebString WebURLRequest::HttpHeaderField(const WebString& name) const { 159 WebString WebURLRequest::HttpHeaderField(const WebString& name) const {
160 return resource_request_->HttpHeaderField(name); 160 return resource_request_->HttpHeaderField(name);
161 } 161 }
162 162
163 void WebURLRequest::SetHTTPHeaderField(const WebString& name, 163 void WebURLRequest::SetHTTPHeaderField(const WebString& name,
164 const WebString& value) { 164 const WebString& value) {
165 RELEASE_ASSERT(!DeprecatedEqualIgnoringCase(name, "referer")); 165 CHECK(!DeprecatedEqualIgnoringCase(name, "referer"));
166 resource_request_->SetHTTPHeaderField(name, value); 166 resource_request_->SetHTTPHeaderField(name, value);
167 } 167 }
168 168
169 void WebURLRequest::SetHTTPReferrer(const WebString& web_referrer, 169 void WebURLRequest::SetHTTPReferrer(const WebString& web_referrer,
170 WebReferrerPolicy referrer_policy) { 170 WebReferrerPolicy referrer_policy) {
171 // WebString doesn't have the distinction between empty and null. We use 171 // WebString doesn't have the distinction between empty and null. We use
172 // the null WTFString for referrer. 172 // the null WTFString for referrer.
173 ASSERT(Referrer::NoReferrer() == String()); 173 DCHECK_EQ(Referrer::NoReferrer(), String());
174 String referrer = 174 String referrer =
175 web_referrer.IsEmpty() ? Referrer::NoReferrer() : String(web_referrer); 175 web_referrer.IsEmpty() ? Referrer::NoReferrer() : String(web_referrer);
176 resource_request_->SetHTTPReferrer( 176 resource_request_->SetHTTPReferrer(
177 Referrer(referrer, static_cast<ReferrerPolicy>(referrer_policy))); 177 Referrer(referrer, static_cast<ReferrerPolicy>(referrer_policy)));
178 } 178 }
179 179
180 void WebURLRequest::AddHTTPHeaderField(const WebString& name, 180 void WebURLRequest::AddHTTPHeaderField(const WebString& name,
181 const WebString& value) { 181 const WebString& value) {
182 resource_request_->AddHTTPHeaderField(name, value); 182 resource_request_->AddHTTPHeaderField(name, value);
183 } 183 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 429
430 const ResourceRequest& WebURLRequest::ToResourceRequest() const { 430 const ResourceRequest& WebURLRequest::ToResourceRequest() const {
431 DCHECK(resource_request_); 431 DCHECK(resource_request_);
432 return *resource_request_; 432 return *resource_request_;
433 } 433 }
434 434
435 WebURLRequest::WebURLRequest(ResourceRequest& r) : resource_request_(&r) {} 435 WebURLRequest::WebURLRequest(ResourceRequest& r) : resource_request_(&r) {}
436 436
437 } // namespace blink 437 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698