Skip to content

Commit

Permalink
fix compilation for 7-1-x
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Jan 15, 2020
1 parent 047158b commit 644c1bd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions native_mate/native_mate/converter.h
Expand Up @@ -241,6 +241,18 @@ struct Converter<std::vector<T>> {
}
};

template <typename T1, typename T2>
struct Converter<std::pair<T1, T2>> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const std::pair<T1, T2>& val) {
v8::Local<v8::Array> result(v8::Array::New(isolate, 2));
auto context = isolate->GetCurrentContext();
result->Set(context, 0, Converter<T1>::ToV8(isolate, val.first)).Check();
result->Set(context, 1, Converter<T2>::ToV8(isolate, val.second)).Check();
return result;
}
};

template <typename T>
struct Converter<std::set<T>> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
Expand Down
6 changes: 3 additions & 3 deletions shell/browser/api/atom_api_url_loader.cc
Expand Up @@ -33,21 +33,21 @@
#include "shell/common/node_includes.h"
#include "shell/common/promise_util.h"

namespace gin {
namespace mate {

template <>
struct Converter<network::mojom::HttpRawHeaderPairPtr> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const network::mojom::HttpRawHeaderPairPtr& pair) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
dict.Set("key", base::ToLowerASCII(pair->key));
dict.Set("value", pair->value);
return dict.GetHandle();
}
};

} // namespace gin
} // namespace mate

namespace electron {

Expand Down

0 comments on commit 644c1bd

Please sign in to comment.