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