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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 2137483003: Add UMA metrics for root scroller intervention to track forcing passive breakage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment to clarify implementation point Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return promise; 142 return promise;
143 } 143 }
144 144
145 void ServiceWorkerGlobalScope::setRegistration(std::unique_ptr<WebServiceWorkerR egistration::Handle> handle) 145 void ServiceWorkerGlobalScope::setRegistration(std::unique_ptr<WebServiceWorkerR egistration::Handle> handle)
146 { 146 {
147 if (!getExecutionContext()) 147 if (!getExecutionContext())
148 return; 148 return;
149 m_registration = ServiceWorkerRegistration::getOrCreate(getExecutionContext( ), wrapUnique(handle.release())); 149 m_registration = ServiceWorkerRegistration::getOrCreate(getExecutionContext( ), wrapUnique(handle.release()));
150 } 150 }
151 151
152 bool ServiceWorkerGlobalScope::addEventListenerInternal(const AtomicString& even tType, EventListener* listener, const AddEventListenerOptions& options) 152 bool ServiceWorkerGlobalScope::addEventListenerInternal(const AtomicString& even tType, EventListener* listener, const AddEventListenerOptionsResolved& options)
153 { 153 {
154 if (m_didEvaluateScript) { 154 if (m_didEvaluateScript) {
155 if (eventType == EventTypeNames::install) { 155 if (eventType == EventTypeNames::install) {
156 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou rce, WarningMessageLevel, "Event handler of 'install' event must be added on the initial evaluation of worker script."); 156 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou rce, WarningMessageLevel, "Event handler of 'install' event must be added on the initial evaluation of worker script.");
157 addMessageToWorkerConsole(consoleMessage); 157 addMessageToWorkerConsole(consoleMessage);
158 } else if (eventType == EventTypeNames::activate) { 158 } else if (eventType == EventTypeNames::activate) {
159 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou rce, WarningMessageLevel, "Event handler of 'activate' event must be added on th e initial evaluation of worker script."); 159 ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSou rce, WarningMessageLevel, "Event handler of 'activate' event must be added on th e initial evaluation of worker script.");
160 addMessageToWorkerConsole(consoleMessage); 160 addMessageToWorkerConsole(consoleMessage);
161 } 161 }
162 } 162 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize) 222 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize)
223 { 223 {
224 ++m_scriptCount; 224 ++m_scriptCount;
225 m_scriptTotalSize += scriptSize; 225 m_scriptTotalSize += scriptSize;
226 m_scriptCachedMetadataTotalSize += cachedMetadataSize; 226 m_scriptCachedMetadataTotalSize += cachedMetadataSize;
227 } 227 }
228 228
229 } // namespace blink 229 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698