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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Response.cpp

Issue 2804023004: Replace ASSERT with DCHECK in modules/fetch. (Closed)
Patch Set: Use DCHECK_EQ in all but a few instances 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/fetch/Response.h" 5 #include "modules/fetch/Response.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 case kWebServiceWorkerResponseTypeOpaque: 83 case kWebServiceWorkerResponseTypeOpaque:
84 response = response->CreateOpaqueFilteredResponse(); 84 response = response->CreateOpaqueFilteredResponse();
85 break; 85 break;
86 case kWebServiceWorkerResponseTypeOpaqueRedirect: 86 case kWebServiceWorkerResponseTypeOpaqueRedirect:
87 response = response->CreateOpaqueRedirectFilteredResponse(); 87 response = response->CreateOpaqueRedirectFilteredResponse();
88 break; 88 break;
89 case kWebServiceWorkerResponseTypeDefault: 89 case kWebServiceWorkerResponseTypeDefault:
90 break; 90 break;
91 case kWebServiceWorkerResponseTypeError: 91 case kWebServiceWorkerResponseTypeError:
92 ASSERT(response->GetType() == FetchResponseData::kErrorType); 92 DCHECK_EQ(response->GetType(), FetchResponseData::kErrorType);
93 break; 93 break;
94 } 94 }
95 95
96 return response; 96 return response;
97 } 97 }
98 98
99 // Checks whether |status| is a null body status. 99 // Checks whether |status| is a null body status.
100 // Spec: https://fetch.spec.whatwg.org/#null-body-status 100 // Spec: https://fetch.spec.whatwg.org/#null-body-status
101 bool IsNullBodyStatus(unsigned short status) { 101 bool IsNullBodyStatus(unsigned short status) {
102 if (status == 101 || status == 204 || status == 205 || status == 304) 102 if (status == 101 || status == 204 || status == 205 || status == 304)
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 .Set(response.As<v8::Object>(), body_buffer); 463 .Set(response.As<v8::Object>(), body_buffer);
464 } 464 }
465 465
466 DEFINE_TRACE(Response) { 466 DEFINE_TRACE(Response) {
467 Body::Trace(visitor); 467 Body::Trace(visitor);
468 visitor->Trace(response_); 468 visitor->Trace(response_);
469 visitor->Trace(headers_); 469 visitor->Trace(headers_);
470 } 470 }
471 471
472 } // namespace blink 472 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/RequestTest.cpp ('k') | third_party/WebKit/Source/modules/fetch/ResponseTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698