Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: content/browser/appcache/appcache_job.cc

Issue 2865613002: Add an abstraction for a job in the AppCacheRequestHandler class. (Closed)
Patch Set: Fix compile failures Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/appcache/appcache_job.h ('k') | content/browser/appcache/appcache_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/appcache/appcache_job.h"
6
7 #include "base/command_line.h"
8 #include "content/browser/appcache/appcache_request.h"
9 #include "content/browser/appcache/appcache_url_loader_job.h"
10 #include "content/browser/appcache/appcache_url_request_job.h"
11
12 #include "content/public/common/content_switches.h"
13
14 namespace content {
15
16 std::unique_ptr<AppCacheJob> AppCacheJob::Create(
17 bool is_main_resource,
18 AppCacheHost* host,
19 AppCacheStorage* storage,
20 AppCacheRequest* request,
21 net::NetworkDelegate* network_delegate,
22 const OnPrepareToRestartCallback& restart_callback) {
23 std::unique_ptr<AppCacheJob> job;
24 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
25 switches::kEnableNetworkService)) {
26 job.reset(new AppCacheURLLoaderJob);
27 } else {
28 job.reset(new AppCacheURLRequestJob(request->GetURLRequest(),
29 network_delegate, storage, host,
30 is_main_resource, restart_callback));
31 }
32 return job;
33 }
34
35 AppCacheJob::~AppCacheJob() {}
36
37 base::WeakPtr<AppCacheJob> AppCacheJob::GetWeakPtr() {
38 return weak_factory_.GetWeakPtr();
39 }
40
41 net::URLRequestJob* AppCacheJob::AsURLRequestJob() {
42 return nullptr;
43 }
44
45 AppCacheJob::AppCacheJob() : weak_factory_(this) {}
46
47 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_job.h ('k') | content/browser/appcache/appcache_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698