update_engine: Attach session ID to HTTP header of binary download
In order for Omaha to correlate Omaha Client requests with the actual
binary download, the session ID must be attached to the HTTP header of
the binary download in the X-Goog-Update-SessionId.
Also, remove the HTTP header of X-Goog-Update-SessionId added into the
Omaha requests.
BUG=chromium:940515
TEST=unittests # new unittests
Change-Id: I0759562f2d1c8c003064ad976ca1ae6ce039b960
diff --git a/common/http_fetcher.h b/common/http_fetcher.h
index 93b0e24..94f31d7 100644
--- a/common/http_fetcher.h
+++ b/common/http_fetcher.h
@@ -100,6 +100,14 @@
virtual void SetHeader(const std::string& header_name,
const std::string& header_value) = 0;
+ // Only used for testing.
+ // If |header_name| is set, the value will be set into |header_value|.
+ // On success the boolean true will be returned, hoewever on failture to find
+ // the |header_name| in the header the return value will be false. The state
+ // in which |header_value| is left in for failures is an empty string.
+ virtual bool GetHeader(const std::string& header_name,
+ std::string* header_value) const = 0;
+
// If data is coming in too quickly, you can call Pause() to pause the
// transfer. The delegate will not have ReceivedBytes() called while
// an HttpFetcher is paused.