| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h" | 5 #include "extensions/browser/api/mime_handler_private/mime_handler_private.h" |
| 6 | 6 |
| 7 #include "content/public/browser/stream_handle.h" | 7 #include "content/public/browser/stream_handle.h" |
| 8 #include "content/public/browser/stream_info.h" | 8 #include "content/public/browser/stream_info.h" |
| 9 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues
t.h" | 9 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues
t.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| 11 #include "mojo/public/cpp/bindings/map.h" | |
| 12 #include "net/http/http_response_headers.h" | 11 #include "net/http/http_response_headers.h" |
| 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/map.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 mojo::Map<mojo::String, mojo::String> CreateResponseHeadersMap( | 17 mojo::Map<mojo::String, mojo::String> CreateResponseHeadersMap( |
| 18 const net::HttpResponseHeaders* headers) { | 18 const net::HttpResponseHeaders* headers) { |
| 19 std::map<std::string, std::string> result; | 19 std::map<std::string, std::string> result; |
| 20 if (!headers) | 20 if (!headers) |
| 21 return mojo::Map<mojo::String, mojo::String>::From(result); | 21 return mojo::Map<mojo::String, mojo::String>::From(result); |
| 22 | 22 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const content::StreamInfo* info = stream.stream_info(); | 86 const content::StreamInfo* info = stream.stream_info(); |
| 87 result->mime_type = info->mime_type; | 87 result->mime_type = info->mime_type; |
| 88 result->original_url = info->original_url.spec(); | 88 result->original_url = info->original_url.spec(); |
| 89 result->stream_url = info->handle->GetURL().spec(); | 89 result->stream_url = info->handle->GetURL().spec(); |
| 90 result->response_headers = | 90 result->response_headers = |
| 91 extensions::CreateResponseHeadersMap(info->response_headers.get()); | 91 extensions::CreateResponseHeadersMap(info->response_headers.get()); |
| 92 return result.Pass(); | 92 return result.Pass(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace mojo | 95 } // namespace mojo |
| OLD | NEW |