| Index: content/browser/service_worker/service_worker_url_request_job_factory.cc
|
| diff --git a/content/browser/service_worker/service_worker_url_request_job_factory.cc b/content/browser/service_worker/service_worker_url_request_job_factory.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8ce949c4bedccb2ebc9fcc1617f3a64bcbfb7f7a
|
| --- /dev/null
|
| +++ b/content/browser/service_worker/service_worker_url_request_job_factory.cc
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/service_worker/service_worker_url_request_job_factory.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "content/public/common/url_constants.h"
|
| +#include "net/url_request/url_request_job_factory_impl.h"
|
| +
|
| +namespace content {
|
| +
|
| +namespace {
|
| +
|
| +class ServiceWorkerProtocolHandler
|
| + : public net::URLRequestJobFactory::ProtocolHandler {
|
| + public:
|
| + explicit ServiceWorkerProtocolHandler() {}
|
| + virtual ~ServiceWorkerProtocolHandler() {}
|
| +
|
| + virtual net::URLRequestJob* MaybeCreateJob(
|
| + net::URLRequest* request,
|
| + net::NetworkDelegate* network_delegate) const OVERRIDE {
|
| + // TODO(kinuko): Implement this.
|
| + NOTIMPLEMENTED();
|
| + return NULL;
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProtocolHandler);
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +scoped_ptr<net::URLRequestJobFactory>
|
| +CreateServiceWorkerURLRequestJobFactory() {
|
| + scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| + new net::URLRequestJobFactoryImpl);
|
| + job_factory->SetProtocolHandler(
|
| + kHttpScheme, new ServiceWorkerProtocolHandler);
|
| + job_factory->SetProtocolHandler(
|
| + kHttpsScheme, new ServiceWorkerProtocolHandler);
|
| + return job_factory.PassAs<net::URLRequestJobFactory>();
|
| +}
|
| +
|
| +} // namespace content
|
|
|