| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/net/sdch_dictionary_fetcher.h" | 5 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "content/common/net/url_fetcher.h" | 9 #include "content/common/net/url_fetcher.h" |
| 10 #include "net/url_request/url_request_status.h" | 10 #include "net/url_request/url_request_status.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Shutdown in progress. | 60 // Shutdown in progress. |
| 61 // Simulate handling of all dictionary requests by clearing queue. | 61 // Simulate handling of all dictionary requests by clearing queue. |
| 62 while (!fetch_queue_.empty()) | 62 while (!fetch_queue_.empty()) |
| 63 fetch_queue_.pop(); | 63 fetch_queue_.pop(); |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 | 66 |
| 67 current_fetch_.reset(new URLFetcher(fetch_queue_.front(), URLFetcher::GET, | 67 current_fetch_.reset(new URLFetcher(fetch_queue_.front(), URLFetcher::GET, |
| 68 this)); | 68 this)); |
| 69 fetch_queue_.pop(); | 69 fetch_queue_.pop(); |
| 70 current_fetch_->set_request_context(context); | 70 current_fetch_->SetRequestContext(context); |
| 71 current_fetch_->Start(); | 71 current_fetch_->Start(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void SdchDictionaryFetcher::OnURLFetchComplete(const URLFetcher* source) { | 74 void SdchDictionaryFetcher::OnURLFetchComplete( |
| 75 if ((200 == source->response_code()) && | 75 const content::URLFetcher* source) { |
| 76 (source->status().status() == net::URLRequestStatus::SUCCESS)) { | 76 if ((200 == source->GetResponseCode()) && |
| 77 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS)) { |
| 77 std::string data; | 78 std::string data; |
| 78 source->GetResponseAsString(&data); | 79 source->GetResponseAsString(&data); |
| 79 net::SdchManager::Global()->AddSdchDictionary(data, source->url()); | 80 net::SdchManager::Global()->AddSdchDictionary(data, source->GetUrl()); |
| 80 } | 81 } |
| 81 current_fetch_.reset(NULL); | 82 current_fetch_.reset(NULL); |
| 82 ScheduleDelayedRun(); | 83 ScheduleDelayedRun(); |
| 83 } | 84 } |
| OLD | NEW |