1 // Copyright 2015 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 IOS_CRNET_CRNET_NET_LOG_H_
6 #define IOS_CRNET_CRNET_NET_LOG_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/threading/thread_checker.h"
10 #include "net/log/net_log.h"
14 class DictionaryValue
;
18 class WriteToFileNetLogObserver
;
21 // CrNet-specific NetLog subclass.
22 // This class can be used as a NetLog where needed; it logs all log entries to
23 // the file specified in Start().
24 class CrNetNetLog
: public net::NetLog
{
28 LOG_STRIP_PRIVATE_DATA
,
32 ~CrNetNetLog() override
;
34 // Starts logging to the file named |log_file|. If |mode| is LOG_ALL_BYTES,
35 // logs all network traffic, including raw bytes. If |mode| is
36 // LOG_STRIP_PRIVATE_DATA, strips cookies and other private data, and does
38 bool Start(const base::FilePath
& log_file
, Mode mode
);
44 // Underlying file writer. This observer observes NetLog events and writes
45 // them back to the file this class is logging to.
46 scoped_ptr
<net::WriteToFileNetLogObserver
> write_to_file_observer_
;
48 base::ThreadChecker thread_checker_
;
51 #endif // IOS_CRNET_CRNET_NET_LOG_H