Description[Chromoting] SessionLogger refactor.
Motivation:
When a remoting connection fails, we often need to collect extra
debugging information in additional to the error tag. For example,
when the host goes offline, we would like to report the corresponding
XMPP error stanza as well.
In the current design, we pass the XMPP error stanza to the SessionLogger
as a separate argument in logSessionStateChange().
In this pattern, we need to add a new argument to logSessionStateChange()
for each error specific detail. As we collect more and more extra info
(e.g. PNaCl error, script error callstack), this pattern quickly becomes
unmanageable.
Summary of changes:
1. When the connection fails, the caller set the |detail| field in the
remoting.Error object. When logSessionStateChange() is called,
SessionLogger calls error.fillLogEntry() to translate the
|detail| field into the corresponding fields in the log entry.
2. Consolidates logClientSessionStateChange() and logSessionStateChange()
3. Remove the dependency of remoting.ClientSession.State from
SessionLogger.js
4. Report bad version as a connection failure instead of user
cancellation
BUG=552693
Committed: https://crrev.com/bca7ea20b1b8d03163427ff3dd97df02bd4922e5
Cr-Commit-Position: refs/heads/master@{#358726}
Patch Set 1 : #
Total comments: 12
Patch Set 2 : Reviewer's feedback #Patch Set 3 : Rebase #Dependent Patchsets: Messages
Total messages: 16 (8 generated)
|