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

Side by Side Diff: third_party/WebKit/Source/core/fetch/RawResource.cpp

Issue 2314503003: Capture wrong states in RawResourceClientStateChecker::responseReceived() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Loader_assertNeverINline
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 2011 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 m_state = RedirectBlocked; 292 m_state = RedirectBlocked;
293 } 293 }
294 294
295 NEVER_INLINE void RawResourceClientStateChecker::dataSent() 295 NEVER_INLINE void RawResourceClientStateChecker::dataSent()
296 { 296 {
297 SECURITY_CHECK(m_state == Started); 297 SECURITY_CHECK(m_state == Started);
298 } 298 }
299 299
300 NEVER_INLINE void RawResourceClientStateChecker::responseReceived() 300 NEVER_INLINE void RawResourceClientStateChecker::responseReceived()
301 { 301 {
302 // TODO(hiroshige): Temporarily we use DCHECK() here instead of CHECK(), 302 // TODO(hiroshige): Temporarily we insert the checks below to capture the
303 // due to crbug.com/640960. 303 // wrong state. The checks should be reverted shortly. crbug.com/640960.
304 SECURITY_DCHECK(m_state == Started); 304 SECURITY_CHECK(m_state != NotAddedAsClient);
305 SECURITY_CHECK(m_state != RedirectBlocked);
306 SECURITY_CHECK(m_state != ResponseReceived);
307 SECURITY_CHECK(m_state != SetSerializedCachedMetadata);
308 SECURITY_CHECK(m_state != DataReceived);
309 SECURITY_CHECK(m_state != DataDownloaded);
310 SECURITY_CHECK(m_state != NotifyFinished);
yhirano 2016/09/07 02:07:46 Can you add SECURITY_CHECK(m_state == Started)?
hiroshige 2016/09/07 02:10:45 Done.
305 m_state = ResponseReceived; 311 m_state = ResponseReceived;
306 } 312 }
307 313
308 NEVER_INLINE void RawResourceClientStateChecker::setSerializedCachedMetadata() 314 NEVER_INLINE void RawResourceClientStateChecker::setSerializedCachedMetadata()
309 { 315 {
310 SECURITY_CHECK(m_state == ResponseReceived); 316 SECURITY_CHECK(m_state == ResponseReceived);
311 m_state = SetSerializedCachedMetadata; 317 m_state = SetSerializedCachedMetadata;
312 } 318 }
313 319
314 NEVER_INLINE void RawResourceClientStateChecker::dataReceived() 320 NEVER_INLINE void RawResourceClientStateChecker::dataReceived()
(...skipping 10 matching lines...) Expand all
325 331
326 NEVER_INLINE void RawResourceClientStateChecker::notifyFinished(Resource* resour ce) 332 NEVER_INLINE void RawResourceClientStateChecker::notifyFinished(Resource* resour ce)
327 { 333 {
328 SECURITY_CHECK(m_state != NotAddedAsClient); 334 SECURITY_CHECK(m_state != NotAddedAsClient);
329 SECURITY_CHECK(m_state != NotifyFinished); 335 SECURITY_CHECK(m_state != NotifyFinished);
330 SECURITY_CHECK(resource->errorOccurred() || (m_state == ResponseReceived || m_state == SetSerializedCachedMetadata || m_state == DataReceived || m_state == DataDownloaded)); 336 SECURITY_CHECK(resource->errorOccurred() || (m_state == ResponseReceived || m_state == SetSerializedCachedMetadata || m_state == DataReceived || m_state == DataDownloaded));
331 m_state = NotifyFinished; 337 m_state = NotifyFinished;
332 } 338 }
333 339
334 } // namespace blink 340 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698