| Index: net/spdy/spdy_http_utils.cc
|
| diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
|
| index 005b1987a2f5c54ef3c2f73067cced3fc8d18cba..24cd83c9faa157350678714b31e63eebdd19fb2e 100644
|
| --- a/net/spdy/spdy_http_utils.cc
|
| +++ b/net/spdy/spdy_http_utils.cc
|
| @@ -4,8 +4,6 @@
|
|
|
| #include "net/spdy/spdy_http_utils.h"
|
|
|
| -#include <string>
|
| -
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| @@ -18,19 +16,20 @@
|
| #include "net/http/http_response_headers.h"
|
| #include "net/http/http_response_info.h"
|
| #include "net/http/http_util.h"
|
| +#include "net/spdy/platform/api/spdy_string.h"
|
| #include "net/spdy/platform/api/spdy_string_piece.h"
|
|
|
| namespace net {
|
|
|
| namespace {
|
|
|
| -void AddSpdyHeader(const std::string& name,
|
| - const std::string& value,
|
| +void AddSpdyHeader(const SpdyString& name,
|
| + const SpdyString& value,
|
| SpdyHeaderBlock* headers) {
|
| if (headers->find(name) == headers->end()) {
|
| (*headers)[name] = value;
|
| } else {
|
| - std::string joint_value = (*headers)[name].as_string();
|
| + SpdyString joint_value = (*headers)[name].as_string();
|
| joint_value.append(1, '\0');
|
| joint_value.append(value);
|
| (*headers)[name] = joint_value;
|
| @@ -45,8 +44,8 @@ bool SpdyHeadersToHttpResponse(const SpdyHeaderBlock& headers,
|
| SpdyHeaderBlock::const_iterator it = headers.find(":status");
|
| if (it == headers.end())
|
| return false;
|
| - std::string status = it->second.as_string();
|
| - std::string raw_headers("HTTP/1.1 ");
|
| + SpdyString status = it->second.as_string();
|
| + SpdyString raw_headers("HTTP/1.1 ");
|
| raw_headers.append(status);
|
| raw_headers.push_back('\0');
|
| for (it = headers.begin(); it != headers.end(); ++it) {
|
| @@ -58,12 +57,12 @@ bool SpdyHeadersToHttpResponse(const SpdyHeaderBlock& headers,
|
| // becomes
|
| // Set-Cookie: foo\0
|
| // Set-Cookie: bar\0
|
| - std::string value = it->second.as_string();
|
| + SpdyString value = it->second.as_string();
|
| size_t start = 0;
|
| size_t end = 0;
|
| do {
|
| end = value.find('\0', start);
|
| - std::string tval;
|
| + SpdyString tval;
|
| if (end != value.npos)
|
| tval = value.substr(start, (end - start));
|
| else
|
| @@ -99,7 +98,7 @@ void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
|
|
|
| HttpRequestHeaders::Iterator it(request_headers);
|
| while (it.GetNext()) {
|
| - std::string name = base::ToLowerASCII(it.name());
|
| + SpdyString name = base::ToLowerASCII(it.name());
|
| if (name.empty() || name[0] == ':' || name == "connection" ||
|
| name == "proxy-connection" || name == "transfer-encoding" ||
|
| name == "host") {
|
| @@ -150,7 +149,7 @@ GURL GetUrlFromHeaderBlock(const SpdyHeaderBlock& headers) {
|
| SpdyHeaderBlock::const_iterator it = headers.find(":scheme");
|
| if (it == headers.end())
|
| return GURL();
|
| - std::string url = it->second.as_string();
|
| + SpdyString url = it->second.as_string();
|
| url.append("://");
|
|
|
| it = headers.find(":authority");
|
|
|