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

Unified Diff: chrome/browser/local_discovery/privet_url_fetcher.h

Issue 156143002: Add ability to get raw data and range requests to to PrivetURLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_url_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/privet_url_fetcher.h
diff --git a/chrome/browser/local_discovery/privet_url_fetcher.h b/chrome/browser/local_discovery/privet_url_fetcher.h
index f3b7405378d0cc73385b7162db9ac81ef0ef5479..1bd66c12d396e5e0dd63878f61759b89ae939cda 100644
--- a/chrome/browser/local_discovery/privet_url_fetcher.h
+++ b/chrome/browser/local_discovery/privet_url_fetcher.h
@@ -51,6 +51,14 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
virtual void OnParsedJson(PrivetURLFetcher* fetcher,
const base::DictionaryValue* value,
bool has_error) = 0;
+
+ // If this method is returns true, the data will not be parsed as JSON, and
+ // |OnParsedJson| will not be called. Otherwise, |OnParsedJson| will be
+ // called.
+ virtual bool OnRawData(PrivetURLFetcher* fetcher,
+ bool response_is_file,
+ const std::string& data_string,
+ const base::FilePath& data_file);
};
PrivetURLFetcher(
@@ -65,6 +73,14 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
void AllowEmptyPrivetToken();
+ // Set the contents of the Range header. |OnRawData| must return true if this
+ // is called.
+ void SetByteRange(int start, int end);
+
+ // Save the response to a file. |OnRawData| must return true if this is
+ // called.
+ void SaveResponseToFile();
+
void Start();
void SetUploadData(const std::string& upload_content_type,
@@ -74,6 +90,8 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
const base::FilePath& upload_file_path);
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+ void OnURLFetchCompleteParseData(const net::URLFetcher* source);
+ bool OnURLFetchCompleteDoNotParseData(const net::URLFetcher* source);
const GURL& url() const { return url_fetcher_->GetOriginalURL(); }
int response_code() const { return url_fetcher_->GetResponseCode(); }
@@ -93,6 +111,11 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
bool do_not_retry_on_transient_error_;
bool allow_empty_privet_token_;
+ bool has_byte_range_;
+ bool make_response_file_;
+
+ int byte_range_start_;
+ int byte_range_end_;
int tries_;
std::string upload_data_;
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698