Make sure the job factory is created when initializing protocol module.

Fixes atom/atom#1963, the regression came when moving to use native-mate
to reimplment the APIs.
This commit is contained in:
Cheng Zhao 2014-05-07 09:16:45 +08:00
parent c841d90529
commit a67c54869f

View file

@ -322,6 +322,10 @@ mate::Handle<Protocol> Protocol::Create(v8::Isolate* isolate) {
namespace { namespace {
void Initialize(v8::Handle<v8::Object> exports) { void Initialize(v8::Handle<v8::Object> exports) {
// Make sure the job factory has been created.
atom::AtomBrowserContext::Get()->url_request_context_getter()->
GetURLRequestContext();
v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Isolate* isolate = v8::Isolate::GetCurrent();
mate::Dictionary dict(isolate, exports); mate::Dictionary dict(isolate, exports);
dict.Set("protocol", atom::api::Protocol::Create(isolate)); dict.Set("protocol", atom::api::Protocol::Create(isolate));