OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d
ataSource); | 190 return m_networkProvider && m_networkProvider->isControlledByServiceWorker(d
ataSource); |
191 } | 191 } |
192 | 192 |
193 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) | 193 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) |
194 { | 194 { |
195 if (!m_networkProvider) | 195 if (!m_networkProvider) |
196 return -1; | 196 return -1; |
197 return m_networkProvider->serviceWorkerID(dataSource); | 197 return m_networkProvider->serviceWorkerID(dataSource); |
198 } | 198 } |
199 | 199 |
200 void WebSharedWorkerImpl::sendProtocolMessage(int callId, const WebString& messa
ge, const WebString& state) | 200 void WebSharedWorkerImpl::sendProtocolMessage(int sessionId, int callId, const W
ebString& message, const WebString& state) |
201 { | 201 { |
202 m_client->sendDevToolsMessage(callId, message, state); | 202 m_client->sendDevToolsMessage(sessionId, callId, message, state); |
203 } | 203 } |
204 | 204 |
205 void WebSharedWorkerImpl::resumeStartup() | 205 void WebSharedWorkerImpl::resumeStartup() |
206 { | 206 { |
207 bool isPausedOnStart = m_isPausedOnStart; | 207 bool isPausedOnStart = m_isPausedOnStart; |
208 m_isPausedOnStart = false; | 208 m_isPausedOnStart = false; |
209 if (isPausedOnStart) | 209 if (isPausedOnStart) |
210 loadShadowPage(); | 210 loadShadowPage(); |
211 } | 211 } |
212 | 212 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 void WebSharedWorkerImpl::terminateWorkerContext() | 357 void WebSharedWorkerImpl::terminateWorkerContext() |
358 { | 358 { |
359 terminateWorkerThread(); | 359 terminateWorkerThread(); |
360 } | 360 } |
361 | 361 |
362 void WebSharedWorkerImpl::pauseWorkerContextOnStart() | 362 void WebSharedWorkerImpl::pauseWorkerContextOnStart() |
363 { | 363 { |
364 m_pauseWorkerContextOnStart = true; | 364 m_pauseWorkerContextOnStart = true; |
365 } | 365 } |
366 | 366 |
367 void WebSharedWorkerImpl::attachDevTools(const WebString& hostId) | 367 void WebSharedWorkerImpl::attachDevTools(const WebString& hostId, int sessionId) |
368 { | 368 { |
369 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); | 369 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); |
370 if (devtoolsAgent) | 370 if (devtoolsAgent) |
371 devtoolsAgent->attach(hostId); | 371 devtoolsAgent->attach(hostId, sessionId); |
372 } | 372 } |
373 | 373 |
374 void WebSharedWorkerImpl::reattachDevTools(const WebString& hostId, const WebStr
ing& savedState) | 374 void WebSharedWorkerImpl::reattachDevTools(const WebString& hostId, int sessionI
d, const WebString& savedState) |
375 { | 375 { |
376 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); | 376 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); |
377 if (devtoolsAgent) | 377 if (devtoolsAgent) |
378 devtoolsAgent->reattach(hostId, savedState); | 378 devtoolsAgent->reattach(hostId, sessionId, savedState); |
379 resumeStartup(); | 379 resumeStartup(); |
380 } | 380 } |
381 | 381 |
382 void WebSharedWorkerImpl::detachDevTools() | 382 void WebSharedWorkerImpl::detachDevTools() |
383 { | 383 { |
384 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); | 384 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); |
385 if (devtoolsAgent) | 385 if (devtoolsAgent) |
386 devtoolsAgent->detach(); | 386 devtoolsAgent->detach(); |
387 } | 387 } |
388 | 388 |
389 void WebSharedWorkerImpl::dispatchDevToolsMessage(const WebString& message) | 389 void WebSharedWorkerImpl::dispatchDevToolsMessage(int sessionId, const WebString
& message) |
390 { | 390 { |
391 if (m_askedToTerminate) | 391 if (m_askedToTerminate) |
392 return; | 392 return; |
393 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); | 393 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); |
394 if (devtoolsAgent) | 394 if (devtoolsAgent) |
395 devtoolsAgent->dispatchOnInspectorBackend(message); | 395 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
396 } | 396 } |
397 | 397 |
398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
399 { | 399 { |
400 return new WebSharedWorkerImpl(client); | 400 return new WebSharedWorkerImpl(client); |
401 } | 401 } |
402 | 402 |
403 } // namespace blink | 403 } // namespace blink |
OLD | NEW |