Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1254)

Unified Diff: content/browser/gamepad/gamepad_provider.cc

Issue 10785024: Revert 146792 - Lock-free GamepadSeqLock (try 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/gamepad_provider.cc
===================================================================
--- content/browser/gamepad/gamepad_provider.cc (revision 146895)
+++ content/browser/gamepad/gamepad_provider.cc (working copy)
@@ -121,6 +121,11 @@
bool changed;
GamepadHardwareBuffer* hwbuf = SharedMemoryAsHardwareBuffer();
+ ANNOTATE_BENIGN_RACE_SIZED(
+ &hwbuf->buffer,
+ sizeof(WebKit::WebGamepads),
+ "Racey reads are discarded");
+
{
base::AutoLock lock(devices_changed_lock_);
changed = devices_changed_;
@@ -129,9 +134,9 @@
// Acquire the SeqLock. There is only ever one writer to this data.
// See gamepad_hardware_buffer.h.
- WebKit::WebGamepads tmp;
- data_fetcher_->GetGamepadData(&tmp, changed);
- hwbuf->gamepads.Write(tmp);
+ hwbuf->sequence.WriteBegin();
+ data_fetcher_->GetGamepadData(&hwbuf->buffer, changed);
+ hwbuf->sequence.WriteEnd();
// Schedule our next interval of polling.
ScheduleDoPoll();
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698