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

Side by Side Diff: tools/android/forwarder2/daemon.cc

Issue 17780002: Rewrite scoped_ptr<T>(NULL) to use the default ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service_android.cc ('k') | 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 (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 "tools/android/forwarder2/daemon.h" 5 #include "tools/android/forwarder2/daemon.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <sys/file.h> 10 #include <sys/file.h>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (socket->Read(buf, sizeof(buf)) < 0) { 144 if (socket->Read(buf, sizeof(buf)) < 0) {
145 perror("read"); 145 perror("read");
146 continue; 146 continue;
147 } 147 }
148 if (expected_welcome_message != buf) { 148 if (expected_welcome_message != buf) {
149 LOG(ERROR) << "Unexpected message read from daemon: " << buf; 149 LOG(ERROR) << "Unexpected message read from daemon: " << buf;
150 break; 150 break;
151 } 151 }
152 return socket.Pass(); 152 return socket.Pass();
153 } 153 }
154 return scoped_ptr<Socket>(NULL); 154 return scoped_ptr<Socket>();
155 } 155 }
156 156
157 } // namespace 157 } // namespace
158 158
159 Daemon::Daemon(const std::string& log_file_path, 159 Daemon::Daemon(const std::string& log_file_path,
160 const std::string& identifier, 160 const std::string& identifier,
161 ClientDelegate* client_delegate, 161 ClientDelegate* client_delegate,
162 ServerDelegate* server_delegate, 162 ServerDelegate* server_delegate,
163 GetExitNotifierFDCallback get_exit_fd_callback) 163 GetExitNotifierFDCallback get_exit_fd_callback)
164 : log_file_path_(log_file_path), 164 : log_file_path_(log_file_path),
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 return true; 280 return true;
281 } 281 }
282 usleep(kIdleTimeMSec * 1000); 282 usleep(kIdleTimeMSec * 1000);
283 } 283 }
284 LOG(ERROR) << "Timed out while killing daemon. " 284 LOG(ERROR) << "Timed out while killing daemon. "
285 "It might still be tearing down."; 285 "It might still be tearing down.";
286 return false; 286 return false;
287 } 287 }
288 288
289 } // namespace forwarder2 289 } // namespace forwarder2
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698