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/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 | 829 |
830 class HostComponentTransform : public AppendComponentTransform { | 830 class HostComponentTransform : public AppendComponentTransform { |
831 public: | 831 public: |
832 explicit HostComponentTransform(const std::string& languages) | 832 explicit HostComponentTransform(const std::string& languages) |
833 : languages_(languages) { | 833 : languages_(languages) { |
834 } | 834 } |
835 | 835 |
836 private: | 836 private: |
837 virtual string16 Execute( | 837 virtual string16 Execute( |
838 const std::string& component_text, | 838 const std::string& component_text, |
839 std::vector<size_t>* offsets_into_component) const { | 839 std::vector<size_t>* offsets_into_component) const OVERRIDE { |
840 return IDNToUnicodeWithOffsets(component_text, languages_, | 840 return IDNToUnicodeWithOffsets(component_text, languages_, |
841 offsets_into_component); | 841 offsets_into_component); |
842 } | 842 } |
843 | 843 |
844 const std::string& languages_; | 844 const std::string& languages_; |
845 }; | 845 }; |
846 | 846 |
847 class NonHostComponentTransform : public AppendComponentTransform { | 847 class NonHostComponentTransform : public AppendComponentTransform { |
848 public: | 848 public: |
849 explicit NonHostComponentTransform(UnescapeRule::Type unescape_rules) | 849 explicit NonHostComponentTransform(UnescapeRule::Type unescape_rules) |
850 : unescape_rules_(unescape_rules) { | 850 : unescape_rules_(unescape_rules) { |
851 } | 851 } |
852 | 852 |
853 private: | 853 private: |
854 virtual string16 Execute( | 854 virtual string16 Execute( |
855 const std::string& component_text, | 855 const std::string& component_text, |
856 std::vector<size_t>* offsets_into_component) const { | 856 std::vector<size_t>* offsets_into_component) const OVERRIDE { |
857 return (unescape_rules_ == UnescapeRule::NONE) ? | 857 return (unescape_rules_ == UnescapeRule::NONE) ? |
858 UTF8ToUTF16AndAdjustOffsets(component_text, offsets_into_component) : | 858 UTF8ToUTF16AndAdjustOffsets(component_text, offsets_into_component) : |
859 UnescapeAndDecodeUTF8URLComponentWithOffsets(component_text, | 859 UnescapeAndDecodeUTF8URLComponentWithOffsets(component_text, |
860 unescape_rules_, offsets_into_component); | 860 unescape_rules_, offsets_into_component); |
861 } | 861 } |
862 | 862 |
863 const UnescapeRule::Type unescape_rules_; | 863 const UnescapeRule::Type unescape_rules_; |
864 }; | 864 }; |
865 | 865 |
866 void AppendFormattedComponent(const std::string& spec, | 866 void AppendFormattedComponent(const std::string& spec, |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2388 | 2388 |
2389 NetworkInterface::NetworkInterface(const std::string& name, | 2389 NetworkInterface::NetworkInterface(const std::string& name, |
2390 const IPAddressNumber& address) | 2390 const IPAddressNumber& address) |
2391 : name(name), address(address) { | 2391 : name(name), address(address) { |
2392 } | 2392 } |
2393 | 2393 |
2394 NetworkInterface::~NetworkInterface() { | 2394 NetworkInterface::~NetworkInterface() { |
2395 } | 2395 } |
2396 | 2396 |
2397 } // namespace net | 2397 } // namespace net |
OLD | NEW |