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 |
| index 3109f9026886721bb7f96332713b018d1d0df39a..7bc0cd9c8557c95cb6f4ceded0e01b3b8fc98d64 100644 |
| --- a/content/browser/loader/downloaded_temp_file_impl.cc |
| +++ b/content/browser/loader/downloaded_temp_file_impl.cc |
| @@ -5,16 +5,33 @@ |
| #include "content/browser/loader/downloaded_temp_file_impl.h" |
| #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| +#include "mojo/public/cpp/bindings/associated_group.h" |
| +#include "mojo/public/cpp/bindings/strong_associated_binding.h" |
| #include "mojo/public/cpp/bindings/strong_binding.h" |
| namespace content { |
| // static |
| -mojo::InterfacePtr<mojom::DownloadedTempFile> DownloadedTempFileImpl::Create( |
| +mojom::DownloadedTempFileAssociatedPtrInfo DownloadedTempFileImpl::Create( |
| + mojo::AssociatedGroup* associated_group, |
| + int child_id, |
| + int request_id) { |
| + mojo::AssociatedInterfacePtrInfo<mojom::DownloadedTempFile> ptr_info; |
| + mojo::AssociatedInterfaceRequest<mojom::DownloadedTempFile> request; |
| + associated_group->CreateAssociatedInterface( |
| + mojo::AssociatedGroup::WILL_PASS_PTR, &ptr_info, &request); |
| + mojo::MakeStrongAssociatedBinding( |
| + base::MakeUnique<DownloadedTempFileImpl>(child_id, request_id), |
| + std::move(request)); |
|
mmenke
2016/12/15 16:48:19
Sorry for all the round trips, but I really have n
mmenke
2016/12/15 16:51:08
And if we want Mojo to be the way for everyone to
tzik
2017/01/05 10:47:56
Hmm, I don't have good explanation that.
Yuzhu: Co
yzshen1
2017/01/13 15:55:03
AssociatedInterfacePtrInfo is the "handle" that co
mmenke
2017/01/13 17:48:33
I agree with this, which is why I was shocked to f
|
| + return ptr_info; |
| +} |
| + |
| +// static |
| +mojom::DownloadedTempFilePtr DownloadedTempFileImpl::CreateForTesting( |
| int child_id, |
| int request_id) { |
| mojo::InterfacePtr<mojom::DownloadedTempFile> ptr; |
| - auto binding = mojo::MakeStrongBinding( |
| + mojo::MakeStrongBinding( |
| base::MakeUnique<DownloadedTempFileImpl>(child_id, request_id), |
| mojo::GetProxy(&ptr)); |
| return ptr; |