| OLD | NEW |
| 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 "net/ftp/ftp_network_transaction.h" | 5 #include "net/ftp/ftp_network_transaction.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 std::string::size_type pos = gurl_path.rfind(';'); | 480 std::string::size_type pos = gurl_path.rfind(';'); |
| 481 if (pos != std::string::npos) | 481 if (pos != std::string::npos) |
| 482 gurl_path.resize(pos); | 482 gurl_path.resize(pos); |
| 483 | 483 |
| 484 path.append(gurl_path); | 484 path.append(gurl_path); |
| 485 } | 485 } |
| 486 // Make sure that if the path is expected to be a file, it won't end | 486 // Make sure that if the path is expected to be a file, it won't end |
| 487 // with a trailing slash. | 487 // with a trailing slash. |
| 488 if (!is_directory && path.length() > 1 && path.back() == '/') | 488 if (!is_directory && path.length() > 1 && path.back() == '/') |
| 489 path.erase(path.length() - 1); | 489 path.erase(path.length() - 1); |
| 490 UnescapeRule::Type unescape_rules = UnescapeRule::SPACES | | 490 UnescapeRule::Type unescape_rules = |
| 491 UnescapeRule::URL_SPECIAL_CHARS; | 491 UnescapeRule::SPACES | |
| 492 UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS; |
| 492 // This may unescape to non-ASCII characters, but we allow that. See the | 493 // This may unescape to non-ASCII characters, but we allow that. See the |
| 493 // comment for IsValidFTPCommandString. | 494 // comment for IsValidFTPCommandString. |
| 494 path = UnescapeURLComponent(path, unescape_rules); | 495 path = UnescapeURLComponent(path, unescape_rules); |
| 495 | 496 |
| 496 if (system_type_ == SYSTEM_TYPE_VMS) { | 497 if (system_type_ == SYSTEM_TYPE_VMS) { |
| 497 if (is_directory) | 498 if (is_directory) |
| 498 path = FtpUtil::UnixDirectoryPathToVMS(path); | 499 path = FtpUtil::UnixDirectoryPathToVMS(path); |
| 499 else | 500 else |
| 500 path = FtpUtil::UnixFilePathToVMS(path); | 501 path = FtpUtil::UnixFilePathToVMS(path); |
| 501 } | 502 } |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 if (!had_error_type[type]) { | 1373 if (!had_error_type[type]) { |
| 1373 had_error_type[type] = true; | 1374 had_error_type[type] = true; |
| 1374 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", | 1375 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", |
| 1375 type, NUM_OF_NET_ERROR_TYPES); | 1376 type, NUM_OF_NET_ERROR_TYPES); |
| 1376 } | 1377 } |
| 1377 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", | 1378 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", |
| 1378 type, NUM_OF_NET_ERROR_TYPES); | 1379 type, NUM_OF_NET_ERROR_TYPES); |
| 1379 } | 1380 } |
| 1380 | 1381 |
| 1381 } // namespace net | 1382 } // namespace net |
| OLD | NEW |