Switch some page set from user_agent fields to coresponding shared_state classes
[chromium-blink-merge.git] / net / log / net_log_capture_mode.h
blobe08e2ad436ae84474a70d0fb7edd69cd9cc240ca
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 NET_LOG_NET_LOG_CAPTURE_MODE_H_
6 #define NET_LOG_NET_LOG_CAPTURE_MODE_H_
8 #include <stdint.h>
9 #include <string>
11 #include "net/base/net_export.h"
13 namespace net {
15 // NetLogCaptureMode specifies the granularity of events that should be emitted
16 // to the log. It is a simple wrapper around an integer, so it should be passed
17 // to functions by value rather than by reference.
18 class NET_EXPORT NetLogCaptureMode {
19 public:
20 // NOTE: Default assignment and copy constructor are OK.
22 // The default constructor creates a capture mode equivalent to
23 // Default().
24 NetLogCaptureMode();
26 // Constructs a capture mode which logs basic events and event parameters.
27 // include_cookies_and_credentials() --> false
28 // include_socket_bytes() --> false
29 static NetLogCaptureMode Default();
31 // Constructs a capture mode which logs basic events, and additionally makes
32 // no effort to strip cookies and credentials.
33 // include_cookies_and_credentials() --> true
34 // include_socket_bytes() --> false
35 static NetLogCaptureMode IncludeCookiesAndCredentials();
37 // Constructs a capture mode which logs the data sent/received from sockets.
38 // include_cookies_and_credentials() --> true
39 // include_socket_bytes() --> true
40 static NetLogCaptureMode IncludeSocketBytes();
42 // If include_cookies_and_credentials() is true , then it is OK to log
43 // events which contain cookies, credentials or other privacy sensitive data.
44 bool include_cookies_and_credentials() const;
46 // If include_socket_bytes() is true, then it is OK to output the actual
47 // bytes read/written from the network, even if it contains private data.
48 bool include_socket_bytes() const;
50 bool operator==(NetLogCaptureMode mode) const;
51 bool operator!=(NetLogCaptureMode mode) const;
53 private:
54 explicit NetLogCaptureMode(uint32_t value);
56 int32_t value_;
59 } // namespace net
61 #endif // NET_LOG_NET_LOG_CAPTURE_MODE_H_