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

Side by Side Diff: content/browser/service_worker/embedded_worker_registry.cc

Issue 214383005: Browser side of ServiceWorker requestSyncEvents() function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More nits Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/browser/service_worker/embedded_worker_registry.h" 5 #include "content/browser/service_worker/embedded_worker_registry.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/browser/service_worker/embedded_worker_instance.h" 8 #include "content/browser/service_worker/embedded_worker_instance.h"
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/common/service_worker/embedded_worker_messages.h" 10 #include "content/common/service_worker/embedded_worker_messages.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (found == worker_map_.end()) { 75 if (found == worker_map_.end()) {
76 LOG(ERROR) << "Worker " << embedded_worker_id << " not registered"; 76 LOG(ERROR) << "Worker " << embedded_worker_id << " not registered";
77 return; 77 return;
78 } 78 }
79 // Perform security check to filter out any unexpected (and non-test) 79 // Perform security check to filter out any unexpected (and non-test)
80 // messages. This must list up all message types that can go through here. 80 // messages. This must list up all message types that can go through here.
81 if (message.type() == ServiceWorkerHostMsg_ActivateEventFinished::ID || 81 if (message.type() == ServiceWorkerHostMsg_ActivateEventFinished::ID ||
82 message.type() == ServiceWorkerHostMsg_InstallEventFinished::ID || 82 message.type() == ServiceWorkerHostMsg_InstallEventFinished::ID ||
83 message.type() == ServiceWorkerHostMsg_FetchEventFinished::ID || 83 message.type() == ServiceWorkerHostMsg_FetchEventFinished::ID ||
84 message.type() == ServiceWorkerHostMsg_SyncEventFinished::ID || 84 message.type() == ServiceWorkerHostMsg_SyncEventFinished::ID ||
85 message.type() == ServiceWorkerHostMsg_RequestSyncEvents::ID ||
85 IPC_MESSAGE_CLASS(message) == TestMsgStart) { 86 IPC_MESSAGE_CLASS(message) == TestMsgStart) {
86 found->second->OnMessageReceived(request_id, message); 87 found->second->OnMessageReceived(request_id, message);
87 return; 88 return;
88 } 89 }
89 NOTREACHED() << "Got unexpected message: " << message.type(); 90 NOTREACHED() << "Got unexpected message: " << message.type();
90 } 91 }
91 92
92 void EmbeddedWorkerRegistry::AddChildProcessSender( 93 void EmbeddedWorkerRegistry::AddChildProcessSender(
93 int process_id, IPC::Sender* sender) { 94 int process_id, IPC::Sender* sender) {
94 process_sender_map_[process_id] = sender; 95 process_sender_map_[process_id] = sender;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 136 }
136 137
137 void EmbeddedWorkerRegistry::RemoveWorker(int process_id, 138 void EmbeddedWorkerRegistry::RemoveWorker(int process_id,
138 int embedded_worker_id) { 139 int embedded_worker_id) {
139 DCHECK(ContainsKey(worker_map_, embedded_worker_id)); 140 DCHECK(ContainsKey(worker_map_, embedded_worker_id));
140 worker_map_.erase(embedded_worker_id); 141 worker_map_.erase(embedded_worker_id);
141 worker_process_map_.erase(process_id); 142 worker_process_map_.erase(process_id);
142 } 143 }
143 144
144 } // namespace content 145 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698