| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 WebSocketChannel* WebSocketChannel::create(ExecutionContext* context, WebSocketC
hannelClient* client) | 45 WebSocketChannel* WebSocketChannel::create(ExecutionContext* context, WebSocketC
hannelClient* client) |
| 46 { | 46 { |
| 47 ASSERT(context); | 47 ASSERT(context); |
| 48 ASSERT(client); | 48 ASSERT(client); |
| 49 | 49 |
| 50 String sourceURL; | 50 String sourceURL; |
| 51 unsigned lineNumber = 0; | 51 unsigned lineNumber = 0; |
| 52 RefPtrWillBeRawPtr<ScriptCallStack> callStack = currentScriptCallStack(1); | 52 RefPtr<ScriptCallStack> callStack = currentScriptCallStack(1); |
| 53 if (callStack && callStack->size()) { | 53 if (callStack && callStack->size()) { |
| 54 sourceURL = callStack->at(0).sourceURL(); | 54 sourceURL = callStack->at(0).sourceURL(); |
| 55 lineNumber = callStack->at(0).lineNumber(); | 55 lineNumber = callStack->at(0).lineNumber(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 if (context->isWorkerGlobalScope()) { | 58 if (context->isWorkerGlobalScope()) { |
| 59 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 59 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
| 60 return WorkerWebSocketChannel::create(*workerGlobalScope, client, source
URL, lineNumber); | 60 return WorkerWebSocketChannel::create(*workerGlobalScope, client, source
URL, lineNumber); |
| 61 } | 61 } |
| 62 | 62 |
| 63 Document* document = toDocument(context); | 63 Document* document = toDocument(context); |
| 64 return DocumentWebSocketChannel::create(document, client, sourceURL, lineNum
ber); | 64 return DocumentWebSocketChannel::create(document, client, sourceURL, lineNum
ber); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| OLD | NEW |