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

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

Issue 552162: Add an implementation for async_network_alive to Linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « no previous file | chrome/browser/sync/notifier/base/linux/async_network_alive_linux.cc » ('j') | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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 4
5 #include "chrome/browser/sync/engine/syncapi.h" 5 #include "chrome/browser/sync/engine/syncapi.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 if (result < 0) { 243 if (result < 0) {
244 LOG(ERROR) << "select() returned unexpected result " << result; 244 LOG(ERROR) << "select() returned unexpected result " << result;
245 break; 245 break;
246 } 246 }
247 247
248 // If exit_pipe was written to, we're done. 248 // If exit_pipe was written to, we're done.
249 if (FD_ISSET(params_->exit_pipe[0], &rdfs)) { 249 if (FD_ISSET(params_->exit_pipe[0], &rdfs)) {
250 break; 250 break;
251 } 251 }
252 252
253 // If result is 0, select timed out. 253 // If fd is set, the network address might have changed.
254 if (FD_ISSET(fd, &rdfs)) { 254 if (FD_ISSET(fd, &rdfs)) {
255 char buf[4096]; 255 char buf[4096];
256 struct iovec iov = { buf, sizeof(buf) }; 256 struct iovec iov = { buf, sizeof(buf) };
257 struct sockaddr_nl sa; 257 struct sockaddr_nl sa;
258 258
259 struct msghdr msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; 259 struct msghdr msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 };
260 recvmsg(fd, &msg, 0); 260 recvmsg(fd, &msg, 0);
261 261
262 params_->conn_mgr->CheckServerReachable(); 262 params_->conn_mgr->CheckServerReachable();
263 } else { 263 } else {
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 BaseTransaction::~BaseTransaction() { 1695 BaseTransaction::~BaseTransaction() {
1696 delete lookup_; 1696 delete lookup_;
1697 } 1697 }
1698 1698
1699 UserShare* SyncManager::GetUserShare() const { 1699 UserShare* SyncManager::GetUserShare() const {
1700 DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; 1700 DCHECK(data_->initialized()) << "GetUserShare requires initialization!";
1701 return data_->GetUserShare(); 1701 return data_->GetUserShare();
1702 } 1702 }
1703 1703
1704 } // namespace sync_api 1704 } // namespace sync_api
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/base/linux/async_network_alive_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698