Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: content/browser/loader/downloaded_temp_file_impl.cc

Issue 2561743003: Use associated interface on DownloadedTempFile (Closed)
Patch Set: +NOTREACHED on non frame trasfer Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c8cdd02ae90b80b8007d3c94c737ccc5893d8cdd..10b9c8ef4cfc926d1230a04c4f61baebc7719301 100644
--- a/content/browser/loader/downloaded_temp_file_impl.cc
+++ b/content/browser/loader/downloaded_temp_file_impl.cc
@@ -6,16 +6,33 @@
#include "base/memory/ptr_util.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));
+ 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::MakeRequest(&ptr));
return ptr;
« no previous file with comments | « content/browser/loader/downloaded_temp_file_impl.h ('k') | content/browser/loader/mojo_async_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698