Commit 0079fbab authored by mohan.reddy's avatar mohan.reddy Committed by Commit bot

Use of base::StringPairs appropriately in content

Using  base::StringPairs in base folder
Becuase base/strings/string_split.h defines:
typedef std::vector<std::pair<std::string, std::string> > StringPairs;

BUG=412250

Review URL: https://codereview.chromium.org/598323002

Cr-Commit-Position: refs/heads/master@{#296676}
parent bd641ec9
......@@ -173,7 +173,7 @@ int32 BrowserAccessibility::GetState() const {
return GetData().state;
}
const std::vector<std::pair<std::string, std::string> >&
const BrowserAccessibility::HtmlAttributes&
BrowserAccessibility::GetHtmlAttributes() const {
return GetData().html_attributes;
}
......
......@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/strings/string_split.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/web/WebAXEnums.h"
......@@ -160,7 +161,7 @@ class CONTENT_EXPORT BrowserAccessibility {
int32 GetRole() const;
int32 GetState() const;
typedef std::vector<std::pair<std::string, std::string> > HtmlAttributes;
typedef base::StringPairs HtmlAttributes;
const HtmlAttributes& GetHtmlAttributes() const;
#if defined(OS_MACOSX) && __OBJC__
......
......@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/memory/singleton.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
......@@ -23,7 +24,7 @@ bool EnumerateLinkHeaders(
void** iter,
const std::string& rel,
std::string* url,
std::vector<std::pair<std::string, std::string> >* attributes) {
base::StringPairs* attributes) {
std::string header_body;
bool rel_matched = false;
while (!rel_matched && headers->EnumerateHeader(iter, "link", &header_body)) {
......@@ -89,7 +90,7 @@ void TransitionRequestManager::ParseTransitionStylesheetsFromHeaders(
return;
std::string transition_stylesheet;
std::vector<std::pair<std::string, std::string> > attributes;
base::StringPairs attributes;
void* header_iter = NULL;
while (EnumerateLinkHeaders(headers,
&header_iter,
......
......@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
#include "base/strings/string_split.h"
#include "base/time/time.h"
#include "url/gurl.h"
......@@ -31,7 +32,7 @@ struct WebSocketHandshakeRequest {
// The request URL
GURL url;
// Additional HTTP request headers
std::vector<std::pair<std::string, std::string> > headers;
base::StringPairs headers;
// HTTP request headers raw string
std::string headers_text;
// The time that this request is sent
......
......@@ -202,7 +202,7 @@ void P2PPortAllocatorSession::AllocateLegacyRelaySession() {
}
void P2PPortAllocatorSession::ParseRelayResponse() {
std::vector<std::pair<std::string, std::string> > value_pairs;
base::StringPairs value_pairs;
if (!base::SplitStringIntoKeyValuePairs(relay_session_response_, '=', '\n',
&value_pairs)) {
LOG(ERROR) << "Received invalid response from relay server";
......@@ -214,8 +214,7 @@ void P2PPortAllocatorSession::ParseRelayResponse() {
relay_tcp_port_ = 0;
relay_ssltcp_port_ = 0;
for (std::vector<std::pair<std::string, std::string> >::iterator
it = value_pairs.begin();
for (base::StringPairs::iterator it = value_pairs.begin();
it != value_pairs.end(); ++it) {
std::string key;
std::string value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment