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

Side by Side Diff: ios/crnet/crnet_net_log.h

Issue 1125293004: ios: add CrNet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix last nits Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « ios/crnet/crnet_environment.mm ('k') | ios/crnet/crnet_net_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef IOS_CRNET_CRNET_NET_LOG_H_
6 #define IOS_CRNET_CRNET_NET_LOG_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/threading/thread_checker.h"
10 #include "net/log/net_log.h"
11
12 namespace base {
13 class FilePath;
14 class DictionaryValue;
15 }
16
17 namespace net {
18 class WriteToFileNetLogObserver;
19 }
20
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 {
25 public:
26 enum Mode {
27 LOG_ALL_BYTES,
28 LOG_STRIP_PRIVATE_DATA,
29 };
30
31 CrNetNetLog();
32 ~CrNetNetLog() override;
33
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
37 // not log raw bytes.
38 bool Start(const base::FilePath& log_file, Mode mode);
39
40 // Stops logging.
41 void Stop();
42
43 private:
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_;
47
48 base::ThreadChecker thread_checker_;
49 };
50
51 #endif // IOS_CRNET_CRNET_NET_LOG_H
OLDNEW
« no previous file with comments | « ios/crnet/crnet_environment.mm ('k') | ios/crnet/crnet_net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698