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

Unified Diff: content/browser/download/download_net_log_parameters.h

Issue 9223019: Added net logging to BaseFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup Created 8 years, 11 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: content/browser/download/download_net_log_parameters.h
diff --git a/content/browser/download/download_net_log_parameters.h b/content/browser/download/download_net_log_parameters.h
new file mode 100644
index 0000000000000000000000000000000000000000..bbf0776d75fd3649cbf119b47828d2c4b082cd72
--- /dev/null
+++ b/content/browser/download/download_net_log_parameters.h
@@ -0,0 +1,72 @@
+// Copyright (c) 2012 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_
+#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_
+#pragma once
+
+#include <string>
+
+#include "net/base/net_errors.h"
+#include "net/base/net_log.h"
+
+namespace download_net_logs {
+
+// NetLog parameters when a DownloadFile is opened.
+class FileOpenedParameters : public net::NetLog::EventParameters {
+ public:
+ FileOpenedParameters(const std::string& file_name,
+ int64 start_offset);
+ virtual base::Value* ToValue() const OVERRIDE;
+
+ private:
+ const std::string file_name_;
+ const int64 start_offset_;
+
+ DISALLOW_COPY_AND_ASSIGN(FileOpenedParameters);
+};
+
+// NetLog parameters when a DownloadFile is written.
+class FileWrittenParameters : public net::NetLog::EventParameters {
+ public:
+ FileWrittenParameters(int64 bytes_in_write, int64 bytes_so_far);
+ virtual base::Value* ToValue() const OVERRIDE;
+
+ private:
+ const int64 bytes_in_write_;
+ const int64 bytes_so_far_;
Randy Smith (Not in Mondays) 2012/02/02 20:05:54 I think if we can count on not missing any instanc
ahendrickson 2012/02/02 22:23:36 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(FileWrittenParameters);
+};
+
+// NetLog parameters when a DownloadFile is renamed.
+class FileRenamedParameters : public net::NetLog::EventParameters {
+ public:
+ FileRenamedParameters(
+ const std::string& old_filename, const std::string& new_filename);
+ virtual base::Value* ToValue() const OVERRIDE;
+
+ private:
+ const std::string old_filename_;
+ const std::string new_filename_;
+
+ DISALLOW_COPY_AND_ASSIGN(FileRenamedParameters);
+};
+
+// NetLog parameters when a File has an error.
+class FileErrorParameters : public net::NetLog::EventParameters {
+ public:
+ FileErrorParameters(const std::string& operation, net::Error net_error);
+ virtual base::Value* ToValue() const OVERRIDE;
+
+ private:
+ std::string operation_;
+ net::Error net_error_;
mmenke1 2012/02/03 18:32:32 nit: These can be const
ahendrickson 2012/02/04 05:27:14 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(FileErrorParameters);
+};
+
+} // namespace download_net_logs
+
+#endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_NET_LOG_PARAMETERS_H_

Powered by Google App Engine
This is Rietveld 408576698