OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SYNC_BACKGROUND_SYNC_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTEXT_H_ |
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTEXT_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTEXT_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <memory> | 9 #include <memory> |
9 #include <set> | |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "third_party/WebKit/public/platform/modules/background_sync/background_
sync.mojom.h" | 14 #include "third_party/WebKit/public/platform/modules/background_sync/background_
sync.mojom.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class BackgroundSyncManager; | 18 class BackgroundSyncManager; |
19 class BackgroundSyncServiceImpl; | 19 class BackgroundSyncServiceImpl; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> request); | 63 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> request); |
64 | 64 |
65 void ShutdownOnIO(); | 65 void ShutdownOnIO(); |
66 | 66 |
67 // Only accessed on the IO thread. | 67 // Only accessed on the IO thread. |
68 std::unique_ptr<BackgroundSyncManager> background_sync_manager_; | 68 std::unique_ptr<BackgroundSyncManager> background_sync_manager_; |
69 | 69 |
70 // The services are owned by this. They're either deleted | 70 // The services are owned by this. They're either deleted |
71 // during ShutdownOnIO or when the channel is closed via | 71 // during ShutdownOnIO or when the channel is closed via |
72 // ServiceHadConnectionError. Only accessed on the IO thread. | 72 // ServiceHadConnectionError. Only accessed on the IO thread. |
73 std::set<BackgroundSyncServiceImpl*> services_; | 73 std::map<BackgroundSyncServiceImpl*, |
| 74 std::unique_ptr<BackgroundSyncServiceImpl>> |
| 75 services_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncContext); | 77 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncContext); |
76 }; | 78 }; |
77 | 79 |
78 } // namespace content | 80 } // namespace content |
79 | 81 |
80 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTEXT_H_ | 82 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTEXT_H_ |
OLD | NEW |