| 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 #include <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (fetch_queue_->IsEmpty() || current_request_.get()) { | 269 if (fetch_queue_->IsEmpty() || current_request_.get()) { |
| 270 next_state_ = STATE_NONE; | 270 next_state_ = STATE_NONE; |
| 271 return OK; | 271 return OK; |
| 272 } | 272 } |
| 273 | 273 |
| 274 next_state_ = STATE_SEND_REQUEST_COMPLETE; | 274 next_state_ = STATE_SEND_REQUEST_COMPLETE; |
| 275 | 275 |
| 276 FetchInfo info; | 276 FetchInfo info; |
| 277 bool success = fetch_queue_->Pop(&info); | 277 bool success = fetch_queue_->Pop(&info); |
| 278 DCHECK(success); | 278 DCHECK(success); |
| 279 current_request_ = | 279 current_request_ = context_->CreateRequest(info.url, IDLE, this); |
| 280 context_->CreateRequest(info.url, IDLE, this, NULL); | |
| 281 int load_flags = LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES; | 280 int load_flags = LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES; |
| 282 if (info.cache_only) | 281 if (info.cache_only) |
| 283 load_flags |= LOAD_ONLY_FROM_CACHE; | 282 load_flags |= LOAD_ONLY_FROM_CACHE; |
| 284 current_request_->SetLoadFlags(load_flags); | 283 current_request_->SetLoadFlags(load_flags); |
| 285 | 284 |
| 286 buffer_ = new IOBuffer(kBufferSize); | 285 buffer_ = new IOBuffer(kBufferSize); |
| 287 current_callback_ = info.callback; | 286 current_callback_ = info.callback; |
| 288 | 287 |
| 289 current_request_->Start(); | 288 current_request_->Start(); |
| 290 current_request_->net_log().AddEvent(NetLog::TYPE_SDCH_DICTIONARY_FETCH); | 289 current_request_->net_log().AddEvent(NetLog::TYPE_SDCH_DICTIONARY_FETCH); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 current_callback_.Run(dictionary_, current_request_->url(), | 359 current_callback_.Run(dictionary_, current_request_->url(), |
| 361 current_request_->net_log()); | 360 current_request_->net_log()); |
| 362 } | 361 } |
| 363 | 362 |
| 364 ResetRequest(); | 363 ResetRequest(); |
| 365 next_state_ = STATE_SEND_REQUEST; | 364 next_state_ = STATE_SEND_REQUEST; |
| 366 return OK; | 365 return OK; |
| 367 } | 366 } |
| 368 | 367 |
| 369 } // namespace net | 368 } // namespace net |
| OLD | NEW |