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

Unified Diff: chrome/common/net/test_url_fetcher_factory.h

Issue 6615020: Stream speech audio to server as it gets recorded, instead of waiting until end of recording. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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/common/net/test_url_fetcher_factory.cc » ('j') | chrome/common/net/url_fetcher.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/test_url_fetcher_factory.h
diff --git a/chrome/common/net/test_url_fetcher_factory.h b/chrome/common/net/test_url_fetcher_factory.h
index 65625a40907d215dd15d275554b72dd6911d94b1..8b5dbe4dfd25618beba69773e1905e6b1d6e604b 100644
--- a/chrome/common/net/test_url_fetcher_factory.h
+++ b/chrome/common/net/test_url_fetcher_factory.h
@@ -51,6 +51,10 @@ class TestURLFetcher : public URLFetcher {
// Overriden to do nothing. It is assumed the caller will notify the delegate.
virtual void Start() {}
+ // Overriden to cache the chunks uploaded. Caller can read back the uploaded
+ // chunks with the upload_data() accessor.
+ virtual void AppendChunkToUpload(const std::string& data, bool is_last_chunk);
+
// Unique ID in our factory.
int id() const { return id_; }
@@ -62,12 +66,17 @@ class TestURLFetcher : public URLFetcher {
// Returns the data uploaded on this URLFetcher.
const std::string& upload_data() const { return URLFetcher::upload_data(); }
+ // Returns the chunks of data uploaded on this URLFetcher.
+ const std::list<std::string>& upload_chunks() const { return chunks_; }
+
// Returns the delegate installed on the URLFetcher.
Delegate* delegate() const { return URLFetcher::delegate(); }
private:
const int id_;
const GURL original_url_;
+ std::list<std::string> chunks_;
+ bool did_receive_last_chunk_;
DISALLOW_COPY_AND_ASSIGN(TestURLFetcher);
};
« no previous file with comments | « no previous file | chrome/common/net/test_url_fetcher_factory.cc » ('j') | chrome/common/net/url_fetcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698