Moving ScopedMockLog from net/test to base/test.
I want to reuse ScopedMockLog from unittests under src/remoting/host. To do that, I am moving this class from net/test to base/test. When doing the move, I also wanted to ensure thread-safety in the case when logging is happening on a thread different from where StartCapturingLogs or StopCapturingLogs are called. Having proper locks (and memory barriers implied by the locks) should ensure that 1) LogMessageHandler won't see a half-way executed StartCapturingLogs or StopCapturingLogs and 2) that a log write in-progress won't get a rug pulled from underneath by destroying of gMock's structures embedded in ScopedMockLog's Log mock method. BUG= TEST=net_unittests Review URL: https://codereview.chromium.org/966423003 Cr-Commit-Position: refs/heads/master@{#319105}
Showing
Please register or sign in to comment