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

Unified 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: rebase to master 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/push_messaging/stub_url_fetcher.cc
diff --git a/chrome/browser/extensions/api/push_messaging/stub_url_fetcher.cc b/chrome/browser/extensions/api/push_messaging/stub_url_fetcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c06a78e71d34ae34c455a184ec9912c033daf26b
--- /dev/null
+++ b/chrome/browser/extensions/api/push_messaging/stub_url_fetcher.cc
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "stub_url_fetcher.h"
+
+#include "net/base/host_port_pair.h"
+
+namespace net {
+
+// Stash away the body and retval we want to use.
+StubURLFetcher::StubURLFetcher(std::string fakeBody, bool retval) {
+ fakeBody_ = fakeBody;
+ retval_ = retval;
+}
+
+StubURLFetcher::~StubURLFetcher() {}
+
+bool StubURLFetcher::GetResponseAsString(std::string* outParam) const {
+ *outParam = fakeBody_;
+ return retval_;
+}
+
+// Unneeded virtual functions - do just enough to compile.
+int StubURLFetcher::GetLoadFlags() const { return 0; }
+int StubURLFetcher::GetMaxRetries() const { return 0; }
+base::TimeDelta StubURLFetcher::GetBackoffDelay() const {
+ return base::TimeDelta();
+}
+HttpResponseHeaders* StubURLFetcher::GetResponseHeaders() const {
+ return NULL;
+}
+HostPortPair StubURLFetcher::GetSocketAddress() const {
+ return HostPortPair();
+}
+bool StubURLFetcher::WasFetchedViaProxy() const {
+ return false;
+}
+const GURL& StubURLFetcher::GetOriginalURL() const { return gurl_; }
+const GURL& StubURLFetcher::GetURL() const { return gurl_; }
+const URLRequestStatus& StubURLFetcher::GetStatus() const {
+ return requestStatus_;
+}
+int StubURLFetcher::GetResponseCode() const { return 0; }
+const ResponseCookies& StubURLFetcher::GetCookies() const {
+ return responseCookies_;
+}
+bool StubURLFetcher::FileErrorOccurred(
+ base::PlatformFileError* out_error_code) const { return false; }
+bool StubURLFetcher::GetResponseAsFilePath(bool take_ownership,
+ FilePath* out_response_path) const {
+ return false;
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698