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

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

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: move to dtor Created 4 years, 1 month 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
new file mode 100644
index 0000000000000000000000000000000000000000..3109f9026886721bb7f96332713b018d1d0df39a
--- /dev/null
+++ b/content/browser/loader/downloaded_temp_file_impl.cc
@@ -0,0 +1,30 @@
+// 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 {
+
+// 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>(child_id, request_id),
+ mojo::GetProxy(&ptr));
+ return ptr;
+}
+
+DownloadedTempFileImpl::~DownloadedTempFileImpl() {
+ ResourceDispatcherHostImpl::Get()->UnregisterDownloadedTempFile(child_id_,
+ request_id_);
+}
+DownloadedTempFileImpl::DownloadedTempFileImpl(int child_id, int request_id)
+ : child_id_(child_id), request_id_(request_id) {}
+
+} // namespace content
« no previous file with comments | « content/browser/loader/downloaded_temp_file_impl.h ('k') | content/browser/loader/mojo_async_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698