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

Unified Diff: net/base/file_stream.h

Issue 9288084: Added Net logging to FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up year on licence text. 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: net/base/file_stream.h
diff --git a/net/base/file_stream.h b/net/base/file_stream.h
index f2a8f7f4f94701027ed5a2a08b822dec83491922..a50d9c0ebfdde73a2fc4823c37586a7df2e7b036 100644
--- a/net/base/file_stream.h
+++ b/net/base/file_stream.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -15,6 +15,7 @@
#include "base/platform_file.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
+#include "net/base/net_log.h"
class FilePath;
@@ -30,15 +31,19 @@ enum Whence {
class NET_EXPORT FileStream {
public:
- FileStream();
+ // Creates a |FileStream| with a new |BoundNetLog| (based on |net_log|)
+ // attached. |net_log| may be NULL if no logging is needed.
+ explicit FileStream(net::NetLog* net_log);
// Construct a FileStream with an existing file handle and opening flags.
// |file| is valid file handle.
// |flags| is a bitfield of base::PlatformFileFlags when the file handle was
// opened.
+ // |net_log| is the net log pointer to use to create a |BoundNetLog|. May be
+ // NULL if logging is not needed.
// The already opened file will not be automatically closed when FileStream
// is destructed.
- FileStream(base::PlatformFile file, int flags);
+ FileStream(base::PlatformFile file, int flags, net::NetLog* net_log);
virtual ~FileStream();
@@ -136,6 +141,13 @@ class NET_EXPORT FileStream {
// Turns on UMA error statistics gathering.
void EnableErrorStatistics();
+ // Sets the source reference for net-internals logging.
+ // Creates source dependency events between |owner_bound_net_log| and
+ // |bound_net_log_|. Each gets an event showing the dependency on the other.
+ // If only one of those is valid, it gets an event showing that a change
+ // of ownership happened, but without details.
+ void SetBoundNetLogSource(const net::BoundNetLog& owner_bound_net_log);
+
private:
class AsyncContext;
friend class AsyncContext;
@@ -149,6 +161,7 @@ class NET_EXPORT FileStream {
int open_flags_;
bool auto_closed_;
bool record_uma_;
+ net::BoundNetLog bound_net_log_;
DISALLOW_COPY_AND_ASSIGN(FileStream);
};

Powered by Google App Engine
This is Rietveld 408576698