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

Side by Side Diff: chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/spellchecker/spellcheck_hunspell_dictionary.h" 5 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/memory_mapped_file.h" 8 #include "base/files/memory_mapped_file.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 base::StringToLowerASCII(bdict_file)); 223 base::StringToLowerASCII(bdict_file));
224 } 224 }
225 225
226 void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) { 226 void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
227 DCHECK_CURRENTLY_ON(BrowserThread::UI); 227 DCHECK_CURRENTLY_ON(BrowserThread::UI);
228 DCHECK(request_context_getter_); 228 DCHECK(request_context_getter_);
229 229
230 download_status_ = DOWNLOAD_IN_PROGRESS; 230 download_status_ = DOWNLOAD_IN_PROGRESS;
231 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryDownloadBegin()); 231 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryDownloadBegin());
232 232
233 fetcher_.reset(net::URLFetcher::Create(url, net::URLFetcher::GET, this)); 233 fetcher_ = net::URLFetcher::Create(url, net::URLFetcher::GET, this);
234 fetcher_->SetRequestContext(request_context_getter_); 234 fetcher_->SetRequestContext(request_context_getter_);
235 fetcher_->SetLoadFlags( 235 fetcher_->SetLoadFlags(
236 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES); 236 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES);
237 fetcher_->Start(); 237 fetcher_->Start();
238 // Attempt downloading the dictionary only once. 238 // Attempt downloading the dictionary only once.
239 request_context_getter_ = NULL; 239 request_context_getter_ = NULL;
240 } 240 }
241 241
242 // The default_dictionary_file can either come from the standard list of 242 // The default_dictionary_file can either come from the standard list of
243 // hunspell dictionaries (determined in InitializeDictionaryLocation), or it 243 // hunspell dictionaries (determined in InitializeDictionaryLocation), or it
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 void SpellcheckHunspellDictionary::InformListenersOfInitialization() { 348 void SpellcheckHunspellDictionary::InformListenersOfInitialization() {
349 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryInitialized()); 349 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryInitialized());
350 } 350 }
351 351
352 void SpellcheckHunspellDictionary::InformListenersOfDownloadFailure() { 352 void SpellcheckHunspellDictionary::InformListenersOfDownloadFailure() {
353 download_status_ = DOWNLOAD_FAILED; 353 download_status_ = DOWNLOAD_FAILED;
354 FOR_EACH_OBSERVER(Observer, 354 FOR_EACH_OBSERVER(Observer,
355 observers_, 355 observers_,
356 OnHunspellDictionaryDownloadFailure()); 356 OnHunspellDictionaryDownloadFailure());
357 } 357 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/feedback_sender.cc ('k') | chrome/browser/spellchecker/spelling_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698