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

Side by Side Diff: components/translate/core/browser/translate_url_fetcher.cc

Issue 378253002: Fix translate namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing android build errors Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/translate/core/browser/translate_url_fetcher.h" 5 #include "components/translate/core/browser/translate_url_fetcher.h"
6 6
7 #include "components/translate/core/browser/translate_download_manager.h" 7 #include "components/translate/core/browser/translate_download_manager.h"
8 #include "net/base/load_flags.h" 8 #include "net/base/load_flags.h"
9 #include "net/http/http_status_code.h" 9 #include "net/http/http_status_code.h"
10 #include "net/url_request/url_fetcher.h" 10 #include "net/url_request/url_fetcher.h"
11 #include "net/url_request/url_request_status.h" 11 #include "net/url_request/url_request_status.h"
12 12
13 namespace translate {
14
13 namespace { 15 namespace {
14 16
15 // Retry parameter for fetching. 17 // Retry parameter for fetching.
16 const int kMaxRetry = 16; 18 const int kMaxRetry = 16;
17 19
18 } // namespace 20 } // namespace
19 21
20 TranslateURLFetcher::TranslateURLFetcher(int id) : id_(id), 22 TranslateURLFetcher::TranslateURLFetcher(int id) : id_(id),
21 state_(IDLE), 23 state_(IDLE),
22 retry_count_(0) { 24 retry_count_(0) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 state_ = COMPLETED; 75 state_ = COMPLETED;
74 source->GetResponseAsString(&data); 76 source->GetResponseAsString(&data);
75 } else { 77 } else {
76 state_ = FAILED; 78 state_ = FAILED;
77 } 79 }
78 80
79 // Transfer URLFetcher's ownership before invoking a callback. 81 // Transfer URLFetcher's ownership before invoking a callback.
80 scoped_ptr<const net::URLFetcher> delete_ptr(fetcher_.release()); 82 scoped_ptr<const net::URLFetcher> delete_ptr(fetcher_.release());
81 callback_.Run(id_, state_ == COMPLETED, data); 83 callback_.Run(id_, state_ == COMPLETED, data);
82 } 84 }
85
86 } // namespace translate
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_url_fetcher.h ('k') | components/translate/core/browser/translate_url_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698