Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/browser/net/sdch_dictionary_fetcher.cc

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/sdch_dictionary_fetcher.h ('k') | chrome/browser/plugin_download_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/net/sdch_dictionary_fetcher.h ('k') | chrome/browser/plugin_download_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698