| Index: net/http/http_response_info.cc
|
| diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
|
| index be6fa4f8a1fa67ffabee94d2978c024565b9b03b..7980dc17a54b55e7a86dae09fe4fb773f2677162 100644
|
| --- a/net/http/http_response_info.cc
|
| +++ b/net/http/http_response_info.cc
|
| @@ -91,6 +91,9 @@ enum {
|
| // This bit is set if ssl_info has SCTs.
|
| RESPONSE_INFO_HAS_SIGNED_CERTIFICATE_TIMESTAMPS = 1 << 20,
|
|
|
| + // This bit is set if the response was received via a ServiceWorker .
|
| + RESPONSE_INFO_WAS_SERVICE_WORKER = 1 << 21,
|
| +
|
| // TODO(darin): Add other bits to indicate alternate request methods.
|
| // For now, we don't support storing those.
|
| };
|
| @@ -103,6 +106,7 @@ HttpResponseInfo::HttpResponseInfo()
|
| was_npn_negotiated(false),
|
| was_fetched_via_proxy(false),
|
| did_use_http_auth(false),
|
| + was_fetched_via_service_worker(false),
|
| connection_info(CONNECTION_INFO_UNKNOWN) {
|
| }
|
|
|
| @@ -115,6 +119,8 @@ HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs)
|
| was_fetched_via_proxy(rhs.was_fetched_via_proxy),
|
| proxy_server(rhs.proxy_server),
|
| did_use_http_auth(rhs.did_use_http_auth),
|
| + was_fetched_via_service_worker(rhs.was_fetched_via_service_worker),
|
| + original_url_via_service_worker(rhs.original_url_via_service_worker),
|
| socket_address(rhs.socket_address),
|
| npn_negotiated_protocol(rhs.npn_negotiated_protocol),
|
| connection_info(rhs.connection_info),
|
| @@ -140,6 +146,8 @@ HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) {
|
| was_npn_negotiated = rhs.was_npn_negotiated;
|
| was_fetched_via_proxy = rhs.was_fetched_via_proxy;
|
| did_use_http_auth = rhs.did_use_http_auth;
|
| + was_fetched_via_service_worker = rhs.was_fetched_via_service_worker;
|
| + original_url_via_service_worker = rhs.original_url_via_service_worker;
|
| socket_address = rhs.socket_address;
|
| npn_negotiated_protocol = rhs.npn_negotiated_protocol;
|
| connection_info = rhs.connection_info;
|
| @@ -267,6 +275,14 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
|
| }
|
| }
|
|
|
| + // Read ServiceWorker info.
|
| + if (flags & RESPONSE_INFO_WAS_SERVICE_WORKER) {
|
| + std::string original_url;
|
| + if (!pickle.ReadString(&iter, &original_url))
|
| + return false;
|
| + original_url_via_service_worker = GURL(original_url);
|
| + }
|
| +
|
| was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0;
|
|
|
| was_npn_negotiated = (flags & RESPONSE_INFO_WAS_NPN) != 0;
|
| @@ -277,6 +293,9 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
|
|
|
| did_use_http_auth = (flags & RESPONSE_INFO_USE_HTTP_AUTHENTICATION) != 0;
|
|
|
| + was_fetched_via_service_worker =
|
| + (flags & RESPONSE_INFO_WAS_SERVICE_WORKER) != 0;
|
| +
|
| return true;
|
| }
|
|
|
| @@ -310,6 +329,8 @@ void HttpResponseInfo::Persist(Pickle* pickle,
|
| flags |= RESPONSE_INFO_USE_HTTP_AUTHENTICATION;
|
| if (!ssl_info.signed_certificate_timestamps.empty())
|
| flags |= RESPONSE_INFO_HAS_SIGNED_CERTIFICATE_TIMESTAMPS;
|
| + if (was_fetched_via_service_worker)
|
| + flags |= RESPONSE_INFO_WAS_SERVICE_WORKER;
|
|
|
| pickle->WriteInt(flags);
|
| pickle->WriteInt64(request_time.ToInternalValue());
|
| @@ -359,6 +380,9 @@ void HttpResponseInfo::Persist(Pickle* pickle,
|
|
|
| if (connection_info != CONNECTION_INFO_UNKNOWN)
|
| pickle->WriteInt(static_cast<int>(connection_info));
|
| +
|
| + if (was_fetched_via_service_worker)
|
| + pickle->WriteString(original_url_via_service_worker.spec());
|
| }
|
|
|
| HttpResponseInfo::ConnectionInfo HttpResponseInfo::ConnectionInfoFromNextProto(
|
|
|