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

Side by Side Diff: Source/core/workers/WorkerGlobalScope.h

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 12 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) 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 }; 128 };
129 friend class Observer; 129 friend class Observer;
130 void registerObserver(Observer*); 130 void registerObserver(Observer*);
131 void unregisterObserver(Observer*); 131 void unregisterObserver(Observer*);
132 void notifyObserversOfStop(); 132 void notifyObserversOfStop();
133 133
134 bool idleNotification(); 134 bool idleNotification();
135 135
136 double timeOrigin() const { return m_timeOrigin; } 136 double timeOrigin() const { return m_timeOrigin; }
137 137
138 bool memoryInfoEnabled() const { return m_memoryInfoEnabled; };
139
138 WorkerClients* clients() { return m_workerClients.get(); } 140 WorkerClients* clients() { return m_workerClients.get(); }
139 141
140 using SecurityContext::securityOrigin; 142 using SecurityContext::securityOrigin;
141 using SecurityContext::contentSecurityPolicy; 143 using SecurityContext::contentSecurityPolicy;
142 144
143 protected: 145 protected:
144 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, d ouble timeOrigin, PassOwnPtr<WorkerClients>); 146 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, d ouble timeOrigin, bool memoryInfoEnabled, PassOwnPtr<WorkerClients>);
145 void applyContentSecurityPolicyFromString(const String& contentSecurityP olicy, ContentSecurityPolicy::HeaderType); 147 void applyContentSecurityPolicyFromString(const String& contentSecurityP olicy, ContentSecurityPolicy::HeaderType);
146 148
147 virtual void logExceptionToConsole(const String& errorMessage, const Str ing& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) O VERRIDE; 149 virtual void logExceptionToConsole(const String& errorMessage, const Str ing& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) O VERRIDE;
148 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String & message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt ack>, ScriptState*); 150 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String & message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt ack>, ScriptState*);
149 151
150 private: 152 private:
151 virtual void refExecutionContext() OVERRIDE { ref(); } 153 virtual void refExecutionContext() OVERRIDE { ref(); }
152 virtual void derefExecutionContext() OVERRIDE { deref(); } 154 virtual void derefExecutionContext() OVERRIDE { deref(); }
153 155
154 virtual const KURL& virtualURL() const OVERRIDE; 156 virtual const KURL& virtualURL() const OVERRIDE;
(...skipping 19 matching lines...) Expand all
174 OwnPtr<WorkerInspectorController> m_workerInspectorController; 176 OwnPtr<WorkerInspectorController> m_workerInspectorController;
175 bool m_closing; 177 bool m_closing;
176 178
177 HashSet<Observer*> m_workerObservers; 179 HashSet<Observer*> m_workerObservers;
178 180
179 OwnPtr<WorkerEventQueue> m_eventQueue; 181 OwnPtr<WorkerEventQueue> m_eventQueue;
180 182
181 OwnPtr<WorkerClients> m_workerClients; 183 OwnPtr<WorkerClients> m_workerClients;
182 184
183 double m_timeOrigin; 185 double m_timeOrigin;
186 bool m_memoryInfoEnabled;
184 }; 187 };
185 188
186 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope()); 189 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope());
187 190
188 } // namespace WebCore 191 } // namespace WebCore
189 192
190 #endif // WorkerGlobalScope_h 193 #endif // WorkerGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698