| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <unicode/ucnv.h> | 6 #include <unicode/ucnv.h> |
| 7 #include <unicode/uidna.h> | 7 #include <unicode/uidna.h> |
| 8 #include <unicode/ulocdata.h> | 8 #include <unicode/ulocdata.h> |
| 9 #include <unicode/uniset.h> | 9 #include <unicode/uniset.h> |
| 10 #include <unicode/uscript.h> | 10 #include <unicode/uscript.h> |
| 11 #include <unicode/uset.h> | 11 #include <unicode/uset.h> |
| 12 | 12 |
| 13 #ifdef OS_WIN | 13 #include "build/build_config.h" |
| 14 |
| 15 #if defined(OS_WIN) |
| 14 #include <windows.h> | 16 #include <windows.h> |
| 17 #elif defined(OS_POSIX) |
| 18 #include <sys/socket.h> |
| 19 #include <fcntl.h> |
| 15 #endif | 20 #endif |
| 16 | 21 |
| 17 #include "net/base/net_util.h" | 22 #include "net/base/net_util.h" |
| 18 | 23 |
| 19 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
| 20 #include "base/file_util.h" | 25 #include "base/file_util.h" |
| 21 #include "base/logging.h" | 26 #include "base/logging.h" |
| 22 #include "base/path_service.h" | 27 #include "base/path_service.h" |
| 23 #include "base/scoped_ptr.h" | 28 #include "base/scoped_ptr.h" |
| 24 #include "base/string_escape.h" | 29 #include "base/string_escape.h" |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 int array_size = arraysize(kAllowedFtpPorts); | 911 int array_size = arraysize(kAllowedFtpPorts); |
| 907 for (int i = 0; i < array_size; i++) { | 912 for (int i = 0; i < array_size; i++) { |
| 908 if (kAllowedFtpPorts[i] == port) { | 913 if (kAllowedFtpPorts[i] == port) { |
| 909 return true; | 914 return true; |
| 910 } | 915 } |
| 911 } | 916 } |
| 912 // Port not explicitly allowed by FTP, so return the default restrictions. | 917 // Port not explicitly allowed by FTP, so return the default restrictions. |
| 913 return IsPortAllowedByDefault(port); | 918 return IsPortAllowedByDefault(port); |
| 914 } | 919 } |
| 915 | 920 |
| 921 int SetNonBlocking(int fd) { |
| 922 #if defined(OS_WIN) |
| 923 unsigned long no_block = 1; |
| 924 return ioctlsocket(fd, FIONBIO, &no_block); |
| 925 #elif defined(OS_POSIX) |
| 926 int flags = fcntl(fd, F_GETFL, 0); |
| 927 if (-1 == flags) |
| 928 flags = 0; |
| 929 return fcntl(fd, F_SETFL, 0); |
| 930 #endif |
| 931 } |
| 932 |
| 916 } // namespace net | 933 } // namespace net |
| OLD | NEW |