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

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

Issue 9223019: Added net logging to BaseFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk 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
« no previous file with comments | « content/browser/download/download_net_log_parameters.h ('k') | content/browser/download/save_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_net_log_parameters.cc
diff --git a/content/browser/download/download_net_log_parameters.cc b/content/browser/download/download_net_log_parameters.cc
new file mode 100644
index 0000000000000000000000000000000000000000..33a17f60e5b39d556a1937b3fe154854425f66e6
--- /dev/null
+++ b/content/browser/download/download_net_log_parameters.cc
@@ -0,0 +1,58 @@
+// 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.
+
+#include "content/browser/download/download_net_log_parameters.h"
+
+#include "base/basictypes.h"
+#include "base/logging.h"
+#include "base/string_number_conversions.h"
+#include "base/values.h"
+#include "content/browser/download/interrupt_reasons.h"
+#include "net/base/net_errors.h"
+
+namespace download_net_logs {
+
+FileOpenedParameters::FileOpenedParameters(const std::string& file_name,
+ int64 start_offset)
+ : file_name_(file_name), start_offset_(start_offset) {
+}
+
+Value* FileOpenedParameters::ToValue() const {
+ DictionaryValue* dict = new DictionaryValue();
+
+ dict->SetString("file_name", file_name_);
+ dict->SetString("start_offset", base::Int64ToString(start_offset_));
+
+ return dict;
+}
+
+FileRenamedParameters::FileRenamedParameters(
+ const std::string& old_filename, const std::string& new_filename)
+ : old_filename_(old_filename), new_filename_(new_filename) {
+}
+
+Value* FileRenamedParameters::ToValue() const {
+ DictionaryValue* dict = new DictionaryValue();
+
+ dict->SetString("old_filename", old_filename_);
+ dict->SetString("new_filename", new_filename_);
+
+ return dict;
+}
+
+FileErrorParameters::FileErrorParameters(const std::string& operation,
+ net::Error net_error)
+ : operation_(operation), net_error_(net_error) {
+}
+
+Value* FileErrorParameters::ToValue() const {
+ DictionaryValue* dict = new DictionaryValue();
+
+ dict->SetString("operation", operation_);
+ dict->SetInteger("net_error", net_error_);
+
+ return dict;
+}
+
+} // namespace download_net_logs
« no previous file with comments | « content/browser/download/download_net_log_parameters.h ('k') | content/browser/download/save_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698