Use multiline attribute to check for IA2_STATE_MULTILINE.
[chromium-blink-merge.git] / content / browser / download / download_net_log_parameters.h
blob6d027cfb0a424ab425701cbb54c6b8b43d43b085
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(
30 const DownloadItem* download_item,
31 DownloadType download_type,
32 const std::string* file_name,
33 net::NetLog::LogLevel log_level);
35 // Returns NetLog parameters when a DownloadItem is checked for danger.
36 base::Value* ItemCheckedNetLogCallback(
37 DownloadDangerType danger_type,
38 net::NetLog::LogLevel log_level);
40 // Returns NetLog parameters when a DownloadItem is renamed.
41 base::Value* ItemRenamedNetLogCallback(const base::FilePath* old_filename,
42 const base::FilePath* new_filename,
43 net::NetLog::LogLevel log_level);
45 // Returns NetLog parameters when a DownloadItem is interrupted.
46 base::Value* ItemInterruptedNetLogCallback(DownloadInterruptReason reason,
47 int64 bytes_so_far,
48 const std::string* hash_state,
49 net::NetLog::LogLevel log_level);
51 // Returns NetLog parameters when a DownloadItem is resumed.
52 base::Value* ItemResumingNetLogCallback(bool user_initiated,
53 DownloadInterruptReason reason,
54 int64 bytes_so_far,
55 const std::string* hash_state,
56 net::NetLog::LogLevel log_level);
58 // Returns NetLog parameters when a DownloadItem is completing.
59 base::Value* ItemCompletingNetLogCallback(int64 bytes_so_far,
60 const std::string* final_hash,
61 net::NetLog::LogLevel log_level);
63 // Returns NetLog parameters when a DownloadItem is finished.
64 base::Value* ItemFinishedNetLogCallback(bool auto_opened,
65 net::NetLog::LogLevel log_level);
67 // Returns NetLog parameters when a DownloadItem is canceled.
68 base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far,
69 const std::string* hash_state,
70 net::NetLog::LogLevel log_level);
72 // Returns NetLog parameters when a DownloadFile is opened.
73 base::Value* FileOpenedNetLogCallback(const base::FilePath* file_name,
74 int64 start_offset,
75 net::NetLog::LogLevel log_level);
77 // Returns NetLog parameters when a DownloadFile is opened.
78 base::Value* FileStreamDrainedNetLogCallback(size_t stream_size,
79 size_t num_buffers,
80 net::NetLog::LogLevel log_level);
82 // Returns NetLog parameters when a DownloadFile is renamed.
83 base::Value* FileRenamedNetLogCallback(const base::FilePath* old_filename,
84 const base::FilePath* new_filename,
85 net::NetLog::LogLevel log_level);
87 // Returns NetLog parameters when a File has an error.
88 base::Value* FileErrorNetLogCallback(const char* operation,
89 net::Error net_error,
90 net::NetLog::LogLevel log_level);
92 // Returns NetLog parameters for a download interruption.
93 base::Value* FileInterruptedNetLogCallback(const char* operation,
94 int os_error,
95 DownloadInterruptReason reason,
96 net::NetLog::LogLevel log_level);
98 } // namespace content
100 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_