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

Side by Side Diff: net/base/net_util.cc

Issue 1744003: Send content settings based on the URL to the renderer instead of just the host. (Closed)
Patch Set: nits Created 10 years, 8 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
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_unittest.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <map> 8 #include <map>
9 #include <unicode/ucnv.h> 9 #include <unicode/ucnv.h>
10 #include <unicode/uidna.h> 10 #include <unicode/uidna.h>
11 #include <unicode/ulocdata.h> 11 #include <unicode/ulocdata.h>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "base/string_tokenizer.h" 46 #include "base/string_tokenizer.h"
47 #include "base/string_util.h" 47 #include "base/string_util.h"
48 #include "base/sys_string_conversions.h" 48 #include "base/sys_string_conversions.h"
49 #include "base/time.h" 49 #include "base/time.h"
50 #include "base/utf_offset_string_conversions.h" 50 #include "base/utf_offset_string_conversions.h"
51 #include "base/utf_string_conversions.h" 51 #include "base/utf_string_conversions.h"
52 #include "grit/net_resources.h" 52 #include "grit/net_resources.h"
53 #include "googleurl/src/gurl.h" 53 #include "googleurl/src/gurl.h"
54 #include "googleurl/src/url_canon.h" 54 #include "googleurl/src/url_canon.h"
55 #include "googleurl/src/url_parse.h" 55 #include "googleurl/src/url_parse.h"
56 #include "net/base/dns_util.h"
56 #include "net/base/escape.h" 57 #include "net/base/escape.h"
57 #include "net/base/net_module.h" 58 #include "net/base/net_module.h"
58 #if defined(OS_WIN) 59 #if defined(OS_WIN)
59 #include "net/base/winsock_init.h" 60 #include "net/base/winsock_init.h"
60 #endif 61 #endif
61 #include "unicode/datefmt.h" 62 #include "unicode/datefmt.h"
62 63
63 64
64 using base::Time; 65 using base::Time;
65 66
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 std::wstring* username, 1280 std::wstring* username,
1280 std::wstring* password) { 1281 std::wstring* password) {
1281 UnescapeRule::Type flags = 1282 UnescapeRule::Type flags =
1282 UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS; 1283 UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS;
1283 *username = UTF16ToWideHack(UnescapeAndDecodeUTF8URLComponent(url.username(), 1284 *username = UTF16ToWideHack(UnescapeAndDecodeUTF8URLComponent(url.username(),
1284 flags, NULL)); 1285 flags, NULL));
1285 *password = UTF16ToWideHack(UnescapeAndDecodeUTF8URLComponent(url.password(), 1286 *password = UTF16ToWideHack(UnescapeAndDecodeUTF8URLComponent(url.password(),
1286 flags, NULL)); 1287 flags, NULL));
1287 } 1288 }
1288 1289
1290 std::string GetHostOrSpecFromURL(const GURL& url) {
1291 return url.has_host() ? net::TrimEndingDot(url.host()) : url.spec();
1292 }
1293
1289 void AppendFormattedHost(const GURL& url, 1294 void AppendFormattedHost(const GURL& url,
1290 const std::wstring& languages, 1295 const std::wstring& languages,
1291 std::wstring* output, 1296 std::wstring* output,
1292 url_parse::Parsed* new_parsed, 1297 url_parse::Parsed* new_parsed,
1293 size_t* offset_for_adjustment) { 1298 size_t* offset_for_adjustment) {
1294 DCHECK(output); 1299 DCHECK(output);
1295 const url_parse::Component& host = 1300 const url_parse::Component& host =
1296 url.parsed_for_possibly_invalid_spec().host; 1301 url.parsed_for_possibly_invalid_spec().host;
1297 1302
1298 if (host.is_nonempty()) { 1303 if (host.is_nonempty()) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 1686
1682 IPv6SupportResults(IPV6_GLOBAL_ADDRESS_MISSING); 1687 IPv6SupportResults(IPV6_GLOBAL_ADDRESS_MISSING);
1683 return false; 1688 return false;
1684 #else 1689 #else
1685 NOTIMPLEMENTED(); 1690 NOTIMPLEMENTED();
1686 return true; 1691 return true;
1687 #endif // defined(various platforms) 1692 #endif // defined(various platforms)
1688 } 1693 }
1689 1694
1690 } // namespace net 1695 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698