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

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

Issue 187533002: Add SharedWorkerServiceImpl::CheckWorkerDependency(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ExternalClient
Patch Set: 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
« no previous file with comments | « no previous file | content/browser/shared_worker/shared_worker_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fd199894dedda196572c545976c37a06cc68eb1e..e79703e3c98cffa1800fe840e71dc3ce5764707f 100644
--- a/content/browser/shared_worker/shared_worker_service_impl.h
+++ b/content/browser/shared_worker/shared_worker_service_impl.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_
#define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_
+#include <set>
+
#include "base/compiler_specific.h"
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/singleton.h"
@@ -88,6 +90,17 @@ class CONTENT_EXPORT SharedWorkerServiceImpl
private:
friend struct DefaultSingletonTraits<SharedWorkerServiceImpl>;
+ class CONTENT_EXPORT ScopedWorkerDependencyChecker {
+ public:
+ ScopedWorkerDependencyChecker(SharedWorkerServiceImpl* service_impl)
kinuko 2014/03/05 08:03:47 nit: explicit
horo 2014/03/05 08:16:58 Done.
+ : service_impl_(service_impl) {}
+ ~ScopedWorkerDependencyChecker() { service_impl_->CheckWorkerDependency(); }
+
+ private:
+ SharedWorkerServiceImpl* service_impl_;
+ DISALLOW_COPY_AND_ASSIGN(ScopedWorkerDependencyChecker);
+ };
+
SharedWorkerServiceImpl();
virtual ~SharedWorkerServiceImpl();
@@ -101,6 +114,17 @@ class CONTENT_EXPORT SharedWorkerServiceImpl
const WorkerStoragePartition& worker_partition,
ResourceContext* resource_context);
+ // Returns the IDs of the renderer processes which are executing
+ // SharedWorkers connected to other renderer processes.
+ const std::set<int> GetWorkerDependedRenderers();
kinuko 2014/03/05 08:03:47 GetRenderersWithWorkerDependency? 'worker-depende
horo 2014/03/05 08:16:58 Done.
+
+ // Checks the worker dependency of renderer processes and calls
+ // IncrementWorkerRefCount and DecrementWorkerRefCount of
+ // RenderProcessHostImpl on UI thread if necessary.
+ void CheckWorkerDependency();
+
+ std::set<int> last_worker_depended_renderers_;
+
// Pair of render_process_id and worker_route_id.
typedef std::pair<int, int> ProcessRouteIdPair;
typedef base::ScopedPtrHashMap<ProcessRouteIdPair,
« no previous file with comments | « no previous file | content/browser/shared_worker/shared_worker_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698