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

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') | no next file with comments »
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..dd90f4437fd43110254906c9a0d502e2c5666721 100644
--- a/chrome/common/net/test_url_fetcher_factory.h
+++ b/chrome/common/net/test_url_fetcher_factory.h
@@ -6,6 +6,7 @@
#define CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_
#pragma once
+#include <list>
#include <map>
#include <string>
#include <utility>
@@ -51,6 +52,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 +67,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698