OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/loader/downloaded_temp_file_impl.h" | 5 #include "content/browser/loader/downloaded_temp_file_impl.h" |
6 | 6 |
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 #include "mojo/public/cpp/bindings/strong_binding.h" | 8 #include "mojo/public/cpp/bindings/strong_binding.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 // static | 12 // static |
13 mojo::InterfacePtr<mojom::DownloadedTempFile> DownloadedTempFileImpl::Create( | 13 mojo::InterfacePtr<mojom::DownloadedTempFile> DownloadedTempFileImpl::Create( |
14 int child_id, | 14 int child_id, |
15 int request_id) { | 15 int request_id) { |
16 mojo::InterfacePtr<mojom::DownloadedTempFile> ptr; | 16 mojo::InterfacePtr<mojom::DownloadedTempFile> ptr; |
17 auto binding = mojo::MakeStrongBinding( | 17 auto binding = mojo::MakeStrongBinding( |
18 base::MakeUnique<DownloadedTempFileImpl>(child_id, request_id), | 18 base::MakeUnique<DownloadedTempFileImpl>(child_id, request_id), |
19 mojo::GetProxy(&ptr)); | 19 mojo::MakeRequest(&ptr)); |
20 return ptr; | 20 return ptr; |
21 } | 21 } |
22 | 22 |
23 DownloadedTempFileImpl::~DownloadedTempFileImpl() { | 23 DownloadedTempFileImpl::~DownloadedTempFileImpl() { |
24 ResourceDispatcherHostImpl::Get()->UnregisterDownloadedTempFile(child_id_, | 24 ResourceDispatcherHostImpl::Get()->UnregisterDownloadedTempFile(child_id_, |
25 request_id_); | 25 request_id_); |
26 } | 26 } |
27 DownloadedTempFileImpl::DownloadedTempFileImpl(int child_id, int request_id) | 27 DownloadedTempFileImpl::DownloadedTempFileImpl(int child_id, int request_id) |
28 : child_id_(child_id), request_id_(request_id) {} | 28 : child_id_(child_id), request_id_(request_id) {} |
29 | 29 |
30 } // namespace content | 30 } // namespace content |
OLD | NEW |