Skip to content

Commit

Permalink
The function to send out ChromeFrame histograms can be invoked from m…
Browse files Browse the repository at this point in the history
…ultiple threads in IE.

This causes the histogram snapshots to get corrupted.

Fix is to synchronize access to the function which gathers these histograms.

Fixes bugs http://code.google.com/p/chromium/issues/detail?id=36500
           http://code.google.com/p/chromium/issues/detail?id=36510

Bug=36500,36510


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39817 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ananta@chromium.org committed Feb 24, 2010
1 parent 18597e6 commit b074083
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chrome_frame/chrome_frame_histograms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ChromeFrameHistogramSnapshots::ChromeFrameHistogramSnapshots() {
ChromeFrameHistogramSnapshots::HistogramPickledList
ChromeFrameHistogramSnapshots::GatherAllHistograms() {

AutoLock auto_lock(lock_);

StatisticsRecorder::Histograms histograms;
StatisticsRecorder::GetHistograms(&histograms);

Expand Down
3 changes: 3 additions & 0 deletions chrome_frame/chrome_frame_histograms.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class ChromeFrameHistogramSnapshots {
// histogram) so that we can send only the delta with the next log.
LoggedSampleMap logged_samples_;

// Synchronizes the histogram gathering operation.
Lock lock_;

DISALLOW_COPY_AND_ASSIGN(ChromeFrameHistogramSnapshots);
};

Expand Down

0 comments on commit b074083

Please sign in to comment.