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 "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/common/url_fetcher.h" | 10 #include "content/public/common/url_fetcher.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 current_fetch_->SetRequestContext(context); | 71 current_fetch_->SetRequestContext(context); |
72 current_fetch_->Start(); | 72 current_fetch_->Start(); |
73 } | 73 } |
74 | 74 |
75 void SdchDictionaryFetcher::OnURLFetchComplete( | 75 void SdchDictionaryFetcher::OnURLFetchComplete( |
76 const content::URLFetcher* source) { | 76 const content::URLFetcher* source) { |
77 if ((200 == source->GetResponseCode()) && | 77 if ((200 == source->GetResponseCode()) && |
78 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS)) { | 78 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS)) { |
79 std::string data; | 79 std::string data; |
80 source->GetResponseAsString(&data); | 80 source->GetResponseAsString(&data); |
81 net::SdchManager::Global()->AddSdchDictionary(data, source->GetUrl()); | 81 net::SdchManager::Global()->AddSdchDictionary(data, source->GetURL()); |
82 } | 82 } |
83 current_fetch_.reset(NULL); | 83 current_fetch_.reset(NULL); |
84 ScheduleDelayedRun(); | 84 ScheduleDelayedRun(); |
85 } | 85 } |
OLD | NEW |