OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InPr
ocessWorkerMessagingProxy::reportConsoleMessage, crossThreadUnretained(m_messagi
ngProxy), consoleMessage->source(), consoleMessage->level(), consoleMessage->mes
sage(), passed(consoleMessage->location()->clone()))); | 78 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InPr
ocessWorkerMessagingProxy::reportConsoleMessage, crossThreadUnretained(m_messagi
ngProxy), consoleMessage->source(), consoleMessage->level(), consoleMessage->mes
sage(), passed(consoleMessage->location()->clone()))); |
79 } | 79 } |
80 | 80 |
81 void InProcessWorkerObjectProxy::postMessageToPageInspector(const String& messag
e) | 81 void InProcessWorkerObjectProxy::postMessageToPageInspector(const String& messag
e) |
82 { | 82 { |
83 ExecutionContext* context = getExecutionContext(); | 83 ExecutionContext* context = getExecutionContext(); |
84 if (context->isDocument()) | 84 if (context->isDocument()) |
85 toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThrea
dTask(&InProcessWorkerMessagingProxy::postMessageToPageInspector, crossThreadUnr
etained(m_messagingProxy), message)); | 85 toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThrea
dTask(&InProcessWorkerMessagingProxy::postMessageToPageInspector, crossThreadUnr
etained(m_messagingProxy), message)); |
86 } | 86 } |
87 | 87 |
88 void InProcessWorkerObjectProxy::postWorkerConsoleAgentEnabled() | |
89 { | |
90 ExecutionContext* context = getExecutionContext(); | |
91 if (context->isDocument()) | |
92 toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThrea
dTask(&InProcessWorkerMessagingProxy::postWorkerConsoleAgentEnabled, crossThread
Unretained(m_messagingProxy))); | |
93 } | |
94 | |
95 void InProcessWorkerObjectProxy::workerGlobalScopeClosed() | 88 void InProcessWorkerObjectProxy::workerGlobalScopeClosed() |
96 { | 89 { |
97 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InPr
ocessWorkerMessagingProxy::terminateWorkerGlobalScope, crossThreadUnretained(m_m
essagingProxy))); | 90 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InPr
ocessWorkerMessagingProxy::terminateWorkerGlobalScope, crossThreadUnretained(m_m
essagingProxy))); |
98 } | 91 } |
99 | 92 |
100 void InProcessWorkerObjectProxy::workerThreadTerminated() | 93 void InProcessWorkerObjectProxy::workerThreadTerminated() |
101 { | 94 { |
102 // This will terminate the MessagingProxy. | 95 // This will terminate the MessagingProxy. |
103 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InPr
ocessWorkerMessagingProxy::workerThreadTerminated, crossThreadUnretained(m_messa
gingProxy))); | 96 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&InPr
ocessWorkerMessagingProxy::workerThreadTerminated, crossThreadUnretained(m_messa
gingProxy))); |
104 } | 97 } |
105 | 98 |
106 InProcessWorkerObjectProxy::InProcessWorkerObjectProxy(InProcessWorkerMessagingP
roxy* messagingProxy) | 99 InProcessWorkerObjectProxy::InProcessWorkerObjectProxy(InProcessWorkerMessagingP
roxy* messagingProxy) |
107 : m_messagingProxy(messagingProxy) | 100 : m_messagingProxy(messagingProxy) |
108 { | 101 { |
109 } | 102 } |
110 | 103 |
111 ExecutionContext* InProcessWorkerObjectProxy::getExecutionContext() | 104 ExecutionContext* InProcessWorkerObjectProxy::getExecutionContext() |
112 { | 105 { |
113 DCHECK(m_messagingProxy); | 106 DCHECK(m_messagingProxy); |
114 return m_messagingProxy->getExecutionContext(); | 107 return m_messagingProxy->getExecutionContext(); |
115 } | 108 } |
116 | 109 |
117 } // namespace blink | 110 } // namespace blink |
OLD | NEW |