Chromium Code Reviews| 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 // TODO(harkness): Pass back enough information that the context can construct | |
| 63 // the Mojo response. | |
|
Peter Beverloo
2017/03/15 16:53:38
micro nit: I'd drop this TODO, it's not really set
harkness
2017/03/16 11:41:09
Done.
| |
| 64 void JobComplete(const std::string& job_guid); | |
|
Peter Beverloo
2017/03/15 16:53:38
nit: We tend to name callbacks as DidCompleteJob o
harkness
2017/03/16 11:41:09
Done.
| |
| 65 | |
| 61 void ShutdownOnIO(); | 66 void ShutdownOnIO(); |
| 62 | 67 |
| 63 // |this| is owned by the BrowserContext via the StoragePartition. | 68 // |this| is owned by the BrowserContext via the StoragePartition. |
| 64 BrowserContext* browser_context_; | 69 BrowserContext* browser_context_; |
| 65 StoragePartition* storage_partition_; | 70 StoragePartition* storage_partition_; |
| 66 | 71 |
| 67 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 72 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 68 BackgroundFetchDataManager background_fetch_data_manager_; | 73 BackgroundFetchDataManager background_fetch_data_manager_; |
| 69 | 74 |
| 70 std::unordered_map<std::string, std::unique_ptr<BackgroundFetchJobController>> | 75 std::unordered_map<std::string, std::unique_ptr<BackgroundFetchJobController>> |
| 71 job_map_; | 76 job_map_; |
| 72 | 77 |
| 73 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 78 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
| 74 }; | 79 }; |
| 75 | 80 |
| 76 } // namespace content | 81 } // namespace content |
| 77 | 82 |
| 78 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 83 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
| OLD | NEW |