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

Unified Diff: content/browser/devtools/embedded_worker_devtools_manager.cc

Issue 261753008: Call EmbeddedWorkerDevToolsManager::ServiceWorkerCreated, WorkerContextStarted and WorkerDestroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated kinuko's comment Created 6 years, 7 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/devtools/embedded_worker_devtools_manager.cc
diff --git a/content/browser/devtools/embedded_worker_devtools_manager.cc b/content/browser/devtools/embedded_worker_devtools_manager.cc
index 64f76249ee3d6ae4943bbe1ec2389d14b398ad07..386b1c4c8c8a0039ada6eacc154d534dab740f1d 100644
--- a/content/browser/devtools/embedded_worker_devtools_manager.cc
+++ b/content/browser/devtools/embedded_worker_devtools_manager.cc
@@ -10,6 +10,7 @@
#include "content/browser/devtools/ipc_devtools_agent_host.h"
#include "content/browser/shared_worker/shared_worker_instance.h"
#include "content/common/devtools_messages.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/worker_service.h"
@@ -37,15 +38,16 @@ bool SendMessageToWorker(
EmbeddedWorkerDevToolsManager::WorkerInfo::WorkerInfo(
const SharedWorkerInstance& instance)
: shared_worker_instance_(new SharedWorkerInstance(instance)),
+ service_worker_version_id_(kInvalidServiceWorkerVersionId),
state_(WORKER_UNINSPECTED),
agent_host_(NULL) {
}
EmbeddedWorkerDevToolsManager::WorkerInfo::WorkerInfo(
const base::FilePath& storage_partition_path,
- const GURL& service_worker_scope)
+ int64 service_worker_version_id)
: storage_partition_path_(new base::FilePath(storage_partition_path)),
- service_worker_scope_(new GURL(service_worker_scope)),
+ service_worker_version_id_(service_worker_version_id),
state_(WORKER_UNINSPECTED),
agent_host_(NULL) {
}
@@ -59,11 +61,11 @@ bool EmbeddedWorkerDevToolsManager::WorkerInfo::Matches(
bool EmbeddedWorkerDevToolsManager::WorkerInfo::Matches(
const base::FilePath& other_storage_partition_path,
- const GURL& other_service_worker_scope) {
- if (!storage_partition_path_ || !service_worker_scope_)
+ int64 other_service_worker_version_id) {
+ if (!storage_partition_path_)
return false;
return *storage_partition_path_ == other_storage_partition_path &&
- *service_worker_scope_ == other_service_worker_scope;
+ service_worker_version_id_ == other_service_worker_version_id;
}
EmbeddedWorkerDevToolsManager::WorkerInfo::~WorkerInfo() {
@@ -176,9 +178,9 @@ DevToolsAgentHost* EmbeddedWorkerDevToolsManager::GetDevToolsAgentHostForWorker(
DevToolsAgentHost*
EmbeddedWorkerDevToolsManager::GetDevToolsAgentHostForServiceWorker(
const base::FilePath& storage_partition_path,
- const GURL& service_worker_scope) {
+ int64 service_worker_version_id) {
WorkerInfoMap::iterator it = FindExistingServiceWorkerInfo(
- storage_partition_path, service_worker_scope);
+ storage_partition_path, service_worker_version_id);
if (it == workers_.end())
return NULL;
return GetDevToolsAgentHostForWorker(it->first.first, it->first.second);
@@ -210,14 +212,14 @@ bool EmbeddedWorkerDevToolsManager::ServiceWorkerCreated(
int worker_process_id,
int worker_route_id,
const base::FilePath& storage_partition_path,
- const GURL& service_worker_scope) {
+ int64 service_worker_version_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const WorkerId id(worker_process_id, worker_route_id);
WorkerInfoMap::iterator it = FindExistingServiceWorkerInfo(
- storage_partition_path, service_worker_scope);
+ storage_partition_path, service_worker_version_id);
if (it == workers_.end()) {
scoped_ptr<WorkerInfo> info(
- new WorkerInfo(storage_partition_path, service_worker_scope));
+ new WorkerInfo(storage_partition_path, service_worker_version_id));
workers_.set(id, info.Pass());
return false;
}
@@ -317,10 +319,10 @@ EmbeddedWorkerDevToolsManager::FindExistingSharedWorkerInfo(
EmbeddedWorkerDevToolsManager::WorkerInfoMap::iterator
EmbeddedWorkerDevToolsManager::FindExistingServiceWorkerInfo(
const base::FilePath& storage_partition_path,
- const GURL& service_worker_scope) {
+ int64 service_worker_version_id) {
WorkerInfoMap::iterator it = workers_.begin();
for (; it != workers_.end(); ++it) {
- if (it->second->Matches(storage_partition_path, service_worker_scope))
+ if (it->second->Matches(storage_partition_path, service_worker_version_id))
break;
}
return it;

Powered by Google App Engine
This is Rietveld 408576698