Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_BASE_HOST_MAPPING_RULES_H_ | 5 #ifndef NET_BASE_HOST_MAPPING_RULES_H_ |
| 6 #define NET_BASE_HOST_MAPPING_RULES_H_ | 6 #define NET_BASE_HOST_MAPPING_RULES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 class HostPortPair; | 15 class HostPortPair; |
| 16 | 16 |
| 17 class NET_EXPORT_PRIVATE HostMappingRules { | 17 class NET_EXPORT_PRIVATE HostMappingRules { |
| 18 public: | 18 public: |
| 19 HostMappingRules(); | 19 HostMappingRules(); |
| 20 ~HostMappingRules(); | 20 ~HostMappingRules(); |
| 21 | 21 |
| 22 // Modifies |*host_port| based on the current rules. Returns true if the | 22 // Modifies |*host_port| based on the current rules. Returns true if |
| 23 // RequestInfo was modified, false otherwise. | 23 // |*host_port| was modified, false otherwise. |
|
wtc
2014/02/13 01:16:17
An alternative fix is "if the HostPortPair was mod
| |
| 24 bool RewriteHost(HostPortPair* host_port) const; | 24 bool RewriteHost(HostPortPair* host_port) const; |
| 25 | 25 |
| 26 // Adds a rule to this mapper. The format of the rule can be one of: | 26 // Adds a rule to this mapper. The format of the rule can be one of: |
| 27 // | 27 // |
| 28 // "MAP" <hostname_pattern> <replacement_host> [":" <replacement_port>] | 28 // "MAP" <hostname_pattern> <replacement_host> [":" <replacement_port>] |
| 29 // "EXCLUDE" <hostname_pattern> | 29 // "EXCLUDE" <hostname_pattern> |
| 30 // | 30 // |
| 31 // The <replacement_host> can be either a hostname, or an IP address literal. | 31 // The <replacement_host> can be either a hostname, or an IP address literal. |
| 32 // | 32 // |
| 33 // Returns true if the rule was successfully parsed and added. | 33 // Returns true if the rule was successfully parsed and added. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 45 | 45 |
| 46 MapRuleList map_rules_; | 46 MapRuleList map_rules_; |
| 47 ExclusionRuleList exclusion_rules_; | 47 ExclusionRuleList exclusion_rules_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(HostMappingRules); | 49 DISALLOW_COPY_AND_ASSIGN(HostMappingRules); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace net | 52 } // namespace net |
| 53 | 53 |
| 54 #endif // NET_BASE_HOST_MAPPING_RULES_H_ | 54 #endif // NET_BASE_HOST_MAPPING_RULES_H_ |
| OLD | NEW |