| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 RawResourceClientStateChecker::RawResourceClientStateChecker() | 263 RawResourceClientStateChecker::RawResourceClientStateChecker() |
| 264 : m_state(NotAddedAsClient) | 264 : m_state(NotAddedAsClient) |
| 265 { | 265 { |
| 266 } | 266 } |
| 267 | 267 |
| 268 RawResourceClientStateChecker::~RawResourceClientStateChecker() | 268 RawResourceClientStateChecker::~RawResourceClientStateChecker() |
| 269 { | 269 { |
| 270 } | 270 } |
| 271 | 271 |
| 272 void RawResourceClientStateChecker::willAddClient() | 272 NEVER_INLINE void RawResourceClientStateChecker::willAddClient() |
| 273 { | 273 { |
| 274 SECURITY_CHECK(m_state == NotAddedAsClient); | 274 SECURITY_CHECK(m_state == NotAddedAsClient); |
| 275 m_state = Started; | 275 m_state = Started; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void RawResourceClientStateChecker::willRemoveClient() | 278 NEVER_INLINE void RawResourceClientStateChecker::willRemoveClient() |
| 279 { | 279 { |
| 280 SECURITY_CHECK(m_state != NotAddedAsClient); | 280 SECURITY_CHECK(m_state != NotAddedAsClient); |
| 281 m_state = NotAddedAsClient; | 281 m_state = NotAddedAsClient; |
| 282 } | 282 } |
| 283 | 283 |
| 284 void RawResourceClientStateChecker::redirectReceived() | 284 NEVER_INLINE void RawResourceClientStateChecker::redirectReceived() |
| 285 { | 285 { |
| 286 SECURITY_CHECK(m_state == Started); | 286 SECURITY_CHECK(m_state == Started); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void RawResourceClientStateChecker::redirectBlocked() | 289 NEVER_INLINE void RawResourceClientStateChecker::redirectBlocked() |
| 290 { | 290 { |
| 291 SECURITY_CHECK(m_state == Started); | 291 SECURITY_CHECK(m_state == Started); |
| 292 m_state = RedirectBlocked; | 292 m_state = RedirectBlocked; |
| 293 } | 293 } |
| 294 | 294 |
| 295 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 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 use DCHECK() here instead of CHECK(), |
| 303 // due to crbug.com/640960. | 303 // due to crbug.com/640960. |
| 304 SECURITY_DCHECK(m_state == Started); | 304 SECURITY_DCHECK(m_state == Started); |
| 305 m_state = ResponseReceived; | 305 m_state = ResponseReceived; |
| 306 } | 306 } |
| 307 | 307 |
| 308 void RawResourceClientStateChecker::setSerializedCachedMetadata() | 308 NEVER_INLINE void RawResourceClientStateChecker::setSerializedCachedMetadata() |
| 309 { | 309 { |
| 310 SECURITY_CHECK(m_state == ResponseReceived); | 310 SECURITY_CHECK(m_state == ResponseReceived); |
| 311 m_state = SetSerializedCachedMetadata; | 311 m_state = SetSerializedCachedMetadata; |
| 312 } | 312 } |
| 313 | 313 |
| 314 void RawResourceClientStateChecker::dataReceived() | 314 NEVER_INLINE void RawResourceClientStateChecker::dataReceived() |
| 315 { | 315 { |
| 316 SECURITY_CHECK(m_state == ResponseReceived || m_state == SetSerializedCached
Metadata || m_state == DataReceived); | 316 SECURITY_CHECK(m_state == ResponseReceived || m_state == SetSerializedCached
Metadata || m_state == DataReceived); |
| 317 m_state = DataReceived; | 317 m_state = DataReceived; |
| 318 } | 318 } |
| 319 | 319 |
| 320 void RawResourceClientStateChecker::dataDownloaded() | 320 NEVER_INLINE void RawResourceClientStateChecker::dataDownloaded() |
| 321 { | 321 { |
| 322 SECURITY_CHECK(m_state == ResponseReceived || m_state == SetSerializedCached
Metadata || m_state == DataDownloaded); | 322 SECURITY_CHECK(m_state == ResponseReceived || m_state == SetSerializedCached
Metadata || m_state == DataDownloaded); |
| 323 m_state = DataDownloaded; | 323 m_state = DataDownloaded; |
| 324 } | 324 } |
| 325 | 325 |
| 326 void RawResourceClientStateChecker::notifyFinished(Resource* resource) | 326 NEVER_INLINE void RawResourceClientStateChecker::notifyFinished(Resource* resour
ce) |
| 327 { | 327 { |
| 328 SECURITY_CHECK(m_state != NotAddedAsClient); | 328 SECURITY_CHECK(m_state != NotAddedAsClient); |
| 329 SECURITY_CHECK(m_state != NotifyFinished); | 329 SECURITY_CHECK(m_state != NotifyFinished); |
| 330 SECURITY_CHECK(resource->errorOccurred() || (m_state == ResponseReceived ||
m_state == SetSerializedCachedMetadata || m_state == DataReceived || m_state ==
DataDownloaded)); | 330 SECURITY_CHECK(resource->errorOccurred() || (m_state == ResponseReceived ||
m_state == SetSerializedCachedMetadata || m_state == DataReceived || m_state ==
DataDownloaded)); |
| 331 m_state = NotifyFinished; | 331 m_state = NotifyFinished; |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace blink | 334 } // namespace blink |
| OLD | NEW |