| OLD | NEW |
| 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 "net/url_request/sdch_dictionary_fetcher.h" | 5 #include "net/url_request/sdch_dictionary_fetcher.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // TODO(rdsmith): log this error to the net log of the URLRequest | 53 // TODO(rdsmith): log this error to the net log of the URLRequest |
| 54 // initiating this fetch, once URLRequest will be passed here. | 54 // initiating this fetch, once URLRequest will be passed here. |
| 55 SdchManager::SdchErrorRecovery( | 55 SdchManager::SdchErrorRecovery( |
| 56 SDCH_DICTIONARY_PREVIOUSLY_SCHEDULED_TO_DOWNLOAD); | 56 SDCH_DICTIONARY_PREVIOUSLY_SCHEDULED_TO_DOWNLOAD); |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 | 59 |
| 60 attempted_load_.insert(dictionary_url); | 60 attempted_load_.insert(dictionary_url); |
| 61 fetch_queue_.push(dictionary_url); | 61 fetch_queue_.push(dictionary_url); |
| 62 | 62 |
| 63 // If the loop is already processing, it'll pick up the above in the |
| 64 // normal course of events. |
| 65 if (next_state_ != STATE_NONE) |
| 66 return; |
| 67 |
| 63 next_state_ = STATE_IDLE; | 68 next_state_ = STATE_IDLE; |
| 64 | 69 |
| 65 // There are no callbacks to user code from the dictionary fetcher, | 70 // There are no callbacks to user code from the dictionary fetcher, |
| 66 // and Schedule() is only called from user code, so this call to DoLoop() | 71 // and Schedule() is only called from user code, so this call to DoLoop() |
| 67 // does not require an |if (in_loop_) return;| guard. | 72 // does not require an |if (in_loop_) return;| guard. |
| 68 DoLoop(OK); | 73 DoLoop(OK); |
| 69 } | 74 } |
| 70 | 75 |
| 71 void SdchDictionaryFetcher::Cancel() { | 76 void SdchDictionaryFetcher::Cancel() { |
| 72 DCHECK(CalledOnValidThread()); | 77 DCHECK(CalledOnValidThread()); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 current_request_.reset(); | 255 current_request_.reset(); |
| 251 buffer_ = NULL; | 256 buffer_ = NULL; |
| 252 dictionary_.clear(); | 257 dictionary_.clear(); |
| 253 | 258 |
| 254 next_state_ = STATE_IDLE; | 259 next_state_ = STATE_IDLE; |
| 255 | 260 |
| 256 return OK; | 261 return OK; |
| 257 } | 262 } |
| 258 | 263 |
| 259 } // namespace net | 264 } // namespace net |
| OLD | NEW |