Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: content/browser/shared_worker/shared_worker_service_impl.h

Issue 182693002: Implement some mothods in SharedWorkerHost and SharedWorkerServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added null check of instance in SharedWorkerHost Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/shared_worker/shared_worker_service_impl.h
diff --git a/content/browser/shared_worker/shared_worker_service_impl.h b/content/browser/shared_worker/shared_worker_service_impl.h
index 9b4350e472588fbeb85e17bbe63c1717a576bb88..fd199894dedda196572c545976c37a06cc68eb1e 100644
--- a/content/browser/shared_worker/shared_worker_service_impl.h
+++ b/content/browser/shared_worker/shared_worker_service_impl.h
@@ -6,7 +6,7 @@
#define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_
#include "base/compiler_specific.h"
-#include "base/memory/scoped_vector.h"
+#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#include "content/public/browser/notification_observer.h"
@@ -91,13 +91,22 @@ class CONTENT_EXPORT SharedWorkerServiceImpl
SharedWorkerServiceImpl();
virtual ~SharedWorkerServiceImpl();
+ SharedWorkerHost* FindSharedWorkerHost(
+ SharedWorkerMessageFilter* filter,
+ int worker_route_id);
+
SharedWorkerInstance* FindSharedWorkerInstance(
const GURL& url,
const base::string16& name,
const WorkerStoragePartition& worker_partition,
ResourceContext* resource_context);
- ScopedVector<SharedWorkerHost> worker_hosts_;
+ // Pair of render_process_id and worker_route_id.
+ typedef std::pair<int, int> ProcessRouteIdPair;
+ typedef base::ScopedPtrHashMap<ProcessRouteIdPair,
+ SharedWorkerHost> WorkerHostMap;
+ WorkerHostMap worker_hosts_;
+
ObserverList<WorkerServiceObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl);

Powered by Google App Engine
This is Rietveld 408576698