Fix broken path in extensions/common/PRESUBMIT.py
[chromium-blink-merge.git] / content / browser / download / download_net_log_parameters.h
blobde0c9578a5b65701acbcb81f91aff0cb150557fa
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_
8 #include <string>
10 #include "content/public/browser/download_item.h"
11 #include "net/base/net_errors.h"
12 #include "net/log/net_log.h"
14 class GURL;
16 namespace base {
17 class FilePath;
20 namespace content {
22 enum DownloadType {
23 SRC_ACTIVE_DOWNLOAD,
24 SRC_HISTORY_IMPORT,
25 SRC_SAVE_PAGE_AS
28 // Returns NetLog parameters when a DownloadItem is activated.
29 base::Value* ItemActivatedNetLogCallback(const DownloadItem* download_item,
30 DownloadType download_type,
31 const std::string* file_name,
32 net::NetLogCaptureMode capture_mode);
34 // Returns NetLog parameters when a DownloadItem is checked for danger.
35 base::Value* ItemCheckedNetLogCallback(DownloadDangerType danger_type,
36 net::NetLogCaptureMode capture_mode);
38 // Returns NetLog parameters when a DownloadItem is renamed.
39 base::Value* ItemRenamedNetLogCallback(const base::FilePath* old_filename,
40 const base::FilePath* new_filename,
41 net::NetLogCaptureMode capture_mode);
43 // Returns NetLog parameters when a DownloadItem is interrupted.
44 base::Value* ItemInterruptedNetLogCallback(DownloadInterruptReason reason,
45 int64 bytes_so_far,
46 const std::string* hash_state,
47 net::NetLogCaptureMode capture_mode);
49 // Returns NetLog parameters when a DownloadItem is resumed.
50 base::Value* ItemResumingNetLogCallback(bool user_initiated,
51 DownloadInterruptReason reason,
52 int64 bytes_so_far,
53 const std::string* hash_state,
54 net::NetLogCaptureMode capture_mode);
56 // Returns NetLog parameters when a DownloadItem is completing.
57 base::Value* ItemCompletingNetLogCallback(int64 bytes_so_far,
58 const std::string* final_hash,
59 net::NetLogCaptureMode capture_mode);
61 // Returns NetLog parameters when a DownloadItem is finished.
62 base::Value* ItemFinishedNetLogCallback(bool auto_opened,
63 net::NetLogCaptureMode capture_mode);
65 // Returns NetLog parameters when a DownloadItem is canceled.
66 base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far,
67 const std::string* hash_state,
68 net::NetLogCaptureMode capture_mode);
70 // Returns NetLog parameters when a DownloadFile is opened.
71 base::Value* FileOpenedNetLogCallback(const base::FilePath* file_name,
72 int64 start_offset,
73 net::NetLogCaptureMode capture_mode);
75 // Returns NetLog parameters when a DownloadFile is opened.
76 base::Value* FileStreamDrainedNetLogCallback(
77 size_t stream_size,
78 size_t num_buffers,
79 net::NetLogCaptureMode capture_mode);
81 // Returns NetLog parameters when a DownloadFile is renamed.
82 base::Value* FileRenamedNetLogCallback(const base::FilePath* old_filename,
83 const base::FilePath* new_filename,
84 net::NetLogCaptureMode capture_mode);
86 // Returns NetLog parameters when a File has an error.
87 base::Value* FileErrorNetLogCallback(const char* operation,
88 net::Error net_error,
89 net::NetLogCaptureMode capture_mode);
91 // Returns NetLog parameters for a download interruption.
92 base::Value* FileInterruptedNetLogCallback(const char* operation,
93 int os_error,
94 DownloadInterruptReason reason,
95 net::NetLogCaptureMode capture_mode);
97 } // namespace content
99 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_