OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/background_fetch/background_fetch_context.h" | 5 #include "content/browser/background_fetch/background_fetch_context.h" |
6 | 6 |
7 #include "content/browser/background_fetch/background_fetch_job_info.h" | 7 #include "content/browser/background_fetch/background_fetch_job_info.h" |
8 #include "content/browser/background_fetch/background_fetch_request_info.h" | 8 #include "content/browser/background_fetch/background_fetch_request_info.h" |
9 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 9 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // ServiceWorkerContextObserver as a parent class and should register as an | 26 // ServiceWorkerContextObserver as a parent class and should register as an |
27 // observer here. | 27 // observer here. |
28 } | 28 } |
29 | 29 |
30 BackgroundFetchContext::~BackgroundFetchContext() { | 30 BackgroundFetchContext::~BackgroundFetchContext() { |
31 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 31 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
32 } | 32 } |
33 | 33 |
34 void BackgroundFetchContext::Init() { | 34 void BackgroundFetchContext::Init() { |
35 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 35 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
36 | |
37 // TODO(harkness): Create the Download observer. | |
38 } | 36 } |
39 | 37 |
40 void BackgroundFetchContext::Shutdown() { | 38 void BackgroundFetchContext::Shutdown() { |
41 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 39 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
42 | 40 |
43 BrowserThread::PostTask( | 41 BrowserThread::PostTask( |
44 BrowserThread::IO, FROM_HERE, | 42 BrowserThread::IO, FROM_HERE, |
45 base::Bind(&BackgroundFetchContext::ShutdownOnIO, this)); | 43 base::Bind(&BackgroundFetchContext::ShutdownOnIO, this)); |
46 } | 44 } |
47 | 45 |
(...skipping 20 matching lines...) Expand all Loading... |
68 if (job_data) { | 66 if (job_data) { |
69 // Create a controller which drives the processing of the job. It will use | 67 // Create a controller which drives the processing of the job. It will use |
70 // the JobData to get information about individual requests for the job. | 68 // the JobData to get information about individual requests for the job. |
71 job_map_[job_info.guid()] = base::MakeUnique<BackgroundFetchJobController>( | 69 job_map_[job_info.guid()] = base::MakeUnique<BackgroundFetchJobController>( |
72 job_info.guid(), browser_context_, storage_partition_, | 70 job_info.guid(), browser_context_, storage_partition_, |
73 std::move(job_data)); | 71 std::move(job_data)); |
74 } | 72 } |
75 } | 73 } |
76 | 74 |
77 } // namespace content | 75 } // namespace content |
OLD | NEW |