Created HttpResponseHeadersUtil.
Since the net stack is not an option with WKWebView, generate headers
from the WKNavigationResponse and pass them to the web state. Among
other things, this will enable the web state to have an accurate MIME
type.
BUG=478058
Review URL: https://codereview.chromium.org/1126843002
Cr-Commit-Position: refs/heads/master@{#331422}
diff --git a/ios/net/http_response_headers_util.h b/ios/net/http_response_headers_util.h
new file mode 100644
index 0000000..4bc00199
--- /dev/null
+++ b/ios/net/http_response_headers_util.h
@@ -0,0 +1,28 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_NET_HTTP_RESPONSE_HEADERS_UTIL_H_
+#define IOS_NET_HTTP_RESPONSE_HEADERS_UTIL_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "net/http/http_response_headers.h"
+
+@class NSHTTPURLResponse;
+
+namespace net {
+
+// Placeholder status description since the actual text from the headers is not
+// available.
+extern const std::string kDummyHttpStatusDescription;
+
+// Constructs a net::HttpResponseHeaders from |response|.
+// Note: The HTTP version and the status code description are not accessible
+// from NSHTTPURLResponse, so HTTP/1.0 and kDummyHttpStatusDescription will
+// be used in the status line instead.
+scoped_refptr<HttpResponseHeaders> CreateHeadersFromNSHTTPURLResponse(
+ NSHTTPURLResponse* response);
+
+} // namespace net
+
+#endif // IOS_NET_HTTP_RESPONSE_HEADERS_UTIL_H_