OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
14 #include "content/public/browser/worker_service.h" | 14 #include "content/public/browser/worker_service.h" |
15 | 15 |
16 struct ViewHostMsg_CreateWorker_Params; | 16 struct ViewHostMsg_CreateWorker_Params; |
17 | 17 |
18 namespace IPC { | 18 namespace IPC { |
19 class Message; | 19 class Message; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 void OnSharedWorkerMessageFilterClosing( | 85 void OnSharedWorkerMessageFilterClosing( |
86 SharedWorkerMessageFilter* filter); | 86 SharedWorkerMessageFilter* filter); |
87 | 87 |
88 private: | 88 private: |
89 friend struct DefaultSingletonTraits<SharedWorkerServiceImpl>; | 89 friend struct DefaultSingletonTraits<SharedWorkerServiceImpl>; |
90 | 90 |
91 SharedWorkerServiceImpl(); | 91 SharedWorkerServiceImpl(); |
92 virtual ~SharedWorkerServiceImpl(); | 92 virtual ~SharedWorkerServiceImpl(); |
93 | 93 |
| 94 SharedWorkerHost* FindSharedWorkerHost( |
| 95 SharedWorkerMessageFilter* filter, |
| 96 int worker_route_id); |
| 97 |
94 SharedWorkerInstance* FindSharedWorkerInstance( | 98 SharedWorkerInstance* FindSharedWorkerInstance( |
95 const GURL& url, | 99 const GURL& url, |
96 const base::string16& name, | 100 const base::string16& name, |
97 const WorkerStoragePartition& worker_partition, | 101 const WorkerStoragePartition& worker_partition, |
98 ResourceContext* resource_context); | 102 ResourceContext* resource_context); |
99 | 103 |
100 ScopedVector<SharedWorkerHost> worker_hosts_; | 104 // Pair of render_process_id and worker_route_id. |
| 105 typedef std::pair<int, int> ProcessRouteIdPair; |
| 106 typedef base::ScopedPtrHashMap<ProcessRouteIdPair, |
| 107 SharedWorkerHost> WorkerHostMap; |
| 108 WorkerHostMap worker_hosts_; |
| 109 |
101 ObserverList<WorkerServiceObserver> observers_; | 110 ObserverList<WorkerServiceObserver> observers_; |
102 | 111 |
103 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); | 112 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); |
104 }; | 113 }; |
105 | 114 |
106 } // namespace content | 115 } // namespace content |
107 | 116 |
108 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ | 117 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
OLD | NEW |