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

Side by Side Diff: chrome/common/mac/mock_launchd.cc

Issue 9845017: Fix a few warnings that -Wnull-conversion of a future clang will complain about. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/mac/mock_launchd.h" 5 #include "chrome/common/mac/mock_launchd.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #include <sys/socket.h> 8 #include <sys/socket.h>
9 #include <sys/un.h> 9 #include <sys/un.h>
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 signature.protocolFamily = PF_UNIX; 207 signature.protocolFamily = PF_UNIX;
208 signature.socketType = SOCK_STREAM; 208 signature.socketType = SOCK_STREAM;
209 signature.protocol = 0; 209 signature.protocol = 0;
210 size_t unix_addr_len = offsetof(struct sockaddr_un, 210 size_t unix_addr_len = offsetof(struct sockaddr_un,
211 sun_path) + path_len + 1; 211 sun_path) + path_len + 1;
212 base::mac::ScopedCFTypeRef<CFDataRef> address( 212 base::mac::ScopedCFTypeRef<CFDataRef> address(
213 CFDataCreate(NULL, reinterpret_cast<UInt8*>(&unix_addr), unix_addr_len)); 213 CFDataCreate(NULL, reinterpret_cast<UInt8*>(&unix_addr), unix_addr_len));
214 signature.address = address; 214 signature.address = address;
215 215
216 CFSocketRef socket = 216 CFSocketRef socket =
217 CFSocketCreateWithSocketSignature(NULL, &signature, NULL, NULL, NULL); 217 CFSocketCreateWithSocketSignature(NULL, &signature, 0, NULL, NULL);
218 218
219 local_pipe = CFSocketGetNative(socket); 219 local_pipe = CFSocketGetNative(socket);
220 EXPECT_NE(-1, local_pipe); 220 EXPECT_NE(-1, local_pipe);
221 if (local_pipe == -1) { 221 if (local_pipe == -1) {
222 if (error) { 222 if (error) {
223 *error = CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainPOSIX, 223 *error = CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainPOSIX,
224 errno, NULL); 224 errno, NULL);
225 } 225 }
226 return NULL; 226 return NULL;
227 } 227 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 Type type, 293 Type type,
294 CFStringRef name) { 294 CFStringRef name) {
295 delete_called_ = true; 295 delete_called_ = true;
296 return true; 296 return true;
297 } 297 }
298 298
299 void MockLaunchd::SignalReady() { 299 void MockLaunchd::SignalReady() {
300 ASSERT_TRUE(as_service_); 300 ASSERT_TRUE(as_service_);
301 running_lock_.reset(TakeNamedLock(pipe_name_, true)); 301 running_lock_.reset(TakeNamedLock(pipe_name_, true));
302 } 302 }
OLDNEW
« no previous file with comments | « chrome/browser/mac/install_from_dmg.mm ('k') | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698