#include "atom/browser/api/atom_api_protocol.h"
-#include "base/stl_util.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/net/adapter_request_job.h"
#include "atom/browser/net/atom_url_request_job_factory.h"
Protocol::Protocol()
: job_factory_(AtomBrowserContext::Get()->job_factory()) {
+ CHECK(job_factory_);
}
Protocol::JsProtocolHandler Protocol::GetProtocolHandler(
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
- // Make sure the job factory has been created.
- atom::AtomBrowserContext::Get()->url_request_context_getter()->
- GetURLRequestContext();
-
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("protocol", atom::api::Protocol::Create(isolate));
namespace atom {
AtomBrowserContext::AtomBrowserContext()
- : job_factory_(NULL) {
+ : job_factory_(new AtomURLRequestJobFactory) {
}
AtomBrowserContext::~AtomBrowserContext() {
AtomBrowserContext::CreateURLRequestJobFactory(
content::ProtocolHandlerMap* handlers,
content::ProtocolHandlerScopedVector* interceptors) {
- job_factory_ = new AtomURLRequestJobFactory;
scoped_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
for (content::ProtocolHandlerMap::iterator it = handlers->begin();