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

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: Introduce WorkerSettings Created 6 years, 9 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 18 matching lines...) Expand all
29 29
30 #include "bindings/v8/ScriptWrappable.h" 30 #include "bindings/v8/ScriptWrappable.h"
31 #include "bindings/v8/WorkerScriptController.h" 31 #include "bindings/v8/WorkerScriptController.h"
32 #include "core/dom/ExecutionContext.h" 32 #include "core/dom/ExecutionContext.h"
33 #include "core/events/EventListener.h" 33 #include "core/events/EventListener.h"
34 #include "core/events/EventTarget.h" 34 #include "core/events/EventTarget.h"
35 #include "core/events/ThreadLocalEventNames.h" 35 #include "core/events/ThreadLocalEventNames.h"
36 #include "core/frame/ContentSecurityPolicy.h" 36 #include "core/frame/ContentSecurityPolicy.h"
37 #include "core/workers/WorkerConsole.h" 37 #include "core/workers/WorkerConsole.h"
38 #include "core/workers/WorkerEventQueue.h" 38 #include "core/workers/WorkerEventQueue.h"
39 #include "core/workers/WorkerSettings.h"
39 #include "core/workers/WorkerSupplementable.h" 40 #include "core/workers/WorkerSupplementable.h"
40 #include "wtf/Assertions.h" 41 #include "wtf/Assertions.h"
41 #include "wtf/HashMap.h" 42 #include "wtf/HashMap.h"
42 #include "wtf/OwnPtr.h" 43 #include "wtf/OwnPtr.h"
43 #include "wtf/PassRefPtr.h" 44 #include "wtf/PassRefPtr.h"
44 #include "wtf/RefCounted.h" 45 #include "wtf/RefCounted.h"
45 #include "wtf/RefPtr.h" 46 #include "wtf/RefPtr.h"
46 #include "wtf/text/AtomicStringHash.h" 47 #include "wtf/text/AtomicStringHash.h"
47 48
48 namespace WebCore { 49 namespace WebCore {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 }; 129 };
129 friend class Observer; 130 friend class Observer;
130 void registerObserver(Observer*); 131 void registerObserver(Observer*);
131 void unregisterObserver(Observer*); 132 void unregisterObserver(Observer*);
132 void notifyObserversOfStop(); 133 void notifyObserversOfStop();
133 134
134 bool idleNotification(); 135 bool idleNotification();
135 136
136 double timeOrigin() const { return m_timeOrigin; } 137 double timeOrigin() const { return m_timeOrigin; }
137 138
139 WorkerSettings* settings() const { return m_workerSettings.get(); }
140
138 WorkerClients* clients() { return m_workerClients.get(); } 141 WorkerClients* clients() { return m_workerClients.get(); }
139 142
140 using SecurityContext::securityOrigin; 143 using SecurityContext::securityOrigin;
141 using SecurityContext::contentSecurityPolicy; 144 using SecurityContext::contentSecurityPolicy;
142 145
143 protected: 146 protected:
144 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, d ouble timeOrigin, PassOwnPtr<WorkerClients>); 147 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, d ouble timeOrigin, PassOwnPtr<WorkerClients>, PassOwnPtr<WorkerSettings>);
kinuko 2014/03/04 04:34:35 nit: extra space after timeOrigin,
Pan 2014/03/06 08:50:56 Done.
145 void applyContentSecurityPolicyFromString(const String& contentSecurityP olicy, ContentSecurityPolicy::HeaderType); 148 void applyContentSecurityPolicyFromString(const String& contentSecurityP olicy, ContentSecurityPolicy::HeaderType);
146 149
147 virtual void logExceptionToConsole(const String& errorMessage, const Str ing& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) O VERRIDE; 150 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*); 151 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String & message, const String& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallSt ack>, ScriptState*);
149 152
150 private: 153 private:
151 virtual void refExecutionContext() OVERRIDE FINAL { ref(); } 154 virtual void refExecutionContext() OVERRIDE FINAL { ref(); }
152 virtual void derefExecutionContext() OVERRIDE FINAL { deref(); } 155 virtual void derefExecutionContext() OVERRIDE FINAL { deref(); }
153 156
154 virtual const KURL& virtualURL() const OVERRIDE FINAL; 157 virtual const KURL& virtualURL() const OVERRIDE FINAL;
(...skipping 19 matching lines...) Expand all
174 OwnPtr<WorkerInspectorController> m_workerInspectorController; 177 OwnPtr<WorkerInspectorController> m_workerInspectorController;
175 bool m_closing; 178 bool m_closing;
176 179
177 HashSet<Observer*> m_workerObservers; 180 HashSet<Observer*> m_workerObservers;
178 181
179 OwnPtr<WorkerEventQueue> m_eventQueue; 182 OwnPtr<WorkerEventQueue> m_eventQueue;
180 183
181 OwnPtr<WorkerClients> m_workerClients; 184 OwnPtr<WorkerClients> m_workerClients;
182 185
183 double m_timeOrigin; 186 double m_timeOrigin;
187 OwnPtr<WorkerSettings> m_workerSettings;
184 }; 188 };
185 189
186 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope()); 190 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope());
187 191
188 } // namespace WebCore 192 } // namespace WebCore
189 193
190 #endif // WorkerGlobalScope_h 194 #endif // WorkerGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698