| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "content/browser/download/download_file.h" | 14 #include "content/browser/download/download_file.h" |
| 15 #include "content/browser/download/download_request_handle.h" | 15 #include "content/browser/download/download_request_handle.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/public/browser/download_save_info.h" | 17 #include "content/public/browser/download_save_info.h" |
| 18 #include "net/log/net_log.h" | 18 #include "net/log/net_log.h" |
| 19 #include "ui/base/page_transition_types.h" | 19 #include "ui/base/page_transition_types.h" |
| 20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 // Used for informing the download manager of a new download, since we don't | 24 // Used for informing the download manager of a new download, since we don't |
| 25 // want to pass |DownloadItem|s between threads. | 25 // want to pass |DownloadItem|s between threads. |
| 26 struct CONTENT_EXPORT DownloadCreateInfo { | 26 struct CONTENT_EXPORT DownloadCreateInfo { |
| 27 DownloadCreateInfo(const base::Time& start_time, | 27 DownloadCreateInfo(const base::Time& start_time, |
| 28 int64 total_bytes, | 28 int64 total_bytes, |
| 29 const net::BoundNetLog& bound_net_log, | 29 const net::BoundNetLog& bound_net_log, |
| 30 bool has_user_gesture, | |
| 31 ui::PageTransition transition_type, | |
| 32 scoped_ptr<DownloadSaveInfo> save_info); | 30 scoped_ptr<DownloadSaveInfo> save_info); |
| 33 DownloadCreateInfo(); | 31 DownloadCreateInfo(); |
| 34 ~DownloadCreateInfo(); | 32 ~DownloadCreateInfo(); |
| 35 | 33 |
| 36 std::string DebugString() const; | 34 std::string DebugString() const; |
| 37 | 35 |
| 38 // The URL from which we are downloading. This is the final URL after any | 36 // The URL from which we are downloading. This is the final URL after any |
| 39 // redirection by the server for |url_chain|. | 37 // redirection by the server for |url_chain|. |
| 40 const GURL& url() const; | 38 const GURL& url() const; |
| 41 | 39 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 std::string etag; | 83 std::string etag; |
| 86 | 84 |
| 87 // The download file save info. | 85 // The download file save info. |
| 88 scoped_ptr<DownloadSaveInfo> save_info; | 86 scoped_ptr<DownloadSaveInfo> save_info; |
| 89 | 87 |
| 90 // The remote IP address where the download was fetched from. Copied from | 88 // The remote IP address where the download was fetched from. Copied from |
| 91 // UrlRequest::GetSocketAddress(). | 89 // UrlRequest::GetSocketAddress(). |
| 92 std::string remote_address; | 90 std::string remote_address; |
| 93 | 91 |
| 94 // The handle to the URLRequest sourcing this download. | 92 // The handle to the URLRequest sourcing this download. |
| 95 DownloadRequestHandle request_handle; | 93 scoped_ptr<DownloadRequestHandleInterface> request_handle; |
| 96 | 94 |
| 97 // The request's |BoundNetLog|, for "source_dependency" linking with the | 95 // The request's |BoundNetLog|, for "source_dependency" linking with the |
| 98 // download item's. | 96 // download item's. |
| 99 const net::BoundNetLog request_bound_net_log; | 97 const net::BoundNetLog request_bound_net_log; |
| 100 | 98 |
| 101 private: | 99 private: |
| 102 DISALLOW_COPY_AND_ASSIGN(DownloadCreateInfo); | 100 DISALLOW_COPY_AND_ASSIGN(DownloadCreateInfo); |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 } // namespace content | 103 } // namespace content |
| 106 | 104 |
| 107 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 105 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| OLD | NEW |