OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/browser/loader/downloaded_temp_file_impl.h" | |
6 | |
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | |
8 #include "mojo/public/cpp/bindings/strong_binding.h" | |
9 | |
10 namespace content { | |
11 namespace { | |
12 | |
13 void OnConnectionError(int child_id, int request_id) { | |
mmenke
2016/11/22 16:19:33
Can we just make this a member of DownloadedTempFi
tzik
2016/11/24 14:06:40
Done.
| |
14 ResourceDispatcherHostImpl::Get()->UnregisterDownloadedTempFile(child_id, | |
15 request_id); | |
16 } | |
17 | |
18 } // namespace | |
19 | |
20 // static | |
21 mojo::InterfacePtr<mojom::DownloadedTempFile> DownloadedTempFileImpl::Create( | |
22 int child_id, | |
23 int request_id) { | |
24 mojo::InterfacePtr<mojom::DownloadedTempFile> ptr; | |
25 auto binding = mojo::MakeStrongBinding( | |
26 base::MakeUnique<DownloadedTempFileImpl>(), mojo::GetProxy(&ptr)); | |
27 binding->set_connection_error_handler( | |
28 base::Bind(&OnConnectionError, child_id, request_id)); | |
29 return ptr; | |
30 } | |
31 | |
32 DownloadedTempFileImpl::~DownloadedTempFileImpl() {} | |
33 DownloadedTempFileImpl::DownloadedTempFileImpl() {} | |
34 | |
35 } // namespace content | |
OLD | NEW |