Chromium Code Reviews| Index: content/browser/loader/downloaded_temp_file_impl.cc |
| diff --git a/content/browser/loader/downloaded_temp_file_impl.cc b/content/browser/loader/downloaded_temp_file_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3b27d4356a8d462c05f1b3b97c32938cd91b570f |
| --- /dev/null |
| +++ b/content/browser/loader/downloaded_temp_file_impl.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2016 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. |
| + |
| +#include "content/browser/loader/downloaded_temp_file_impl.h" |
| + |
| +#include "content/browser/loader/resource_dispatcher_host_impl.h" |
| +#include "mojo/public/cpp/bindings/strong_binding.h" |
| + |
| +namespace content { |
| +namespace { |
| + |
| +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.
|
| + ResourceDispatcherHostImpl::Get()->UnregisterDownloadedTempFile(child_id, |
| + request_id); |
| +} |
| + |
| +} // namespace |
| + |
| +// static |
| +mojo::InterfacePtr<mojom::DownloadedTempFile> DownloadedTempFileImpl::Create( |
| + int child_id, |
| + int request_id) { |
| + mojo::InterfacePtr<mojom::DownloadedTempFile> ptr; |
| + auto binding = mojo::MakeStrongBinding( |
| + base::MakeUnique<DownloadedTempFileImpl>(), mojo::GetProxy(&ptr)); |
| + binding->set_connection_error_handler( |
| + base::Bind(&OnConnectionError, child_id, request_id)); |
| + return ptr; |
| +} |
| + |
| +DownloadedTempFileImpl::~DownloadedTempFileImpl() {} |
| +DownloadedTempFileImpl::DownloadedTempFileImpl() {} |
| + |
| +} // namespace content |