| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 unsigned lineNumber = 0; | 58 unsigned lineNumber = 0; |
| 59 RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true); | 59 RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true); |
| 60 if (callStack && callStack->size()) { | 60 if (callStack && callStack->size()) { |
| 61 sourceURL = callStack->at(0).sourceURL(); | 61 sourceURL = callStack->at(0).sourceURL(); |
| 62 lineNumber = callStack->at(0).lineNumber(); | 62 lineNumber = callStack->at(0).lineNumber(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 if (context->isWorkerGlobalScope()) { | 65 if (context->isWorkerGlobalScope()) { |
| 66 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 66 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
| 67 WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); | 67 WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); |
| 68 String mode = webSocketChannelMode; | 68 String mode = webSocketChannelMode + String::number(runLoop.createUnique
Id()); |
| 69 mode.append(String::number(runLoop.createUniqueId())); | |
| 70 return WorkerThreadableWebSocketChannel::create(workerGlobalScope, clien
t, mode, sourceURL, lineNumber); | 69 return WorkerThreadableWebSocketChannel::create(workerGlobalScope, clien
t, mode, sourceURL, lineNumber); |
| 71 } | 70 } |
| 72 | 71 |
| 73 Document* document = toDocument(context); | 72 Document* document = toDocument(context); |
| 74 Settings* settings = document->settings(); | 73 Settings* settings = document->settings(); |
| 75 if (settings && settings->experimentalWebSocketEnabled()) { | 74 if (settings && settings->experimentalWebSocketEnabled()) { |
| 76 // FIXME: Create and return an "experimental" WebSocketChannel instead o
f a MainThreadWebSocketChannel. | 75 // FIXME: Create and return an "experimental" WebSocketChannel instead o
f a MainThreadWebSocketChannel. |
| 77 return MainThreadWebSocketChannel::create(document, client, sourceURL, l
ineNumber); | 76 return MainThreadWebSocketChannel::create(document, client, sourceURL, l
ineNumber); |
| 78 } | 77 } |
| 79 return MainThreadWebSocketChannel::create(document, client, sourceURL, lineN
umber); | 78 return MainThreadWebSocketChannel::create(document, client, sourceURL, lineN
umber); |
| 80 } | 79 } |
| 81 | 80 |
| 82 } // namespace WebCore | 81 } // namespace WebCore |
| OLD | NEW |