| 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 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 friend class base::DeleteHelper<BackgroundFetchContext>; | 51 friend class base::DeleteHelper<BackgroundFetchContext>; |
| 52 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 52 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; |
| 53 friend class base::RefCountedThreadSafe<BackgroundFetchContext, | 53 friend class base::RefCountedThreadSafe<BackgroundFetchContext, |
| 54 BrowserThread::DeleteOnUIThread>; | 54 BrowserThread::DeleteOnUIThread>; |
| 55 | 55 |
| 56 ~BackgroundFetchContext(); | 56 ~BackgroundFetchContext(); |
| 57 | 57 |
| 58 void CreateRequest(const BackgroundFetchJobInfo& job_info, | 58 void CreateRequest(const BackgroundFetchJobInfo& job_info, |
| 59 std::vector<BackgroundFetchRequestInfo>& request_infos); | 59 std::vector<BackgroundFetchRequestInfo>& request_infos); |
| 60 | 60 |
| 61 // Callback for the JobController when the job is complete. |
| 62 void DidCompleteJob(const std::string& job_guid); |
| 63 |
| 61 void ShutdownOnIO(); | 64 void ShutdownOnIO(); |
| 62 | 65 |
| 63 // |this| is owned by the BrowserContext via the StoragePartition. | 66 // |this| is owned by the BrowserContext via the StoragePartition. |
| 64 BrowserContext* browser_context_; | 67 BrowserContext* browser_context_; |
| 65 StoragePartition* storage_partition_; | 68 StoragePartition* storage_partition_; |
| 66 | 69 |
| 67 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 70 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 68 BackgroundFetchDataManager background_fetch_data_manager_; | 71 BackgroundFetchDataManager background_fetch_data_manager_; |
| 69 | 72 |
| 70 std::unordered_map<std::string, std::unique_ptr<BackgroundFetchJobController>> | 73 std::unordered_map<std::string, std::unique_ptr<BackgroundFetchJobController>> |
| 71 job_map_; | 74 job_map_; |
| 72 | 75 |
| 73 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 76 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 } // namespace content | 79 } // namespace content |
| 77 | 80 |
| 78 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 81 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| OLD | NEW |