diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 12:14:13 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 12:14:13 +0000 |
commit | bc932eff9ad3a4dcf306ed234d73510e49d33ff2 (patch) | |
tree | 763666f71b200d4eba8e708838b8ff183a794d6e /chrome/browser/download/download_process_handle.h | |
parent | c34e9a7afa5eb386f22aa2480156b6bdec8597cd (diff) | |
download | chromium_src-bc932eff9ad3a4dcf306ed234d73510e49d33ff2.zip chromium_src-bc932eff9ad3a4dcf306ed234d73510e49d33ff2.tar.gz chromium_src-bc932eff9ad3a4dcf306ed234d73510e49d33ff2.tar.bz2 |
Added DownloadProcessHandle class.
BUG=None
TEST=Download tests still pass.
Review URL: http://codereview.chromium.org/6932046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_process_handle.h')
-rw-r--r-- | chrome/browser/download/download_process_handle.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/chrome/browser/download/download_process_handle.h b/chrome/browser/download/download_process_handle.h new file mode 100644 index 0000000..b722d61 --- /dev/null +++ b/chrome/browser/download/download_process_handle.h @@ -0,0 +1,42 @@ +// 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 + +class DownloadManager; +class ResourceDispatcherHost; +class TabContents; + +// A handle used by the download system for operations on external +// objects associated with the download (e.g. URLRequest, TabContents, +// DownloadManager). +// This class needs to be copyable, so we can pass it across threads and not +// worry about lifetime or const-ness. +class DownloadProcessHandle { + public: + DownloadProcessHandle(); + DownloadProcessHandle(int child_id, int render_view_id, int request_id); + + // These functions must be called on the UI thread. + 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_; + + // 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_ |