Use multimap type for storing header values (issue #386).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@346 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-10-28 21:31:26 +00:00
parent 0ec9541b78
commit ef80d4ae6b
17 changed files with 419 additions and 45 deletions

View File

@@ -94,13 +94,13 @@ void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap)
if(CEF_MEMBER_MISSING(struct_, get_header_map))
return;
cef_string_map_t map = cef_string_map_alloc();
cef_string_multimap_t map = cef_string_multimap_alloc();
if(!map)
return;
struct_->get_header_map(struct_, map);
transfer_string_map_contents(map, headerMap);
cef_string_map_free(map);
transfer_string_multimap_contents(map, headerMap);
cef_string_multimap_free(map);
}
void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap)
@@ -108,18 +108,18 @@ void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap)
if(CEF_MEMBER_MISSING(struct_, set_header_map))
return;
cef_string_map_t map = NULL;
cef_string_multimap_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
map = cef_string_multimap_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
transfer_string_multimap_contents(headerMap, map);
}
struct_->set_header_map(struct_, map);
if(map)
cef_string_map_free(map);
cef_string_multimap_free(map);
}
void CefRequestCToCpp::Set(const CefString& url, const CefString& method,
@@ -132,19 +132,19 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method,
if(postData.get())
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
cef_string_map_t map = NULL;
cef_string_multimap_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
map = cef_string_multimap_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
transfer_string_multimap_contents(headerMap, map);
}
struct_->set(struct_, url.GetStruct(), method.GetStruct(), postDataStruct,
map);
if(map)
cef_string_map_free(map);
cef_string_multimap_free(map);
}
CefRequest::RequestFlags CefRequestCToCpp::GetFlags()