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

Unified Diff: chrome/browser/extensions/api/push_messaging/stub_url_fetcher.h

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/push_messaging/stub_url_fetcher.h
diff --git a/chrome/browser/extensions/api/push_messaging/stub_url_fetcher.h b/chrome/browser/extensions/api/push_messaging/stub_url_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..1811edfbe232bea4e131235d9dd8a2541f3ede0b
--- /dev/null
+++ b/chrome/browser/extensions/api/push_messaging/stub_url_fetcher.h
@@ -0,0 +1,83 @@
+// 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.
+
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_STUB_URL_FETCHER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_STUB_URL_FETCHER_H_
+
+
+#include "net/url_request/url_fetcher.h"
+#include "googleurl/src/gurl.h"
+#include "net/url_request/url_request_status.h"
+
+namespace net {
+
+class StubURLFetcher : public URLFetcher {
Munjal (Google) 2012/08/09 21:44:29 What do you need this class for? If for testing, t
Pete Williamson 2012/08/13 21:21:14 I took a look at FakeURLFetcher and TestURLFetcher
Pete Williamson 2012/08/20 18:38:42 Done. I found out that I could use the FakeURLFet
+ public:
+ StubURLFetcher(std::string fakeBody, bool retval);
+ virtual ~StubURLFetcher();
+
+ // unneeded virtual functions - do just enough to compile
+ virtual void SetUploadData(const std::string& upload_content_type,
+ const std::string& upload_content) OVERRIDE {}
+ virtual void SetChunkedUpload(const std::string& upload_content_type)
+ OVERRIDE {}
+ virtual void AppendChunkToUpload(const std::string& data,
+ bool is_last_chunk) OVERRIDE {}
+ virtual void SetLoadFlags(int load_flags) OVERRIDE {}
+ virtual int GetLoadFlags() const OVERRIDE;
+ virtual void SetReferrer(const std::string& referrer) OVERRIDE {}
+ virtual void SetExtraRequestHeaders(
+ const std::string& extra_request_headers) OVERRIDE {}
+ virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE {}
+ virtual void GetExtraRequestHeaders(
+ HttpRequestHeaders* headers) const OVERRIDE {}
+ virtual void SetRequestContext(
+ URLRequestContextGetter* request_context_getter) OVERRIDE {}
+ virtual void SetFirstPartyForCookies(
+ const GURL& first_party_for_cookies) OVERRIDE {}
+ virtual void SetURLRequestUserData(
+ const void* key,
+ const CreateDataCallback& create_data_callback) OVERRIDE {}
+ virtual void SetStopOnRedirect(bool stop_on_redirect) OVERRIDE {}
+ virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE {}
+ virtual void SetMaxRetries(int max_retries) OVERRIDE {}
+ virtual int GetMaxRetries() const OVERRIDE;
+ virtual base::TimeDelta GetBackoffDelay() const OVERRIDE;
+ virtual void SaveResponseToFileAtPath(
+ const FilePath& file_path,
+ scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE {}
+ virtual void SaveResponseToTemporaryFile(
+ scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE {}
+ virtual HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
+ virtual HostPortPair GetSocketAddress() const OVERRIDE;
+ virtual bool WasFetchedViaProxy() const OVERRIDE;
+ virtual void Start() OVERRIDE {}
+ virtual const GURL& GetOriginalURL() const OVERRIDE;
+ virtual const GURL& GetURL() const OVERRIDE;
+ virtual const URLRequestStatus& GetStatus() const OVERRIDE;
+ virtual int GetResponseCode() const OVERRIDE;
+ virtual const ResponseCookies& GetCookies() const OVERRIDE;
+ virtual bool FileErrorOccurred(
+ base::PlatformFileError* out_error_code) const OVERRIDE;
+ virtual void ReceivedContentWasMalformed() OVERRIDE {}
+ virtual bool GetResponseAsString(std::string* out_response_string)
+ const OVERRIDE;
+ virtual bool GetResponseAsFilePath(bool take_ownership,
+ FilePath* out_response_path)
+ const OVERRIDE;
+
+ private:
+ std::string fakeBody_;
+ bool retval_;
+ GURL gurl_;
+ ResponseCookies responseCookies_;
+ URLRequestStatus requestStatus_;
+};
+
+
+} // namespace net
+
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_STUB_URL_FETCHER_H_

Powered by Google App Engine
This is Rietveld 408576698