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

Unified Diff: content/browser/service_worker/embedded_worker_registry.cc

Issue 140743012: Start EmbeddedWorker during registration - take 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up existing registration case Created 6 years, 11 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/service_worker/embedded_worker_registry.cc
diff --git a/content/browser/service_worker/embedded_worker_registry.cc b/content/browser/service_worker/embedded_worker_registry.cc
index d939cfb126e586fa7009c6e0e2c3a4d70132a476..3152d03c88216e9601275ce39d5d07bd258fd2b1 100644
--- a/content/browser/service_worker/embedded_worker_registry.cc
+++ b/content/browser/service_worker/embedded_worker_registry.cc
@@ -21,6 +21,8 @@ EmbeddedWorkerRegistry::EmbeddedWorkerRegistry(
scoped_ptr<EmbeddedWorkerInstance> EmbeddedWorkerRegistry::CreateWorker() {
scoped_ptr<EmbeddedWorkerInstance> worker(
new EmbeddedWorkerInstance(this, next_embedded_worker_id_));
+ LOG(ERROR) << "Adding EmbeddedWorkerInstance with id "
+ << next_embedded_worker_id_;
worker_map_[next_embedded_worker_id_++] = worker.get();
return worker.Pass();
}
@@ -44,6 +46,8 @@ bool EmbeddedWorkerRegistry::StopWorker(int process_id,
void EmbeddedWorkerRegistry::OnWorkerStarted(
int process_id, int thread_id, int embedded_worker_id) {
+ LOG(ERROR) << "OnWorkerStarted(" << process_id << ", " << thread_id << ", "
+ << embedded_worker_id << ")";
DCHECK(!ContainsKey(worker_process_map_, process_id));
WorkerInstanceMap::iterator found = worker_map_.find(embedded_worker_id);
if (found == worker_map_.end()) {
@@ -108,11 +112,16 @@ EmbeddedWorkerInstance* EmbeddedWorkerRegistry::GetWorker(
EmbeddedWorkerRegistry::~EmbeddedWorkerRegistry() {}
bool EmbeddedWorkerRegistry::Send(int process_id, IPC::Message* message) {
- if (!context_)
+ if (!context_) {
+ LOG(ERROR) << "No context, bailing on the send";
return false;
+ }
ProcessToSenderMap::iterator found = process_sender_map_.find(process_id);
- if (found == process_sender_map_.end())
+ if (found == process_sender_map_.end()) {
+ LOG(ERROR) << "sender not found for pid " << process_id;
return false;
+ }
+ LOG(ERROR) << "Sending message to " << process_id;
return found->second->Send(message);
}

Powered by Google App Engine
This is Rietveld 408576698