1// Copyright (c) 2010 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// NOTE: No header guards are used, since this file is intended to be expanded
6// directly into net_log.h. DO NOT include this file anywhere else.
7
8// --------------------------------------------------------------------------
9// General pseudo-events
10// --------------------------------------------------------------------------
11
12// Something got cancelled (we determine what is cancelled based on the
13// log context around it.)
14EVENT_TYPE(CANCELLED)
15
16// Marks the creation/destruction of a request (net::URLRequest or
17// SocketStream).
18EVENT_TYPE(REQUEST_ALIVE)
19
20// ------------------------------------------------------------------------
21// HostResolverImpl
22// ------------------------------------------------------------------------
23
24// The start/end of waiting on a host resolve (DNS) request.
25// The BEGIN phase contains the following parameters:
26//
27//   {
28//     "source_dependency": <Source id of the request being waited on>,
29//   }
30EVENT_TYPE(HOST_RESOLVER_IMPL)
31
32// The start/end of a host resolve (DNS) request.  Note that these events are
33// logged for all DNS requests, though not all requests result in the creation
34// of a HostResolvedImpl::Request object.
35//
36// The BEGIN phase contains the following parameters:
37//
38//   {
39//     "host": <Hostname associated with the request>,
40//     "source_dependency": <Source id, if any, of what created the request>,
41//   }
42//
43// If an error occurred, the END phase will contain these parameters:
44//   {
45//     "net_error": <The net error code integer for the failure>,
46//     "os_error": <The exact error code integer that getaddrinfo() returned>,
47//   }
48
49EVENT_TYPE(HOST_RESOLVER_IMPL_REQUEST)
50
51// This event is logged when a request is handled by a cache entry.
52EVENT_TYPE(HOST_RESOLVER_IMPL_CACHE_HIT)
53
54// This event means a request was queued/dequeued for subsequent job creation,
55// because there are already too many active HostResolverImpl::Jobs.
56//
57// The BEGIN phase contains the following parameters:
58//
59//   {
60//     "priority": <Priority of the queued request>,
61//   }
62EVENT_TYPE(HOST_RESOLVER_IMPL_JOB_POOL_QUEUE)
63
64// This event is created when a new HostResolverImpl::Request is evicted from
65// JobPool without a Job being created, because the limit on number of queued
66// Requests was reached.
67EVENT_TYPE(HOST_RESOLVER_IMPL_JOB_POOL_QUEUE_EVICTED)
68
69// This event is created when a new HostResolverImpl::Job is about to be created
70// for a request.
71EVENT_TYPE(HOST_RESOLVER_IMPL_CREATE_JOB)
72
73// This is logged for a request when it's attached to a
74// HostResolverImpl::Job.  When this occurs without a preceding
75// HOST_RESOLVER_IMPL_CREATE_JOB entry, it means the request was attached to an
76// existing HostResolverImpl::Job.
77//
78// If the BoundNetLog used to create the event has a valid source id, the BEGIN
79// phase contains the following parameters:
80//
81//   {
82//     "source_dependency": <Source identifier for the attached Job>,
83//   }
84EVENT_TYPE(HOST_RESOLVER_IMPL_JOB_ATTACH)
85
86// The creation/completion of a host resolve (DNS) job.
87// The BEGIN phase contains the following parameters:
88//
89//   {
90//     "host": <Hostname associated with the request>,
91//     "source_dependency": <Source id, if any, of what created the request>,
92//   }
93//
94// On success, the END phase has these parameters:
95//   {
96//     "address_list": <The host name being resolved>,
97//   }
98// If an error occurred, the END phase will contain these parameters:
99//   {
100//     "net_error": <The net error code integer for the failure>,
101//     "os_error": <The exact error code integer that getaddrinfo() returned>,
102//   }
103EVENT_TYPE(HOST_RESOLVER_IMPL_JOB)
104
105// ------------------------------------------------------------------------
106// InitProxyResolver
107// ------------------------------------------------------------------------
108
109// The start/end of auto-detect + custom PAC URL configuration.
110EVENT_TYPE(INIT_PROXY_RESOLVER)
111
112// The start/end of when proxy autoconfig was artificially paused following
113// a network change event. (We wait some amount of time after being told of
114// network changes to avoid hitting spurious errors during auto-detect).
115EVENT_TYPE(INIT_PROXY_RESOLVER_WAIT)
116
117// The start/end of download of a PAC script. This could be the well-known
118// WPAD URL (if testing auto-detect), or a custom PAC URL.
119//
120// The START event has the parameters:
121//   {
122//     "url": <URL string of script being fetched>,
123//   }
124//
125// If the fetch failed, then the END phase has these parameters:
126//   {
127//      "error_code": <Net error code integer>,
128//   }
129EVENT_TYPE(INIT_PROXY_RESOLVER_FETCH_PAC_SCRIPT)
130
131// The start/end of the testing of a PAC script (trying to parse the fetched
132// file as javascript).
133//
134// If the parsing of the script failed, the END phase will have parameters:
135//   {
136//      "error_code": <Net error code integer>,
137//   }
138EVENT_TYPE(INIT_PROXY_RESOLVER_SET_PAC_SCRIPT)
139
140// This event means that initialization failed because there was no
141// configured script fetcher. (This indicates a configuration error).
142EVENT_TYPE(INIT_PROXY_RESOLVER_HAS_NO_FETCHER)
143
144// This event is emitted after deciding to fall-back to the next PAC
145// script in the list.
146EVENT_TYPE(INIT_PROXY_RESOLVER_FALLING_BACK_TO_NEXT_PAC_URL)
147
148// ------------------------------------------------------------------------
149// ProxyService
150// ------------------------------------------------------------------------
151
152// The start/end of a proxy resolve request.
153EVENT_TYPE(PROXY_SERVICE)
154
155// The time while a request is waiting on InitProxyResolver to configure
156// against either WPAD or custom PAC URL. The specifics on this time
157// are found from ProxyService::init_proxy_resolver_log().
158EVENT_TYPE(PROXY_SERVICE_WAITING_FOR_INIT_PAC)
159
160// This event is emitted to show what the PAC script returned. It can contain
161// extra parameters that are either:
162//   {
163//      "pac_string": <List of valid proxy servers, in PAC format>,
164//   }
165//
166//  Or if the the resolver failed:
167//   {
168//      "net_error": <Net error code that resolver failed with>,
169//   }
170EVENT_TYPE(PROXY_SERVICE_RESOLVED_PROXY_LIST)
171
172// This event is emitted whenever the proxy settings used by ProxyService
173// change.
174//
175// It contains these parameters:
176//  {
177//     "old_config": <Dump of the previous proxy settings>,
178//     "new_config": <Dump of the new proxy settings>,
179//  }
180//
181// Note that the "old_config" key will be omitted on the first fetch of the
182// proxy settings (since there wasn't a previous value).
183EVENT_TYPE(PROXY_CONFIG_CHANGED)
184
185// ------------------------------------------------------------------------
186// Proxy Resolver
187// ------------------------------------------------------------------------
188
189// Measures the time taken to execute the "myIpAddress()" javascript binding.
190EVENT_TYPE(PAC_JAVASCRIPT_MY_IP_ADDRESS)
191
192// Measures the time taken to execute the "myIpAddressEx()" javascript binding.
193EVENT_TYPE(PAC_JAVASCRIPT_MY_IP_ADDRESS_EX)
194
195// Measures the time taken to execute the "dnsResolve()" javascript binding.
196EVENT_TYPE(PAC_JAVASCRIPT_DNS_RESOLVE)
197
198// Measures the time taken to execute the "dnsResolveEx()" javascript binding.
199EVENT_TYPE(PAC_JAVASCRIPT_DNS_RESOLVE_EX)
200
201// This event is emitted when a javascript error has been triggered by a
202// PAC script. It contains the following event parameters:
203//   {
204//      "line_number": <The line number in the PAC script
205//                      (or -1 if not applicable)>,
206//      "message": <The error message>,
207//   }
208EVENT_TYPE(PAC_JAVASCRIPT_ERROR)
209
210// This event is emitted when a PAC script called alert(). It contains the
211// following event parameters:
212//   {
213//      "message": <The string of the alert>,
214//   }
215EVENT_TYPE(PAC_JAVASCRIPT_ALERT)
216
217// Measures the time that a proxy resolve request was stalled waiting for a
218// proxy resolver thread to free-up.
219EVENT_TYPE(WAITING_FOR_PROXY_RESOLVER_THREAD)
220
221// This event is emitted just before a PAC request is bound to a thread. It
222// contains these parameters:
223//
224//   {
225//     "thread_number": <Identifier for the PAC thread that is going to
226//                       run this request>,
227//   }
228EVENT_TYPE(SUBMITTED_TO_RESOLVER_THREAD)
229
230// ------------------------------------------------------------------------
231// ClientSocket
232// ------------------------------------------------------------------------
233
234// The start/end of a TCP connect(). This corresponds with a call to
235// TCPClientSocket::Connect().
236//
237// The START event contains these parameters:
238//
239//   {
240//     "address_list": <List of network address strings>,
241//   }
242//
243// And the END event will contain the following parameters on failure:
244//
245//   {
246//     "net_error": <Net integer error code>,
247//   }
248EVENT_TYPE(TCP_CONNECT)
249
250// Nested within TCP_CONNECT, there may be multiple attempts to connect
251// to the individual addresses. The START event will describe the
252// address the attempt is for:
253//
254//   {
255//     "address": <String of the network address>,
256//   }
257//
258// And the END event will contain the system error code if it failed:
259//
260//   {
261//     "os_error": <Integer error code the operating system returned>,
262//   }
263EVENT_TYPE(TCP_CONNECT_ATTEMPT)
264
265// The start/end of a TCP connect(). This corresponds with a call to
266// TCPServerSocket::Accept().
267//
268// The END event will contain the following parameters on success:
269//   {
270//     "address": <Remote address of the accepted connection>,
271//   }
272// On failure it contains the following parameters
273//   {
274//     "net_error": <Net integer error code>,
275//   }
276EVENT_TYPE(TCP_ACCEPT)
277
278// Marks the begin/end of a socket (TCP/SOCKS/SSL).
279EVENT_TYPE(SOCKET_ALIVE)
280
281// This event is logged to the socket stream whenever the socket is
282// acquired/released via a ClientSocketHandle.
283//
284// The BEGIN phase contains the following parameters:
285//
286//   {
287//     "source_dependency": <Source identifier for the controlling entity>,
288//   }
289EVENT_TYPE(SOCKET_IN_USE)
290
291// The start/end of a SOCKS connect().
292EVENT_TYPE(SOCKS_CONNECT)
293
294// The start/end of a SOCKS5 connect().
295EVENT_TYPE(SOCKS5_CONNECT)
296
297// This event is emitted when the SOCKS connect fails because the provided
298// was longer than 255 characters.
299EVENT_TYPE(SOCKS_HOSTNAME_TOO_BIG)
300
301// These events are emitted when insufficient data was read while
302// trying to establish a connection to the SOCKS proxy server
303// (during the greeting phase or handshake phase, respectively).
304EVENT_TYPE(SOCKS_UNEXPECTEDLY_CLOSED_DURING_GREETING)
305EVENT_TYPE(SOCKS_UNEXPECTEDLY_CLOSED_DURING_HANDSHAKE)
306
307// This event indicates that a bad version number was received in the
308// proxy server's response. The extra parameters show its value:
309//   {
310//     "version": <Integer version number in the response>,
311//   }
312EVENT_TYPE(SOCKS_UNEXPECTED_VERSION)
313
314// This event indicates that the SOCKS proxy server returned an error while
315// trying to create a connection. The following parameters will be attached
316// to the event:
317//   {
318//     "error_code": <Integer error code returned by the server>,
319//   }
320EVENT_TYPE(SOCKS_SERVER_ERROR)
321
322// This event indicates that the SOCKS proxy server asked for an authentication
323// method that we don't support. The following parameters are attached to the
324// event:
325//   {
326//     "method": <Integer method code>,
327//   }
328EVENT_TYPE(SOCKS_UNEXPECTED_AUTH)
329
330// This event indicates that the SOCKS proxy server's response indicated an
331// address type which we are not prepared to handle.
332// The following parameters are attached to the event:
333//   {
334//     "address_type": <Integer code for the address type>,
335//   }
336EVENT_TYPE(SOCKS_UNKNOWN_ADDRESS_TYPE)
337
338// The start/end of a SSL connect().
339EVENT_TYPE(SSL_CONNECT)
340
341// The start/end of a SSL accept().
342EVENT_TYPE(SSL_ACCEPT)
343
344// An SSL error occurred while trying to do the indicated activity.
345// The following parameters are attached to the event:
346//   {
347//     "net_error": <Integer code for the specific error type>,
348//     "ssl_lib_error": <SSL library's integer code for the specific error type>
349//   }
350EVENT_TYPE(SSL_HANDSHAKE_ERROR)
351EVENT_TYPE(SSL_READ_ERROR)
352EVENT_TYPE(SSL_WRITE_ERROR)
353
354// An SSL Snap Start was attempted
355// The following parameters are attached to the event:
356//   {
357//     "type": <Integer code for the Snap Start result>,
358//   }
359EVENT_TYPE(SSL_SNAP_START)
360
361// We found that our prediction of the server's certificates was correct and
362// we merged the verification with the SSLHostInfo.
363EVENT_TYPE(SSL_VERIFICATION_MERGED)
364
365// An SSL error occurred while calling an NSS function not directly related to
366// one of the above activities.  Can also be used when more information than
367// is provided by just an error code is needed:
368//   {
369//     "function": <Name of the NSS function, as a string>,
370//     "param": <Most relevant parameter, if any>,
371//     "ssl_lib_error": <NSS library's integer code for the specific error type>
372//   }
373EVENT_TYPE(SSL_NSS_ERROR)
374
375// The specified number of bytes were sent on the socket.
376// The following parameters are attached:
377//   {
378//     "byte_count": <Number of bytes that were just sent>,
379//     "hex_encoded_bytes": <The exact bytes sent, as a hexadecimal string.
380//                           Only present when byte logging is enabled>,
381//   }
382EVENT_TYPE(SOCKET_BYTES_SENT)
383
384// The specified number of bytes were received on the socket.
385// The following parameters are attached:
386//   {
387//     "byte_count": <Number of bytes that were just received>,
388//     "hex_encoded_bytes": <The exact bytes received, as a hexadecimal string.
389//                           Only present when byte logging is enabled>,
390//   }
391EVENT_TYPE(SOCKET_BYTES_RECEIVED)
392
393// ------------------------------------------------------------------------
394// ClientSocketPoolBase::ConnectJob
395// ------------------------------------------------------------------------
396
397// The start/end of a ConnectJob.
398EVENT_TYPE(SOCKET_POOL_CONNECT_JOB)
399
400// The start/end of the ConnectJob::Connect().
401//
402// The BEGIN phase has these parameters:
403//
404//   {
405//     "group_name": <The group name for the socket request.>,
406//   }
407EVENT_TYPE(SOCKET_POOL_CONNECT_JOB_CONNECT)
408
409// This event is logged whenever the ConnectJob gets a new socket
410// association. The event parameters point to that socket:
411//
412//   {
413//     "source_dependency": <The source identifier for the new socket.>,
414//   }
415EVENT_TYPE(CONNECT_JOB_SET_SOCKET)
416
417// Whether the connect job timed out.
418EVENT_TYPE(SOCKET_POOL_CONNECT_JOB_TIMED_OUT)
419
420// ------------------------------------------------------------------------
421// ClientSocketPoolBaseHelper
422// ------------------------------------------------------------------------
423
424// The start/end of a client socket pool request for a socket.
425EVENT_TYPE(SOCKET_POOL)
426
427// The request stalled because there are too many sockets in the pool.
428EVENT_TYPE(SOCKET_POOL_STALLED_MAX_SOCKETS)
429
430// The request stalled because there are too many sockets in the group.
431EVENT_TYPE(SOCKET_POOL_STALLED_MAX_SOCKETS_PER_GROUP)
432
433// Indicates that we reused an existing socket. Attached to the event are
434// the parameters:
435//   {
436//     "idle_ms": <The number of milliseconds the socket was sitting idle for>,
437//   }
438EVENT_TYPE(SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)
439
440// This event simply describes the host:port that were requested from the
441// socket pool. Its parameters are:
442//   {
443//     "host_and_port": <String encoding the host and port>,
444//   }
445EVENT_TYPE(TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET)
446
447// This event simply describes the host:port that were requested from the
448// socket pool. Its parameters are:
449//   {
450//     "host_and_port": <String encoding the host and port>,
451//   }
452EVENT_TYPE(TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS)
453
454
455// A backup socket is created due to slow connect
456EVENT_TYPE(SOCKET_BACKUP_CREATED)
457
458// This event is sent when a connect job is eventually bound to a request
459// (because of late binding and socket backup jobs, we don't assign the job to
460// a request until it has completed).
461//
462// The event parameters are:
463//   {
464//      "source_dependency": <Source identifer for the connect job we are
465//                            bound to>,
466//   }
467EVENT_TYPE(SOCKET_POOL_BOUND_TO_CONNECT_JOB)
468
469// Identifies the NetLog::Source() for the Socket assigned to the pending
470// request. The event parameters are:
471//   {
472//      "source_dependency": <Source identifier for the socket we acquired>,
473//   }
474EVENT_TYPE(SOCKET_POOL_BOUND_TO_SOCKET)
475
476// The start/end of a client socket pool request for multiple sockets.
477// The event parameters are:
478//   {
479//      "num_sockets": <Number of sockets we're trying to ensure are connected>,
480//   }
481EVENT_TYPE(SOCKET_POOL_CONNECTING_N_SOCKETS)
482
483// ------------------------------------------------------------------------
484// URLRequest
485// ------------------------------------------------------------------------
486
487// Measures the time it took a net::URLRequestJob to start. For the most part
488// this corresponds with the time between net::URLRequest::Start() and
489// net::URLRequest::ResponseStarted(), however it is also repeated for every
490// redirect, and every intercepted job that handles the request.
491//
492// For the BEGIN phase, the following parameters are attached:
493//   {
494//      "url": <String of URL being loaded>,
495//      "method": <The method ("POST" or "GET" or "HEAD" etc..)>,
496//      "load_flags": <Numeric value of the combined load flags>,
497//   }
498//
499// For the END phase, if there was an error, the following parameters are
500// attached:
501//   {
502//      "net_error": <Net error code of the failure>,
503//   }
504EVENT_TYPE(URL_REQUEST_START_JOB)
505
506// This event is sent once a net::URLRequest receives a redirect. The parameters
507// attached to the event are:
508//   {
509//     "location": <The URL that was redirected to>,
510//   }
511EVENT_TYPE(URL_REQUEST_REDIRECTED)
512
513// Measures the time a net::URLRequest is blocked waiting for an extension to
514// respond to the onBefoteRequest extension event.
515EVENT_TYPE(URL_REQUEST_BLOCKED_ON_EXTENSION)
516
517// ------------------------------------------------------------------------
518// HttpCache
519// ------------------------------------------------------------------------
520
521// Measures the time while getting a reference to the back end.
522EVENT_TYPE(HTTP_CACHE_GET_BACKEND)
523
524// Measures the time while opening a disk cache entry.
525EVENT_TYPE(HTTP_CACHE_OPEN_ENTRY)
526
527// Measures the time while creating a disk cache entry.
528EVENT_TYPE(HTTP_CACHE_CREATE_ENTRY)
529
530// Measures the time it takes to add a HttpCache::Transaction to an http cache
531// entry's list of active Transactions.
532EVENT_TYPE(HTTP_CACHE_ADD_TO_ENTRY)
533
534// Measures the time while deleting a disk cache entry.
535EVENT_TYPE(HTTP_CACHE_DOOM_ENTRY)
536
537// Measures the time while reading/writing a disk cache entry's response headers
538// or metadata.
539EVENT_TYPE(HTTP_CACHE_READ_INFO)
540EVENT_TYPE(HTTP_CACHE_WRITE_INFO)
541
542// Measures the time while reading/writing a disk cache entry's body.
543EVENT_TYPE(HTTP_CACHE_READ_DATA)
544EVENT_TYPE(HTTP_CACHE_WRITE_DATA)
545
546// ------------------------------------------------------------------------
547// Disk Cache / Memory Cache
548// ------------------------------------------------------------------------
549
550// The creation/destruction of a disk_cache::EntryImpl object.  The "creation"
551// is considered to be the point at which an Entry is first considered to be
552// good and associated with a key.  Note that disk and memory cache entries
553// share event types.
554//
555// For the BEGIN phase, the following parameters are attached:
556//   {
557//     "created": <true if the Entry was created, rather than being opened>,
558//     "key": <The Entry's key>,
559//   }
560EVENT_TYPE(DISK_CACHE_ENTRY_IMPL)
561EVENT_TYPE(DISK_CACHE_MEM_ENTRY_IMPL)
562
563// Logs the time required to read/write data from/to a cache entry.
564//
565// For the BEGIN phase, the following parameters are attached:
566//   {
567//     "index": <Index being read/written>,
568//     "offset": <Offset being read/written>,
569//     "buf_len": <Length of buffer being read to/written from>,
570//     "truncate": <If present for a write, the truncate flag is set to true.
571//                  Not present in reads or writes where it is false>,
572//   }
573//
574// For the END phase, the following parameters are attached:
575//   {
576//     "bytes_copied": <Number of bytes copied.  Not present on error>,
577//     "net_error": <Network error code.  Only present on error>,
578//   }
579EVENT_TYPE(ENTRY_READ_DATA)
580EVENT_TYPE(ENTRY_WRITE_DATA)
581
582// Logged when sparse read/write operation starts/stops for an Entry.
583//
584// For the BEGIN phase, the following parameters are attached:
585//   {
586//     "offset": <Offset at which to start reading>,
587//     "buff_len": <Bytes to read/write>,
588//   }
589EVENT_TYPE(SPARSE_READ)
590EVENT_TYPE(SPARSE_WRITE)
591
592// Logged when a parent Entry starts/stops reading/writing a child Entry's data.
593//
594// For the BEGIN phase, the following parameters are attached:
595//   {
596//     "source_dependency": <Source id of the child entry>,
597//     "child_len": <Bytes to read/write from/to child>,
598//   }
599EVENT_TYPE(SPARSE_READ_CHILD_DATA)
600EVENT_TYPE(SPARSE_WRITE_CHILD_DATA)
601
602// Logged when sparse GetAvailableRange operation starts/stops for an Entry.
603//
604// For the BEGIN phase, the following parameters are attached:
605//   {
606//     "buff_len": <Bytes to read/write>,
607//     "offset": <Offset at which to start reading>,
608//   }
609//
610// For the END phase, the following parameters are attached.  No parameters are
611// attached when cancelled:
612//   {
613//     "length": <Length of returned range. Only present on success>,
614//     "start": <Position where returned range starts. Only present on success>,
615//     "net_error": <Resulting error code. Only present on failure. This may be
616//                   "OK" when there's no error, but no available bytes in the
617//                   range>,
618//   }
619EVENT_TYPE(SPARSE_GET_RANGE)
620
621// Indicates the children of a sparse EntryImpl are about to be deleted.
622// Not logged for MemEntryImpls.
623EVENT_TYPE(SPARSE_DELETE_CHILDREN)
624
625// Logged when an EntryImpl is closed.  Not logged for MemEntryImpls.
626EVENT_TYPE(ENTRY_CLOSE)
627
628// Logged when an entry is doomed.
629EVENT_TYPE(ENTRY_DOOM)
630
631// ------------------------------------------------------------------------
632// HttpStreamFactoryImpl
633// ------------------------------------------------------------------------
634
635// Measures the time taken to fulfill the HttpStreamRequest.
636EVENT_TYPE(HTTP_STREAM_REQUEST)
637
638// Measures the time taken to execute the HttpStreamFactoryImpl::Job
639EVENT_TYPE(HTTP_STREAM_JOB)
640
641// Identifies the NetLog::Source() for the Job that fulfilled the request.
642// request. The event parameters are:
643//   {
644//      "source_dependency": <Source identifier for the job we acquired>,
645//   }
646EVENT_TYPE(HTTP_STREAM_REQUEST_BOUND_TO_JOB)
647
648// ------------------------------------------------------------------------
649// HttpNetworkTransaction
650// ------------------------------------------------------------------------
651
652// Measures the time taken to send the tunnel request to the server.
653EVENT_TYPE(HTTP_TRANSACTION_TUNNEL_SEND_REQUEST)
654
655// This event is sent for a tunnel request.
656// The following parameters are attached:
657//   {
658//     "line": <The HTTP request line, CRLF terminated>,
659//     "headers": <The list of header:value pairs>,
660//   }
661EVENT_TYPE(HTTP_TRANSACTION_SEND_TUNNEL_HEADERS)
662
663// Measures the time to read the tunnel response headers from the server.
664EVENT_TYPE(HTTP_TRANSACTION_TUNNEL_READ_HEADERS)
665
666// This event is sent on receipt of the HTTP response headers to a tunnel
667// request.
668// The following parameters are attached:
669//   {
670//     "headers": <The list of header:value pairs>,
671//   }
672EVENT_TYPE(HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS)
673
674// Measures the time taken to send the request to the server.
675EVENT_TYPE(HTTP_TRANSACTION_SEND_REQUEST)
676
677// This event is sent for a HTTP request.
678// The following parameters are attached:
679//   {
680//     "line": <The HTTP request line, CRLF terminated>,
681//     "headers": <The list of header:value pairs>,
682//   }
683EVENT_TYPE(HTTP_TRANSACTION_SEND_REQUEST_HEADERS)
684
685// Measures the time to read HTTP response headers from the server.
686EVENT_TYPE(HTTP_TRANSACTION_READ_HEADERS)
687
688// This event is sent on receipt of the HTTP response headers.
689// The following parameters are attached:
690//   {
691//     "headers": <The list of header:value pairs>,
692//   }
693EVENT_TYPE(HTTP_TRANSACTION_READ_RESPONSE_HEADERS)
694
695// Measures the time to read the entity body from the server.
696EVENT_TYPE(HTTP_TRANSACTION_READ_BODY)
697
698// Measures the time taken to read the response out of the socket before
699// restarting for authentication, on keep alive connections.
700EVENT_TYPE(HTTP_TRANSACTION_DRAIN_BODY_FOR_AUTH_RESTART)
701
702// ------------------------------------------------------------------------
703// SpdySession
704// ------------------------------------------------------------------------
705
706// The start/end of a SpdySession.
707//   {
708//     "host": <The host-port string>,
709//     "proxy": <The Proxy PAC string>,
710//   }
711EVENT_TYPE(SPDY_SESSION)
712
713// This event is sent for a SPDY SYN_STREAM.
714// The following parameters are attached:
715//   {
716//     "flags": <The control frame flags>,
717//     "headers": <The list of header:value pairs>,
718//     "id": <The stream id>,
719//   }
720EVENT_TYPE(SPDY_SESSION_SYN_STREAM)
721
722// This event is sent for a SPDY SYN_STREAM pushed by the server, where a
723// net::URLRequest is already waiting for the stream.
724// The following parameters are attached:
725//   {
726//     "flags": <The control frame flags>,
727//     "headers": <The list of header:value pairs>,
728//     "id": <The stream id>,
729//     "associated_stream": <The stream id>,
730//   }
731EVENT_TYPE(SPDY_SESSION_PUSHED_SYN_STREAM)
732
733// This event is sent for a SPDY HEADERS frame.
734// The following parameters are attached:
735//   {
736//     "flags": <The control frame flags>,
737//     "headers": <The list of header:value pairs>,
738//     "id": <The stream id>,
739//   }
740EVENT_TYPE(SPDY_SESSION_HEADERS)
741
742// This event is sent for a SPDY SYN_REPLY.
743// The following parameters are attached:
744//   {
745//     "flags": <The control frame flags>,
746//     "headers": <The list of header:value pairs>,
747//     "id": <The stream id>,
748//   }
749EVENT_TYPE(SPDY_SESSION_SYN_REPLY)
750
751// On sending a SPDY SETTINGS frame.
752// The following parameters are attached:
753//   {
754//     "settings": <The list of setting id:value pairs>,
755//   }
756EVENT_TYPE(SPDY_SESSION_SEND_SETTINGS)
757
758// Receipt of a SPDY SETTINGS frame.
759// The following parameters are attached:
760//   {
761//     "settings": <The list of setting id:value pairs>,
762//   }
763EVENT_TYPE(SPDY_SESSION_RECV_SETTINGS)
764
765// The receipt of a RST_STREAM
766// The following parameters are attached:
767//   {
768//     "stream_id": <The stream ID for the window update>,
769//     "status": <The reason for the RST_STREAM>,
770//   }
771EVENT_TYPE(SPDY_SESSION_RST_STREAM)
772
773// Sending of a RST_STREAM
774// The following parameters are attached:
775//   {
776//     "stream_id": <The stream ID for the window update>,
777//     "status": <The reason for the RST_STREAM>,
778//   }
779EVENT_TYPE(SPDY_SESSION_SEND_RST_STREAM)
780
781// Sending of a SPDY PING frame.
782// The following parameters are attached:
783//   {
784//     "unique_id": <The unique id of the PING message>,
785//   }
786EVENT_TYPE(SPDY_SESSION_PING)
787
788// Receipt of a SPDY GOAWAY frame.
789// The following parameters are attached:
790//   {
791//     "last_accepted_stream_id": <Last stream id accepted by the server, duh>,
792//     "active_streams":          <Number of active streams>,
793//     "unclaimed_streams":       <Number of unclaimed push streams>,
794//   }
795EVENT_TYPE(SPDY_SESSION_GOAWAY)
796
797// Receipt of a SPDY WINDOW_UPDATE frame (which controls the send window).
798//   {
799//     "stream_id": <The stream ID for the window update>,
800//     "delta"    : <The delta window size>,
801//     "new_size" : <The new window size (computed)>,
802//   }
803EVENT_TYPE(SPDY_SESSION_SEND_WINDOW_UPDATE)
804
805// Sending of a SPDY WINDOW_UPDATE frame (which controls the receive window).
806//   {
807//     "stream_id": <The stream ID for the window update>,
808//     "delta"    : <The delta window size>,
809//     "new_size" : <The new window size (computed)>,
810//   }
811EVENT_TYPE(SPDY_SESSION_RECV_WINDOW_UPDATE)
812
813// Sending a data frame
814//   {
815//     "stream_id": <The stream ID for the window update>,
816//     "length"   : <The size of data sent>,
817//     "flags"    : <Send data flags>,
818//   }
819EVENT_TYPE(SPDY_SESSION_SEND_DATA)
820
821// Receiving a data frame
822//   {
823//     "stream_id": <The stream ID for the window update>,
824//     "length"   : <The size of data sent>,
825//     "flags"    : <Send data flags>,
826//   }
827EVENT_TYPE(SPDY_SESSION_RECV_DATA)
828
829// Logs that a stream is stalled on the send window being closed.
830EVENT_TYPE(SPDY_SESSION_STALLED_ON_SEND_WINDOW)
831
832// Session is closing
833//   {
834//     "status": <The error status of the closure>,
835//   }
836EVENT_TYPE(SPDY_SESSION_CLOSE)
837
838// Event when the creation of a stream is stalled because we're at
839// the maximum number of concurrent streams.
840EVENT_TYPE(SPDY_SESSION_STALLED_MAX_STREAMS)
841
842// ------------------------------------------------------------------------
843// SpdySessionPool
844// ------------------------------------------------------------------------
845
846// This event indicates the pool is reusing an existing session
847//   {
848//     "id": <The session id>,
849//   }
850EVENT_TYPE(SPDY_SESSION_POOL_FOUND_EXISTING_SESSION)
851
852// This event indicates the pool is reusing an existing session from an
853// IP pooling match.
854//   {
855//     "id": <The session id>,
856//   }
857EVENT_TYPE(SPDY_SESSION_POOL_FOUND_EXISTING_SESSION_FROM_IP_POOL)
858
859// This event indicates the pool created a new session
860//   {
861//     "id": <The session id>,
862//   }
863EVENT_TYPE(SPDY_SESSION_POOL_CREATED_NEW_SESSION)
864
865// This event indicates that a SSL socket has been upgraded to a SPDY session.
866//   {
867//     "id": <The session id>,
868//   }
869EVENT_TYPE(SPDY_SESSION_POOL_IMPORTED_SESSION_FROM_SOCKET)
870
871// This event indicates that the session has been removed.
872//   {
873//     "id": <The session id>,
874//   }
875EVENT_TYPE(SPDY_SESSION_POOL_REMOVE_SESSION)
876
877// ------------------------------------------------------------------------
878// SpdyStream
879// ------------------------------------------------------------------------
880
881// The begin and end of a SPDY STREAM.
882EVENT_TYPE(SPDY_STREAM)
883
884// Logs that a stream attached to a pushed stream.
885EVENT_TYPE(SPDY_STREAM_ADOPTED_PUSH_STREAM)
886
887// This event indicates that the send window has been updated
888//   {
889//     "id":         <The stream id>,
890//     "delta":      <The window size delta>,
891//     "new_window": <The new window size>,
892//   }
893EVENT_TYPE(SPDY_STREAM_SEND_WINDOW_UPDATE)
894
895// This event indicates that the recv window has been updated
896//   {
897//     "id":         <The stream id>,
898//     "delta":      <The window size delta>,
899//     "new_window": <The new window size>,
900//   }
901EVENT_TYPE(SPDY_STREAM_RECV_WINDOW_UPDATE)
902
903// ------------------------------------------------------------------------
904// HttpStreamParser
905// ------------------------------------------------------------------------
906
907// Measures the time to read HTTP response headers from the server.
908EVENT_TYPE(HTTP_STREAM_PARSER_READ_HEADERS)
909
910// ------------------------------------------------------------------------
911// SocketStream
912// ------------------------------------------------------------------------
913
914// Measures the time between SocketStream::Connect() and
915// SocketStream::DidEstablishConnection()
916//
917// For the BEGIN phase, the following parameters are attached:
918//   {
919//      "url": <String of URL being loaded>,
920//   }
921//
922// For the END phase, if there was an error, the following parameters are
923// attached:
924//   {
925//      "net_error": <Net error code of the failure>,
926//   }
927EVENT_TYPE(SOCKET_STREAM_CONNECT)
928
929// A message sent on the SocketStream.
930EVENT_TYPE(SOCKET_STREAM_SENT)
931
932// A message received on the SocketStream.
933EVENT_TYPE(SOCKET_STREAM_RECEIVED)
934
935// ------------------------------------------------------------------------
936// WebSocketJob
937// ------------------------------------------------------------------------
938
939// This event is sent for a WebSocket handshake request.
940// The following parameters are attached:
941//   {
942//     "headers": <handshake request message>,
943//   }
944EVENT_TYPE(WEB_SOCKET_SEND_REQUEST_HEADERS)
945
946// This event is sent on receipt of the WebSocket handshake response headers.
947// The following parameters are attached:
948//   {
949//     "headers": <handshake response message>,
950//   }
951EVENT_TYPE(WEB_SOCKET_READ_RESPONSE_HEADERS)
952
953// ------------------------------------------------------------------------
954// SOCKS5ClientSocket
955// ------------------------------------------------------------------------
956
957// The time spent sending the "greeting" to the SOCKS server.
958EVENT_TYPE(SOCKS5_GREET_WRITE)
959
960// The time spent waiting for the "greeting" response from the SOCKS server.
961EVENT_TYPE(SOCKS5_GREET_READ)
962
963// The time spent sending the CONNECT request to the SOCKS server.
964EVENT_TYPE(SOCKS5_HANDSHAKE_WRITE)
965
966// The time spent waiting for the response to the CONNECT request.
967EVENT_TYPE(SOCKS5_HANDSHAKE_READ)
968
969// ------------------------------------------------------------------------
970// HTTP Authentication
971// ------------------------------------------------------------------------
972
973// The time spent authenticating to the proxy.
974EVENT_TYPE(AUTH_PROXY)
975
976// The time spent authentication to the server.
977EVENT_TYPE(AUTH_SERVER)
978
979// ------------------------------------------------------------------------
980// HTML5 Application Cache
981// ------------------------------------------------------------------------
982
983// This event is emitted whenever a request is satistifed directly from
984// the appache.
985EVENT_TYPE(APPCACHE_DELIVERING_CACHED_RESPONSE)
986
987// This event is emitted whenever the appcache uses a fallback response.
988EVENT_TYPE(APPCACHE_DELIVERING_FALLBACK_RESPONSE)
989
990// This event is emitted whenever the appcache generates an error response.
991EVENT_TYPE(APPCACHE_DELIVERING_ERROR_RESPONSE)
992
993// ------------------------------------------------------------------------
994// Global events
995// ------------------------------------------------------------------------
996// These are events which are not grouped by source id, as they have no
997// context.
998
999// This event is emitted whenever NetworkChangeNotifier determines that the
1000// underlying network has changed.
1001EVENT_TYPE(NETWORK_IP_ADDRESSES_CHANGED)
1002