| OLD | NEW |
| 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 Loading... |
| 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); |
| 311 SECURITY_CHECK(m_state == Started); |
| 305 m_state = ResponseReceived; | 312 m_state = ResponseReceived; |
| 306 } | 313 } |
| 307 | 314 |
| 308 NEVER_INLINE void RawResourceClientStateChecker::setSerializedCachedMetadata() | 315 NEVER_INLINE void RawResourceClientStateChecker::setSerializedCachedMetadata() |
| 309 { | 316 { |
| 310 SECURITY_CHECK(m_state == ResponseReceived); | 317 SECURITY_CHECK(m_state == ResponseReceived); |
| 311 m_state = SetSerializedCachedMetadata; | 318 m_state = SetSerializedCachedMetadata; |
| 312 } | 319 } |
| 313 | 320 |
| 314 NEVER_INLINE void RawResourceClientStateChecker::dataReceived() | 321 NEVER_INLINE void RawResourceClientStateChecker::dataReceived() |
| (...skipping 10 matching lines...) Expand all Loading... |
| 325 | 332 |
| 326 NEVER_INLINE void RawResourceClientStateChecker::notifyFinished(Resource* resour
ce) | 333 NEVER_INLINE void RawResourceClientStateChecker::notifyFinished(Resource* resour
ce) |
| 327 { | 334 { |
| 328 SECURITY_CHECK(m_state != NotAddedAsClient); | 335 SECURITY_CHECK(m_state != NotAddedAsClient); |
| 329 SECURITY_CHECK(m_state != NotifyFinished); | 336 SECURITY_CHECK(m_state != NotifyFinished); |
| 330 SECURITY_CHECK(resource->errorOccurred() || (m_state == ResponseReceived ||
m_state == SetSerializedCachedMetadata || m_state == DataReceived || m_state ==
DataDownloaded)); | 337 SECURITY_CHECK(resource->errorOccurred() || (m_state == ResponseReceived ||
m_state == SetSerializedCachedMetadata || m_state == DataReceived || m_state ==
DataDownloaded)); |
| 331 m_state = NotifyFinished; | 338 m_state = NotifyFinished; |
| 332 } | 339 } |
| 333 | 340 |
| 334 } // namespace blink | 341 } // namespace blink |
| OLD | NEW |