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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/inspector/WorkerConsoleAgent.h" | 32 #include "core/inspector/WorkerConsoleAgent.h" |
33 | 33 |
34 #include "bindings/core/v8/ScriptController.h" | 34 #include "bindings/core/v8/ScriptController.h" |
35 #include "core/inspector/ConsoleMessageStorage.h" | 35 #include "core/inspector/ConsoleMessageStorage.h" |
36 #include "core/workers/WorkerGlobalScope.h" | 36 #include "core/workers/WorkerGlobalScope.h" |
37 #include "core/workers/WorkerReportingProxy.h" | 37 #include "core/workers/WorkerReportingProxy.h" |
38 #include "core/workers/WorkerThread.h" | 38 #include "core/workers/WorkerScript.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 WorkerConsoleAgent::WorkerConsoleAgent(InjectedScriptManager* injectedScriptMana
ger, WorkerGlobalScope* workerGlobalScope) | 42 WorkerConsoleAgent::WorkerConsoleAgent(InjectedScriptManager* injectedScriptMana
ger, WorkerGlobalScope* workerGlobalScope) |
43 : InspectorConsoleAgent(injectedScriptManager) | 43 : InspectorConsoleAgent(injectedScriptManager) |
44 , m_workerGlobalScope(workerGlobalScope) | 44 , m_workerGlobalScope(workerGlobalScope) |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 WorkerConsoleAgent::~WorkerConsoleAgent() | 48 WorkerConsoleAgent::~WorkerConsoleAgent() |
49 { | 49 { |
50 } | 50 } |
51 | 51 |
52 DEFINE_TRACE(WorkerConsoleAgent) | 52 DEFINE_TRACE(WorkerConsoleAgent) |
53 { | 53 { |
54 visitor->trace(m_workerGlobalScope); | 54 visitor->trace(m_workerGlobalScope); |
55 InspectorConsoleAgent::trace(visitor); | 55 InspectorConsoleAgent::trace(visitor); |
56 } | 56 } |
57 | 57 |
58 void WorkerConsoleAgent::enable(ErrorString* error) | 58 void WorkerConsoleAgent::enable(ErrorString* error) |
59 { | 59 { |
60 InspectorConsoleAgent::enable(error); | 60 InspectorConsoleAgent::enable(error); |
61 m_workerGlobalScope->thread()->workerReportingProxy().postWorkerConsoleAgent
Enabled(); | 61 m_workerGlobalScope->script()->workerReportingProxy().postWorkerConsoleAgent
Enabled(); |
62 } | 62 } |
63 | 63 |
64 void WorkerConsoleAgent::clearMessages(ErrorString*) | 64 void WorkerConsoleAgent::clearMessages(ErrorString*) |
65 { | 65 { |
66 messageStorage()->clear(m_workerGlobalScope.get()); | 66 messageStorage()->clear(m_workerGlobalScope.get()); |
67 } | 67 } |
68 | 68 |
69 ConsoleMessageStorage* WorkerConsoleAgent::messageStorage() | 69 ConsoleMessageStorage* WorkerConsoleAgent::messageStorage() |
70 { | 70 { |
71 return m_workerGlobalScope->messageStorage(); | 71 return m_workerGlobalScope->messageStorage(); |
72 } | 72 } |
73 | 73 |
74 void WorkerConsoleAgent::enableStackCapturingIfNeeded() | 74 void WorkerConsoleAgent::enableStackCapturingIfNeeded() |
75 { | 75 { |
76 ScriptController::setCaptureCallStackForUncaughtExceptions(true); | 76 ScriptController::setCaptureCallStackForUncaughtExceptions(true); |
77 } | 77 } |
78 | 78 |
79 void WorkerConsoleAgent::disableStackCapturingIfNeeded() | 79 void WorkerConsoleAgent::disableStackCapturingIfNeeded() |
80 { | 80 { |
81 ScriptController::setCaptureCallStackForUncaughtExceptions(false); | 81 ScriptController::setCaptureCallStackForUncaughtExceptions(false); |
82 } | 82 } |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
OLD | NEW |