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

Side by Side Diff: chrome/browser/sync/engine/syncer_thread.cc

Issue 279004: Made sync code build and pass unit tests on OS X. (Closed)
Patch Set: Fixed uninitialized var error. Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/browser/sync/engine/syncer_thread.h" 4 #include "chrome/browser/sync/engine/syncer_thread.h"
5 5
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #ifdef OS_MACOSX 8 #ifdef OS_MACOSX
9 #include <CoreFoundation/CFNumber.h> 9 #include <CoreFoundation/CFNumber.h>
10 #include <IOKit/IOTypes.h> 10 #include <IOKit/IOTypes.h>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 CFSTR("HIDIdleTime"), 68 CFSTR("HIDIdleTime"),
69 kCFAllocatorDefault, 69 kCFAllocatorDefault,
70 0); 70 0);
71 if (!object) { 71 if (!object) {
72 LOG(WARNING) << "Could not get IOHIDSystem's HIDIdleTime property"; 72 LOG(WARNING) << "Could not get IOHIDSystem's HIDIdleTime property";
73 IOObjectRelease(hid_service); 73 IOObjectRelease(hid_service);
74 return 0; 74 return 0;
75 } 75 }
76 76
77 int64 idle_time; // in nanoseconds 77 int64 idle_time; // in nanoseconds
78 Boolean success; 78 Boolean success = false;
79 if (CFGetTypeID(object) == CFNumberGetTypeID()) { 79 if (CFGetTypeID(object) == CFNumberGetTypeID()) {
80 success = CFNumberGetValue((CFNumberRef)object, 80 success = CFNumberGetValue((CFNumberRef)object,
81 kCFNumberSInt64Type, 81 kCFNumberSInt64Type,
82 &idle_time); 82 &idle_time);
83 } else { 83 } else {
84 LOG(WARNING) << "IOHIDSystem's HIDIdleTime property isn't a number!"; 84 LOG(WARNING) << "IOHIDSystem's HIDIdleTime property isn't a number!";
85 } 85 }
86 86
87 CFRelease(object); 87 CFRelease(object);
88 IOObjectRelease(hid_service); 88 IOObjectRelease(hid_service);
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 break; 682 break;
683 } 683 }
684 684
685 if (NULL != vault_.syncer_) { 685 if (NULL != vault_.syncer_) {
686 vault_.syncer_->set_notifications_enabled( 686 vault_.syncer_->set_notifications_enabled(
687 p2p_authenticated_ && p2p_subscribed_); 687 p2p_authenticated_ && p2p_subscribed_);
688 } 688 }
689 } 689 }
690 690
691 } // namespace browser_sync 691 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698