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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 BackgroundFetchDataManager* GetDataManagerForTesting() { | 46 BackgroundFetchDataManager* GetDataManagerForTesting() { |
47 return &background_fetch_data_manager_; | 47 return &background_fetch_data_manager_; |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
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 virtual ~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 void ShutdownOnIO(); | 61 void ShutdownOnIO(); |
62 | 62 |
63 // |this| is owned by the BrowserContext via the StoragePartition. | 63 // |this| is owned by the BrowserContext via the StoragePartition. |
64 BrowserContext* browser_context_; | 64 BrowserContext* browser_context_; |
65 StoragePartition* storage_partition_; | 65 StoragePartition* storage_partition_; |
66 | 66 |
67 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 67 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
68 BackgroundFetchDataManager background_fetch_data_manager_; | 68 BackgroundFetchDataManager background_fetch_data_manager_; |
69 | 69 |
70 std::unordered_map<std::string, std::unique_ptr<BackgroundFetchJobController>> | 70 std::unordered_map<std::string, std::unique_ptr<BackgroundFetchJobController>> |
71 job_map_; | 71 job_map_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); | 73 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchContext); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace content | 76 } // namespace content |
77 | 77 |
78 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ | 78 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_ |
OLD | NEW |