[go: nahoru, domu]

Adding terminal private extension api.

Adding extension api that will enable HTML terminal to access crosh.
The api is private and will be used by terminal extension.

Api will be able to start new crosh process, send input to it, listen to output
streams of the crosh process and close connection to the process.

--------------------------------------------------------------------------------
CROSH_PROXY

Represents connection to one crosh process.
When its opened, it launches new process ands starts output wather on the thread
supplied by crosh_proxy_registry. When it gets closed it ensures watcher and
process go away too.
It also supplies callback that will be called when watcher observes some output
from crosh process.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
CROSH_PROXY_REGISTRY

Lazily initiated class that keeps track of all existing crosh_proxies and makes
sure all of them eventually get destroyed. All proxy objects must be accessed
through the registry.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
CROSH_OUTPUT_WATCHER

Lives on its own thread and waits for output from a crosh process (either stdout
or stderr). File descriptors asigned to the output streams are supplied by proxy
that owns watcher. While output streams are observed, watcher's thread is
blocked.

--------------------------------------------------------------------------------

BUG=chromium-os:22323
TEST= ProcessProxyTest.*
      ProcessOutputWatcherTest.*
      ExtensionTerminalPrivateApiTest.*

Review URL: http://codereview.chromium.org/8835001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114308 0039d316-1c4b-4281-b951-d872f2087c98
21 files changed