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

Side by Side Diff: chrome/browser/extensions/api/push_messaging/stub_url_fetcher.cc

Issue 10836182: Obfuscated Gaia ID fetcher (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4 #include "stub_url_fetcher.h"
5
6 #include "net/base/host_port_pair.h"
7
8 namespace net {
9
10 // stash away the body and retval we want to use
11 StubURLFetcher::StubURLFetcher(std::string fakeBody, bool retval) {
12 fakeBody_ = fakeBody;
13 retval_ = retval;
14 }
15
16 StubURLFetcher::~StubURLFetcher() {}
17
18 bool StubURLFetcher::GetResponseAsString(std::string* outParam) const {
19 *outParam = fakeBody_;
20 return retval_;
21 }
22
23 // unneeded virtual functions - do just enough to compile
24 int StubURLFetcher::GetLoadFlags() const { return 0; }
25 int StubURLFetcher::GetMaxRetries() const { return 0; }
26 base::TimeDelta StubURLFetcher::GetBackoffDelay() const {
27 return base::TimeDelta();
28 }
29 HttpResponseHeaders* StubURLFetcher::GetResponseHeaders() const {
30 return NULL;
31 }
32 HostPortPair StubURLFetcher::GetSocketAddress() const {
33 return HostPortPair();
34 }
35 bool StubURLFetcher::WasFetchedViaProxy() const {
36 return false;
37 }
38 const GURL& StubURLFetcher::GetOriginalURL() const { return gurl_; }
39 const GURL& StubURLFetcher::GetURL() const { return gurl_; }
40 const URLRequestStatus& StubURLFetcher::GetStatus() const {
41 return requestStatus_;
42 }
43 int StubURLFetcher::GetResponseCode() const { return 0; }
44 const ResponseCookies& StubURLFetcher::GetCookies() const {
45 return responseCookies_;
46 }
47 bool StubURLFetcher::FileErrorOccurred(
48 base::PlatformFileError* out_error_code) const { return false; }
49 bool StubURLFetcher::GetResponseAsFilePath(bool take_ownership,
50 FilePath* out_response_path) const {
51 return false;
52 }
53
54 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698