| Index: content/browser/appcache/appcache_job.cc
|
| diff --git a/content/browser/appcache/appcache_job.cc b/content/browser/appcache/appcache_job.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0666c926811dbdb7047fb8e0fbef6f4d09854e37
|
| --- /dev/null
|
| +++ b/content/browser/appcache/appcache_job.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright (c) 2017 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/appcache/appcache_job.h"
|
| +
|
| +#include "base/command_line.h"
|
| +#include "content/browser/appcache/appcache_request.h"
|
| +#include "content/browser/appcache/appcache_url_loader_job.h"
|
| +#include "content/browser/appcache/appcache_url_request_job.h"
|
| +
|
| +#include "content/public/common/content_switches.h"
|
| +
|
| +namespace content {
|
| +
|
| +std::unique_ptr<AppCacheJob> AppCacheJob::Create(
|
| + bool is_main_resource,
|
| + AppCacheHost* host,
|
| + AppCacheStorage* storage,
|
| + AppCacheRequest* request,
|
| + net::NetworkDelegate* network_delegate,
|
| + const OnPrepareToRestartCallback& restart_callback) {
|
| + std::unique_ptr<AppCacheJob> job;
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableNetworkService)) {
|
| + job.reset(new AppCacheURLLoaderJob);
|
| + } else {
|
| + job.reset(new AppCacheURLRequestJob(request->GetURLRequest(),
|
| + network_delegate, storage, host,
|
| + is_main_resource, restart_callback));
|
| + }
|
| + return job;
|
| +}
|
| +
|
| +AppCacheJob::~AppCacheJob() {}
|
| +
|
| +base::WeakPtr<AppCacheJob> AppCacheJob::GetWeakPtr() {
|
| + return weak_factory_.GetWeakPtr();
|
| +}
|
| +
|
| +net::URLRequestJob* AppCacheJob::AsURLRequestJob() {
|
| + return nullptr;
|
| +}
|
| +
|
| +AppCacheJob::AppCacheJob() : weak_factory_(this) {}
|
| +
|
| +} // namespace content
|
|
|