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

Unified Diff: chrome/browser/download/download_process_handle.h

Issue 6932046: Added DownloadProcessHandle class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: download_process_handle Created 9 years, 8 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: chrome/browser/download/download_process_handle.h
diff --git a/chrome/browser/download/download_process_handle.h b/chrome/browser/download/download_process_handle.h
new file mode 100644
index 0000000000000000000000000000000000000000..998e6f3f0043d005d65930b01a569b68623b93eb
--- /dev/null
+++ b/chrome/browser/download/download_process_handle.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_
+#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_
+#pragma once
+
+#include <string>
+
+class DownloadManager;
+class ResourceDispatcherHost;
+class TabContents;
+
+// Identifiers associated with the download by related subsystems.
+// This class needs to be copyable, but has non-trivial methods.
Paweł Hajdan Jr. 2011/05/05 20:13:51 nit: Just remove the part about non-trivial method
ahendrickson 2011/05/06 16:16:50 Done.
+class DownloadProcessHandle {
+ public:
+ DownloadProcessHandle();
+ DownloadProcessHandle(int child_id, int render_view_id, int request_id);
+
+ void CancelDownload(ResourceDispatcherHost* rdh);
+ TabContents* GetTabContents();
+ DownloadManager* GetDownloadManager();
+
+ int child_id() const { return child_id_; }
+ int render_view_id() const { return render_view_id_; }
+ int request_id() const { return request_id_; }
+
+ private:
+ // The ID of the child process that started the download.
+ int child_id_;
Paweł Hajdan Jr. 2011/05/05 20:13:51 Could you make all member variables const?
ahendrickson 2011/05/06 16:16:50 That would prevent the class from being copyable.
Paweł Hajdan Jr. 2011/05/06 18:04:42 To be precise, I think it would prevent it from be
+
+ // The ID of the render view that started the download.
+ int render_view_id_;
+
+ // The ID associated with the request used for the download.
+ int request_id_;
+};
+
+#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROCESS_HANDLE_H_

Powered by Google App Engine
This is Rietveld 408576698