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

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

Issue 2848493007: Reduce/Remove URLRequest dependencies from AppCacheRequestHandler (Closed)
Patch Set: Add comments 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 #include "content/browser/appcache/appcache_request.h"
7 #include "content/browser/appcache/appcache_url_loader_job.h"
8 #include "content/browser/appcache/appcache_url_request_job.h"
9
10 namespace content {
11
12 std::unique_ptr<AppCacheJob> AppCacheJob::Create(
13 kJobType job_type,
14 bool is_main_resource,
15 AppCacheHost* host,
16 AppCacheStorage* storage,
17 AppCacheRequest* request,
18 net::NetworkDelegate* network_delegate,
19 const OnPrepareToRestartCallback& restart_callback) {
20 std::unique_ptr<AppCacheJob> job;
21 if (job_type == kJobType::URL_REQUEST_JOB) {
22 job.reset(new AppCacheURLRequestJob(request->GetURLRequest(),
23 network_delegate, storage, host,
24 is_main_resource, restart_callback));
25 } else if (job_type == kJobType::URL_LOADER_JOB) {
26 job.reset(new AppCacheURLLoaderJob);
27 } else {
28 NOTREACHED();
29 }
30 return job;
31 }
32
33 base::WeakPtr<AppCacheJob> AppCacheJob::GetWeakPtr() {
34 return weak_factory_.GetWeakPtr();
35 }
36
37 net::URLRequestJob* AppCacheJob::AsURLRequestJob() {
38 return nullptr;
39 }
40
41 AppCacheJob::AppCacheJob() : weak_factory_(this) {}
42
43 } // 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