OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 v8Inspector()->contextCreated(V8ContextInfo(context, workerContextGroupId, t
rue, m_workerThread->globalScope()->url().getString(), "", "", false)); | 89 v8Inspector()->contextCreated(V8ContextInfo(context, workerContextGroupId, t
rue, m_workerThread->globalScope()->url().getString(), "", "", false)); |
90 } | 90 } |
91 | 91 |
92 void WorkerThreadDebugger::contextWillBeDestroyed(v8::Local<v8::Context> context
) | 92 void WorkerThreadDebugger::contextWillBeDestroyed(v8::Local<v8::Context> context
) |
93 { | 93 { |
94 v8Inspector()->contextDestroyed(context); | 94 v8Inspector()->contextDestroyed(context); |
95 } | 95 } |
96 | 96 |
97 void WorkerThreadDebugger::exceptionThrown(ErrorEvent* event) | 97 void WorkerThreadDebugger::exceptionThrown(ErrorEvent* event) |
98 { | 98 { |
99 if (m_workerThread->consoleMessageStorage()->isMuted()) | |
100 return; | |
101 | |
102 const String16 defaultMessage = "Uncaught"; | 99 const String16 defaultMessage = "Uncaught"; |
103 ScriptState* scriptState = m_workerThread->globalScope()->scriptController()
->getScriptState(); | 100 ScriptState* scriptState = m_workerThread->globalScope()->scriptController()
->getScriptState(); |
104 if (scriptState && scriptState->contextIsValid()) { | 101 if (scriptState && scriptState->contextIsValid()) { |
105 ScriptState::Scope scope(scriptState); | 102 ScriptState::Scope scope(scriptState); |
106 v8::Local<v8::Value> exception = V8ErrorHandler::loadExceptionFromErrorE
ventWrapper(scriptState, event, scriptState->context()->Global()); | 103 v8::Local<v8::Value> exception = V8ErrorHandler::loadExceptionFromErrorE
ventWrapper(scriptState, event, scriptState->context()->Global()); |
107 SourceLocation* location = event->location(); | 104 SourceLocation* location = event->location(); |
108 v8Inspector()->exceptionThrown(scriptState->context(), defaultMessage, e
xception, event->messageForConsole(), location->url(), location->lineNumber(), l
ocation->columnNumber(), location->cloneStackTrace(), location->scriptId()); | 105 v8Inspector()->exceptionThrown(scriptState->context(), defaultMessage, e
xception, event->messageForConsole(), location->url(), location->lineNumber(), l
ocation->columnNumber(), location->cloneStackTrace(), location->scriptId()); |
109 } | 106 } |
110 | 107 |
111 // TODO(dgozman): do not wrap in ConsoleMessage. | 108 // TODO(dgozman): do not wrap in ConsoleMessage. |
112 m_workerThread->workerReportingProxy().reportConsoleMessage(ConsoleMessage::
create(JSMessageSource, ErrorMessageLevel, event->messageForConsole(), event->lo
cation()->clone())); | 109 m_workerThread->workerReportingProxy().reportConsoleMessage(ConsoleMessage::
create(JSMessageSource, ErrorMessageLevel, event->messageForConsole(), event->lo
cation()->clone())); |
113 } | 110 } |
114 | 111 |
115 int WorkerThreadDebugger::contextGroupId() | 112 int WorkerThreadDebugger::contextGroupId() |
116 { | 113 { |
117 return workerContextGroupId; | 114 return workerContextGroupId; |
118 } | 115 } |
119 | 116 |
120 void WorkerThreadDebugger::runMessageLoopOnPause(int contextGroupId) | 117 void WorkerThreadDebugger::runMessageLoopOnPause(int contextGroupId) |
121 { | 118 { |
122 ASSERT(contextGroupId == workerContextGroupId); | 119 ASSERT(contextGroupId == workerContextGroupId); |
123 m_workerThread->startRunningDebuggerTasksOnPauseOnWorkerThread(); | 120 m_workerThread->startRunningDebuggerTasksOnPauseOnWorkerThread(); |
124 } | 121 } |
125 | 122 |
126 void WorkerThreadDebugger::quitMessageLoopOnPause() | 123 void WorkerThreadDebugger::quitMessageLoopOnPause() |
127 { | 124 { |
128 m_workerThread->stopRunningDebuggerTasksOnPauseOnWorkerThread(); | 125 m_workerThread->stopRunningDebuggerTasksOnPauseOnWorkerThread(); |
129 } | 126 } |
130 | 127 |
131 void WorkerThreadDebugger::muteWarningsAndDeprecations(int contextGroupId) | 128 void WorkerThreadDebugger::muteMetrics(int contextGroupId) |
132 { | 129 { |
133 DCHECK(contextGroupId == workerContextGroupId); | 130 DCHECK(contextGroupId == workerContextGroupId); |
134 m_workerThread->consoleMessageStorage()->mute(); | |
135 } | 131 } |
136 | 132 |
137 void WorkerThreadDebugger::unmuteWarningsAndDeprecations(int contextGroupId) | 133 void WorkerThreadDebugger::unmuteMetrics(int contextGroupId) |
138 { | 134 { |
139 DCHECK(contextGroupId == workerContextGroupId); | 135 DCHECK(contextGroupId == workerContextGroupId); |
140 m_workerThread->consoleMessageStorage()->unmute(); | |
141 } | 136 } |
142 | 137 |
143 v8::Local<v8::Context> WorkerThreadDebugger::ensureDefaultContextInGroup(int con
textGroupId) | 138 v8::Local<v8::Context> WorkerThreadDebugger::ensureDefaultContextInGroup(int con
textGroupId) |
144 { | 139 { |
145 ASSERT(contextGroupId == workerContextGroupId); | 140 ASSERT(contextGroupId == workerContextGroupId); |
146 ScriptState* scriptState = m_workerThread->globalScope()->scriptController()
->getScriptState(); | 141 ScriptState* scriptState = m_workerThread->globalScope()->scriptController()
->getScriptState(); |
147 return scriptState ? scriptState->context() : v8::Local<v8::Context>(); | 142 return scriptState ? scriptState->context() : v8::Local<v8::Context>(); |
148 } | 143 } |
149 | 144 |
150 void WorkerThreadDebugger::beginEnsureAllContextsInGroup(int contextGroupId) | 145 void WorkerThreadDebugger::beginEnsureAllContextsInGroup(int contextGroupId) |
(...skipping 22 matching lines...) Expand all Loading... |
173 m_workerThread->workerReportingProxy().reportConsoleMessage(consoleMessage); | 168 m_workerThread->workerReportingProxy().reportConsoleMessage(consoleMessage); |
174 } | 169 } |
175 | 170 |
176 v8::MaybeLocal<v8::Value> WorkerThreadDebugger::memoryInfo(v8::Isolate*, v8::Loc
al<v8::Context>) | 171 v8::MaybeLocal<v8::Value> WorkerThreadDebugger::memoryInfo(v8::Isolate*, v8::Loc
al<v8::Context>) |
177 { | 172 { |
178 ASSERT_NOT_REACHED(); | 173 ASSERT_NOT_REACHED(); |
179 return v8::MaybeLocal<v8::Value>(); | 174 return v8::MaybeLocal<v8::Value>(); |
180 } | 175 } |
181 | 176 |
182 } // namespace blink | 177 } // namespace blink |
OLD | NEW |