Chromium Code Reviews| Index: net/base/file_stream.h |
| diff --git a/net/base/file_stream.h b/net/base/file_stream.h |
| index f2a8f7f4f94701027ed5a2a08b822dec83491922..6d2400092a02915d038154d9a0d0ba3a4141bbfe 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. |
| + explicit FileStream(net::NetLog* net_log); |
|
Randy Smith (Not in Mondays)
2012/01/31 22:22:41
nit: The "may be NULL if one is not needed" should
ahendrickson
2012/01/31 23:14:33
Done.
|
| // 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 one 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,12 @@ 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_|. |
|
Randy Smith (Not in Mondays)
2012/01/31 22:22:41
nit: I'd love this to be a little clearer that you
ahendrickson
2012/01/31 23:14:33
Done.
|
| + // If |bound_net_log_| is not valid, nothing happens. |
|
Randy Smith (Not in Mondays)
2012/01/31 22:22:41
Confirming (no need to update the comment, just wa
ahendrickson
2012/01/31 23:14:33
I've changed the code to provide an event if only
|
| + void SetBoundNetLogSource(const net::BoundNetLog& owner_bound_net_log); |
| + |
| private: |
| class AsyncContext; |
| friend class AsyncContext; |
| @@ -149,6 +160,7 @@ class NET_EXPORT FileStream { |
| int open_flags_; |
| bool auto_closed_; |
| bool record_uma_; |
| + net::BoundNetLog bound_net_log_; |
| DISALLOW_COPY_AND_ASSIGN(FileStream); |
| }; |