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

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

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: revert an unrelated change 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.h
diff --git a/content/browser/loader/downloaded_temp_file_impl.h b/content/browser/loader/downloaded_temp_file_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b1421afa0d482f888adb412106fa583fa0cbdbc
--- /dev/null
+++ b/content/browser/loader/downloaded_temp_file_impl.h
@@ -0,0 +1,59 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_
+#define CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_
+
+#include "base/files/file_path.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+#include "content/common/url_loader_factory.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace storage {
+class ShareableFileReference;
+}
+
+namespace content {
+
+class ResourceDispatcherHostImpl;
+
+class CONTENT_EXPORT DownloadedTempFileImpl final
mmenke 2016/11/15 15:59:05 Docs?
tzik 2016/11/16 09:14:56 Done.
+ : public mojom::DownloadedTempFile {
+ public:
+ DownloadedTempFileImpl(ResourceDispatcherHostImpl* rdh,
+ int child_id,
+ int request_id,
+ const base::FilePath& path);
+ ~DownloadedTempFileImpl() override;
+
+ // mojo::DownloadedTempFile implementation.
+ void Release() override;
+
+ mojo::InterfacePtr<mojom::DownloadedTempFile> CreateInterfacePtrAndBind();
+
+ int child_id() const { return child_id_; }
+ int request_id() const { return request_id_; }
+ const base::FilePath& path() const { return path_; }
yhirano 2016/11/15 13:15:26 Not used
tzik 2016/11/16 09:14:56 Done.
+ const scoped_refptr<storage::ShareableFileReference>& reference() const {
+ return reference_;
+ }
+
+ private:
+ mojo::Binding<DownloadedTempFile> binding_;
+
+ ResourceDispatcherHostImpl* rdh_;
+ int child_id_;
+ int request_id_;
+ base::FilePath path_;
yhirano 2016/11/15 13:15:26 ditto
tzik 2016/11/16 09:14:56 Done.
+
+ scoped_refptr<storage::ShareableFileReference> reference_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadedTempFileImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698