| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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 "net/url_request/url_request_status.h" | 9 #include "net/url_request/url_request_status.h" |
| 10 | 10 |
| 11 SdchDictionaryFetcher::SdchDictionaryFetcher() | 11 SdchDictionaryFetcher::SdchDictionaryFetcher() |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 | 59 |
| 60 current_fetch_.reset(new URLFetcher(fetch_queue_.front(), URLFetcher::GET, | 60 current_fetch_.reset(new URLFetcher(fetch_queue_.front(), URLFetcher::GET, |
| 61 this)); | 61 this)); |
| 62 fetch_queue_.pop(); | 62 fetch_queue_.pop(); |
| 63 current_fetch_->set_request_context(context); | 63 current_fetch_->set_request_context(context); |
| 64 current_fetch_->Start(); | 64 current_fetch_->Start(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void SdchDictionaryFetcher::OnURLFetchComplete(const URLFetcher* source, | 67 void SdchDictionaryFetcher::OnURLFetchComplete( |
| 68 const GURL& url, | 68 const URLFetcher* source, |
| 69 const URLRequestStatus& status, | 69 const GURL& url, |
| 70 int response_code, | 70 const net::URLRequestStatus& status, |
| 71 const ResponseCookies& cookies, | 71 int response_code, |
| 72 const std::string& data) { | 72 const ResponseCookies& cookies, |
| 73 if ((200 == response_code) && (status.status() == URLRequestStatus::SUCCESS)) | 73 const std::string& data) { |
| 74 if ((200 == response_code) && |
| 75 (status.status() == net::URLRequestStatus::SUCCESS)) |
| 74 SdchManager::Global()->AddSdchDictionary(data, url); | 76 SdchManager::Global()->AddSdchDictionary(data, url); |
| 75 current_fetch_.reset(NULL); | 77 current_fetch_.reset(NULL); |
| 76 ScheduleDelayedRun(); | 78 ScheduleDelayedRun(); |
| 77 } | 79 } |
| OLD | NEW |