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

Side by Side Diff: content/browser/device_sensors/data_fetcher_shared_memory_win.cc

Issue 1064863002: Fix data fetcher for light stop correctly on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/device_sensors/data_fetcher_shared_memory.h" 5 #include "content/browser/device_sensors/data_fetcher_shared_memory.h"
6 6
7 #include <GuidDef.h> 7 #include <GuidDef.h>
8 #include <InitGuid.h> 8 #include <InitGuid.h>
9 #include <PortableDeviceTypes.h> 9 #include <PortableDeviceTypes.h>
10 #include <Sensors.h> 10 #include <Sensors.h>
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 break; 335 break;
336 default: 336 default:
337 NOTREACHED(); 337 NOTREACHED();
338 } 338 }
339 return false; 339 return false;
340 } 340 }
341 341
342 bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) { 342 bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
343 DisableSensors(consumer_type); 343 DisableSensors(consumer_type);
344 SetBufferAvailableState(consumer_type, false);
345 switch (consumer_type) { 344 switch (consumer_type) {
346 case CONSUMER_TYPE_ORIENTATION: 345 case CONSUMER_TYPE_ORIENTATION:
346 SetBufferAvailableState(consumer_type, false);
347 orientation_buffer_ = nullptr; 347 orientation_buffer_ = nullptr;
348 return true; 348 return true;
349 case CONSUMER_TYPE_MOTION: 349 case CONSUMER_TYPE_MOTION:
350 SetBufferAvailableState(consumer_type, false);
350 motion_buffer_ = nullptr; 351 motion_buffer_ = nullptr;
351 return true; 352 return true;
352 case CONSUMER_TYPE_LIGHT: 353 case CONSUMER_TYPE_LIGHT:
353 SetLightBuffer(light_buffer_, -1); 354 SetLightBuffer(light_buffer_, -1);
354 light_buffer_ = nullptr; 355 light_buffer_ = nullptr;
355 return true; 356 return true;
356 default: 357 default:
357 NOTREACHED(); 358 NOTREACHED();
358 } 359 }
359 return false; 360 return false;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 motion_buffer_->data.allAvailableSensorsAreActive = enabled; 456 motion_buffer_->data.allAvailableSensorsAreActive = enabled;
456 motion_buffer_->seqlock.WriteEnd(); 457 motion_buffer_->seqlock.WriteEnd();
457 } 458 }
458 break; 459 break;
459 default: 460 default:
460 NOTREACHED(); 461 NOTREACHED();
461 } 462 }
462 } 463 }
463 464
464 } // namespace content 465 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698