using mate::Dictionary instead of base::DictionaryValue
This commit is contained in:
parent
4d5790dc09
commit
2b9826404a
3 changed files with 9 additions and 14 deletions
|
@ -312,15 +312,19 @@ void WebContents::DidStopLoading() {
|
|||
|
||||
void WebContents::DidGetResourceResponseStart(
|
||||
const content::ResourceRequestDetails& details) {
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
v8::Locker locker(isolate);
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
mate::Dictionary response_headers(isolate, v8::Object::New(isolate));
|
||||
|
||||
net::HttpResponseHeaders* headers = details.headers.get();
|
||||
base::DictionaryValue response_headers;
|
||||
void* iter = nullptr;
|
||||
std::string key;
|
||||
std::string value;
|
||||
while (headers && headers->EnumerateHeaderLines(&iter, &key, &value)) {
|
||||
response_headers.SetString(base::StringToLowerASCII(key),
|
||||
base::StringToLowerASCII(value));
|
||||
}
|
||||
while (headers && headers->EnumerateHeaderLines(&iter, &key, &value))
|
||||
response_headers.Set(base::StringToLowerASCII(key),
|
||||
base::StringToLowerASCII(value));
|
||||
|
||||
Emit("did-get-response-details",
|
||||
details.socket_address.IsEmpty(),
|
||||
details.url,
|
||||
|
|
|
@ -23,13 +23,6 @@ bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate,
|
|||
}
|
||||
}
|
||||
|
||||
v8::Handle<v8::Value> Converter<base::DictionaryValue>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const base::DictionaryValue& val) {
|
||||
scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
return converter->ToV8Value(&val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::ListValue* out) {
|
||||
|
|
|
@ -19,8 +19,6 @@ struct Converter<base::DictionaryValue> {
|
|||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::DictionaryValue* out);
|
||||
static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const base::DictionaryValue& val);
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Reference in a new issue