| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/sync/engine/syncer_thread.h" | 5 #include "chrome/browser/sync/engine/syncer_thread.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 CFTypeRef object = IORegistryEntryCreateCFProperty(hid_service, | 853 CFTypeRef object = IORegistryEntryCreateCFProperty(hid_service, |
| 854 CFSTR("HIDIdleTime"), | 854 CFSTR("HIDIdleTime"), |
| 855 kCFAllocatorDefault, | 855 kCFAllocatorDefault, |
| 856 0); | 856 0); |
| 857 if (!object) { | 857 if (!object) { |
| 858 LOG(WARNING) << "Could not get IOHIDSystem's HIDIdleTime property"; | 858 LOG(WARNING) << "Could not get IOHIDSystem's HIDIdleTime property"; |
| 859 IOObjectRelease(hid_service); | 859 IOObjectRelease(hid_service); |
| 860 return 0; | 860 return 0; |
| 861 } | 861 } |
| 862 | 862 |
| 863 int64 idle_time; // in nanoseconds | 863 int64 idle_time = 0; // in nanoseconds // clang pr9061 (?) |
| 864 Boolean success = false; | 864 Boolean success = false; |
| 865 if (CFGetTypeID(object) == CFNumberGetTypeID()) { | 865 if (CFGetTypeID(object) == CFNumberGetTypeID()) { |
| 866 success = CFNumberGetValue((CFNumberRef)object, | 866 success = CFNumberGetValue((CFNumberRef)object, |
| 867 kCFNumberSInt64Type, | 867 kCFNumberSInt64Type, |
| 868 &idle_time); | 868 &idle_time); |
| 869 } else { | 869 } else { |
| 870 LOG(WARNING) << "IOHIDSystem's HIDIdleTime property isn't a number!"; | 870 LOG(WARNING) << "IOHIDSystem's HIDIdleTime property isn't a number!"; |
| 871 } | 871 } |
| 872 | 872 |
| 873 CFRelease(object); | 873 CFRelease(object); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 888 was_logged = true; | 888 was_logged = true; |
| 889 VLOG(1) << "UserIdleTime unimplemented on this platform, synchronization " | 889 VLOG(1) << "UserIdleTime unimplemented on this platform, synchronization " |
| 890 "will not throttle when user idle"; | 890 "will not throttle when user idle"; |
| 891 } | 891 } |
| 892 #endif | 892 #endif |
| 893 | 893 |
| 894 return 0; | 894 return 0; |
| 895 } | 895 } |
| 896 | 896 |
| 897 } // namespace browser_sync | 897 } // namespace browser_sync |
| OLD | NEW |