diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 02:23:44 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 02:23:44 +0000 |
commit | 897b2627d88109e5280e20b6658d702b43468617 (patch) | |
tree | 76271ef33d000294ba9ce7b6d2b6e1aec94da610 /chrome_frame/utils.cc | |
parent | 943d8120c51e2ed0146d85a15298d7fa30f316e0 (diff) | |
download | chromium_src-897b2627d88109e5280e20b6658d702b43468617.zip chromium_src-897b2627d88109e5280e20b6658d702b43468617.tar.gz chromium_src-897b2627d88109e5280e20b6658d702b43468617.tar.bz2 |
Add support for uploading UMA metrics data from ChromeFrame. Added support for tracking chrome frame crash metrics via
2 new counters which track successful navigations and crashes. These counters are persisted in the registry under
HKCU\Software\Google\ChromeFrameMetrics.
Any other histogram data like AutomationServer launch time, IE versions etc are simply dropped if IE is shutdown before
they are sent out. The metrics data is uploaded on similar lines as Chrome.
Bug=46057
Review URL: http://codereview.chromium.org/2714003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index b375dcc..735ec6f 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -1191,3 +1191,25 @@ std::string Bscf2Str(DWORD flags) { return s; #undef ADD_BSCF_FLAG } + +// Reads data from a stream into a string. +HRESULT ReadStream(IStream* stream, size_t size, std::string* data) { + DCHECK(stream); + DCHECK(data); + + DWORD read = 0; + HRESULT hr = stream->Read(WriteInto(data, size + 1), size, &read); + DCHECK(hr == S_OK || hr == S_FALSE || hr == E_PENDING); + if (read) { + data->erase(read); + DCHECK_EQ(read, data->length()); + } else { + data->clear(); + // Return S_FALSE if the underlying stream returned S_OK and zero bytes. + if (hr == S_OK) + hr = S_FALSE; + } + + return hr; +} + |