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

Side by Side Diff: chrome_frame/html_utils.cc

Issue 12087091: Move string tokenizer to base/strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome_frame/test/test_server.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) 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 "chrome_frame/html_utils.h" 5 #include "chrome_frame/html_utils.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <urlmon.h> 8 #include <urlmon.h>
9 9
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/string_tokenizer.h"
12 #include "base/stringprintf.h" 11 #include "base/stringprintf.h"
12 #include "base/strings/string_tokenizer.h"
13 #include "chrome/common/chrome_version_info.h" 13 #include "chrome/common/chrome_version_info.h"
14 #include "chrome_frame/utils.h" 14 #include "chrome_frame/utils.h"
15 #include "net/base/net_util.h" 15 #include "net/base/net_util.h"
16 #include "webkit/user_agent/user_agent_util.h" 16 #include "webkit/user_agent/user_agent_util.h"
17 17
18 const wchar_t kQuotes[] = L"\"'"; 18 const wchar_t kQuotes[] = L"\"'";
19 const char kXFrameOptionsHeader[] = "X-Frame-Options"; 19 const char kXFrameOptionsHeader[] = "X-Frame-Options";
20 const char kXFrameOptionsValueAllowAll[] = "allowall"; 20 const char kXFrameOptionsValueAllowAll[] = "allowall";
21 21
22 HTMLScanner::StringRange::StringRange() { 22 HTMLScanner::StringRange::StringRange() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 StringRange* attribute_value) const { 75 StringRange* attribute_value) const {
76 if (NULL == attribute_name || NULL == attribute_value) { 76 if (NULL == attribute_name || NULL == attribute_value) {
77 NOTREACHED(); 77 NOTREACHED();
78 return false; 78 return false;
79 } 79 }
80 80
81 // Use this so we can use the convenience method LowerCaseEqualsASCII() 81 // Use this so we can use the convenience method LowerCaseEqualsASCII()
82 // from string_util.h. 82 // from string_util.h.
83 std::string search_name_ascii(WideToASCII(attribute_name)); 83 std::string search_name_ascii(WideToASCII(attribute_name));
84 84
85 WStringTokenizer tokenizer(start_, end_, L" =/"); 85 base::WStringTokenizer tokenizer(start_, end_, L" =/");
86 tokenizer.set_options(WStringTokenizer::RETURN_DELIMS); 86 tokenizer.set_options(base::WStringTokenizer::RETURN_DELIMS);
87 87
88 // Set up the quote chars so that we get quoted attribute values as single 88 // Set up the quote chars so that we get quoted attribute values as single
89 // tokens. 89 // tokens.
90 tokenizer.set_quote_chars(L"\"'"); 90 tokenizer.set_quote_chars(L"\"'");
91 91
92 const bool PARSE_STATE_NAME = true; 92 const bool PARSE_STATE_NAME = true;
93 const bool PARSE_STATE_VALUE = false; 93 const bool PARSE_STATE_VALUE = false;
94 bool parse_state = PARSE_STATE_NAME; 94 bool parse_state = PARSE_STATE_NAME;
95 95
96 // Used to skip the first token, which is the tag name. 96 // Used to skip the first token, which is the tag name.
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 const std::string& headers) { 466 const std::string& headers) {
467 net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\r\n"); 467 net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\r\n");
468 while (it.GetNext()) { 468 while (it.GetNext()) {
469 if (!lstrcmpiA(it.name().c_str(), header.c_str())) 469 if (!lstrcmpiA(it.name().c_str(), header.c_str()))
470 return std::string(it.values_begin(), it.values_end()); 470 return std::string(it.values_begin(), it.values_end());
471 } 471 }
472 return std::string(); 472 return std::string();
473 } 473 }
474 474
475 } // namespace http_utils 475 } // namespace http_utils
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome_frame/test/test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698