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

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

Issue 8772004: Improve GamepadSeqLock impl Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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 143882)
+++ content/browser/gamepad/gamepad_provider.cc (working copy)
@@ -121,11 +121,6 @@
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_;
@@ -134,9 +129,9 @@
// Acquire the SeqLock. There is only ever one writer to this data.
// See gamepad_hardware_buffer.h.
- hwbuf->sequence.WriteBegin();
- data_fetcher_->GetGamepadData(&hwbuf->buffer, changed);
- hwbuf->sequence.WriteEnd();
+ WebKit::WebGamepads tmp;
+ data_fetcher_->GetGamepadData(&tmp, changed);
+ hwbuf->gamepads.Write(tmp);
// 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