OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <set> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
15 #include "content/common/service_worker/service_worker_status_code.h" | 16 #include "content/common/service_worker/service_worker_status_code.h" |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 | 19 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // |process_id| could be invalid (i.e. -1) if it's not running. | 79 // |process_id| could be invalid (i.e. -1) if it's not running. |
79 void RemoveWorker(int process_id, int embedded_worker_id); | 80 void RemoveWorker(int process_id, int embedded_worker_id); |
80 | 81 |
81 base::WeakPtr<ServiceWorkerContextCore> context_; | 82 base::WeakPtr<ServiceWorkerContextCore> context_; |
82 | 83 |
83 WorkerInstanceMap worker_map_; | 84 WorkerInstanceMap worker_map_; |
84 ProcessToSenderMap process_sender_map_; | 85 ProcessToSenderMap process_sender_map_; |
85 | 86 |
86 // Map from process_id to embedded_worker_id. | 87 // Map from process_id to embedded_worker_id. |
87 // This map only contains running workers. | 88 // This map only contains running workers. |
88 std::map<int, int> worker_process_map_; | 89 std::map<int, std::set<int> > worker_process_map_; |
89 | 90 |
90 int next_embedded_worker_id_; | 91 int next_embedded_worker_id_; |
91 | 92 |
92 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); | 93 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); |
93 }; | 94 }; |
94 | 95 |
95 } // namespace content | 96 } // namespace content |
96 | 97 |
97 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 98 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
OLD | NEW |