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

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

Issue 2428753003: Revert of ServiceWorker: Add CHECK to EmbeddedWorkerRegistry for debug (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/browser/renderer_host/render_widget_helper.h" 10 #include "content/browser/renderer_host/render_widget_helper.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 bool EmbeddedWorkerRegistry::CanHandle(int embedded_worker_id) const { 222 bool EmbeddedWorkerRegistry::CanHandle(int embedded_worker_id) const {
223 if (embedded_worker_id < initial_embedded_worker_id_ || 223 if (embedded_worker_id < initial_embedded_worker_id_ ||
224 next_embedded_worker_id_ <= embedded_worker_id) { 224 next_embedded_worker_id_ <= embedded_worker_id) {
225 return false; 225 return false;
226 } 226 }
227 return true; 227 return true;
228 } 228 }
229 229
230 MessagePortMessageFilter* 230 MessagePortMessageFilter*
231 EmbeddedWorkerRegistry::MessagePortMessageFilterForProcess(int process_id) { 231 EmbeddedWorkerRegistry::MessagePortMessageFilterForProcess(int process_id) {
232 // TODO(nhiroki): Change this to DCHECK after https://crbug.com/648477 is
233 // fixed.
234 CHECK(
235 base::ContainsKey(process_message_port_message_filter_map_, process_id));
236 return process_message_port_message_filter_map_[process_id]; 232 return process_message_port_message_filter_map_[process_id];
237 } 233 }
238 234
239 EmbeddedWorkerRegistry::EmbeddedWorkerRegistry( 235 EmbeddedWorkerRegistry::EmbeddedWorkerRegistry(
240 const base::WeakPtr<ServiceWorkerContextCore>& context, 236 const base::WeakPtr<ServiceWorkerContextCore>& context,
241 int initial_embedded_worker_id) 237 int initial_embedded_worker_id)
242 : context_(context), 238 : context_(context),
243 next_embedded_worker_id_(initial_embedded_worker_id), 239 next_embedded_worker_id_(initial_embedded_worker_id),
244 initial_embedded_worker_id_(initial_embedded_worker_id) { 240 initial_embedded_worker_id_(initial_embedded_worker_id) {
245 } 241 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 EmbeddedWorkerInstance* worker = GetWorker(embedded_worker_id); 299 EmbeddedWorkerInstance* worker = GetWorker(embedded_worker_id);
304 if (!worker || worker->process_id() != process_id) { 300 if (!worker || worker->process_id() != process_id) {
305 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.WorkerForMessageFound", false); 301 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.WorkerForMessageFound", false);
306 return nullptr; 302 return nullptr;
307 } 303 }
308 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.WorkerForMessageFound", true); 304 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.WorkerForMessageFound", true);
309 return worker; 305 return worker;
310 } 306 }
311 307
312 } // namespace content 308 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698