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

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 9 years 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
Index: content/browser/gamepad/gamepad_provider.cc
===================================================================
--- content/browser/gamepad/gamepad_provider.cc (revision 112429)
+++ content/browser/gamepad/gamepad_provider.cc (working copy)
@@ -118,16 +118,9 @@
DCHECK(MessageLoop::current() == polling_thread_->message_loop());
GamepadHardwareBuffer* hwbuf = SharedMemoryAsHardwareBuffer();
- ANNOTATE_BENIGN_RACE_SIZED(
- &hwbuf->buffer,
- sizeof(WebKit::WebGamepads),
- "Racey reads are discarded");
-
- // 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, devices_changed_);
- hwbuf->sequence.WriteEnd();
+ WebKit::WebGamepads tmp;
+ data_fetcher_->GetGamepadData(&tmp, devices_changed_);
+ hwbuf->gamepads.Write(tmp);
devices_changed_ = false;
// Schedule our next interval of polling.
ScheduleDoPoll();
« no previous file with comments | « no previous file | content/browser/gamepad/gamepad_provider_unittest.cc » ('j') | content/common/gamepad_seqlock.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698