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

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

Issue 2010603002: Use SourceLocation when reporting runtime exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2004243002
Patch Set: test fixes Created 4 years, 6 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 double timeOrigin() const { return m_timeOrigin; } 134 double timeOrigin() const { return m_timeOrigin; }
135 135
136 WorkerClients* clients() { return m_workerClients.get(); } 136 WorkerClients* clients() { return m_workerClients.get(); }
137 137
138 using SecurityContext::getSecurityOrigin; 138 using SecurityContext::getSecurityOrigin;
139 using SecurityContext::contentSecurityPolicy; 139 using SecurityContext::contentSecurityPolicy;
140 140
141 void addConsoleMessage(ConsoleMessage*) final; 141 void addConsoleMessage(ConsoleMessage*) final;
142 ConsoleMessageStorage* messageStorage(); 142 ConsoleMessageStorage* messageStorage();
143 143
144 void exceptionHandled(int exceptionId, bool isHandled); 144 void exceptionUnhandled(const String& errorMessage, PassOwnPtr<SourceLocatio n>);
145 145
146 virtual void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) { } 146 virtual void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) { }
147 147
148 bool isSecureContext(String& errorMessage, const SecureContextCheck = Standa rdSecureContextCheck) const override; 148 bool isSecureContext(String& errorMessage, const SecureContextCheck = Standa rdSecureContextCheck) const override;
149 149
150 void registerEventListener(V8AbstractEventListener*); 150 void registerEventListener(V8AbstractEventListener*);
151 void deregisterEventListener(V8AbstractEventListener*); 151 void deregisterEventListener(V8AbstractEventListener*);
152 152
153 DECLARE_VIRTUAL_TRACE(); 153 DECLARE_VIRTUAL_TRACE();
154 154
155 protected: 155 protected:
156 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, doubl e timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, WorkerClients*); 156 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, doubl e timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, WorkerClients*);
157 void applyContentSecurityPolicyFromVector(const Vector<CSPHeaderAndType>& he aders); 157 void applyContentSecurityPolicyFromVector(const Vector<CSPHeaderAndType>& he aders);
158 158
159 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) override; 159 void logExceptionToConsole(const String& errorMessage, PassOwnPtr<SourceLoca tion>) override;
160 void addMessageToWorkerConsole(ConsoleMessage*); 160 void addMessageToWorkerConsole(ConsoleMessage*);
161 void setV8CacheOptions(V8CacheOptions v8CacheOptions) { m_v8CacheOptions = v 8CacheOptions; } 161 void setV8CacheOptions(V8CacheOptions v8CacheOptions) { m_v8CacheOptions = v 8CacheOptions; }
162 162
163 void removeURLFromMemoryCache(const KURL&) override; 163 void removeURLFromMemoryCache(const KURL&) override;
164 164
165 private: 165 private:
166 const KURL& virtualURL() const final; 166 const KURL& virtualURL() const final;
167 KURL virtualCompleteURL(const String&) const final; 167 KURL virtualCompleteURL(const String&) const final;
168 168
169 void reportBlockedScriptExecutionToInspector(const String& directiveText) fi nal; 169 void reportBlockedScriptExecutionToInspector(const String& directiveText) fi nal;
(...skipping 24 matching lines...) Expand all
194 Member<WorkerEventQueue> m_eventQueue; 194 Member<WorkerEventQueue> m_eventQueue;
195 195
196 Member<WorkerClients> m_workerClients; 196 Member<WorkerClients> m_workerClients;
197 197
198 DOMTimerCoordinator m_timers; 198 DOMTimerCoordinator m_timers;
199 199
200 double m_timeOrigin; 200 double m_timeOrigin;
201 201
202 Member<ConsoleMessageStorage> m_messageStorage; 202 Member<ConsoleMessageStorage> m_messageStorage;
203 203
204 unsigned long m_workerExceptionUniqueIdentifier;
205 HeapHashMap<unsigned long, Member<ConsoleMessage>> m_pendingMessages;
206 HeapListHashSet<Member<V8AbstractEventListener>> m_eventListeners; 204 HeapListHashSet<Member<V8AbstractEventListener>> m_eventListeners;
207 }; 205 };
208 206
209 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope()); 207 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope());
210 208
211 } // namespace blink 209 } // namespace blink
212 210
213 #endif // WorkerGlobalScope_h 211 #endif // WorkerGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698