| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ASSERT(m_bridge); | 144 ASSERT(m_bridge); |
| 145 m_bridge->close(code, reason); | 145 m_bridge->close(code, reason); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void WorkerWebSocketChannel::fail(const String& reason, MessageLevel level, Pass
OwnPtr<SourceLocation> location) | 148 void WorkerWebSocketChannel::fail(const String& reason, MessageLevel level, Pass
OwnPtr<SourceLocation> location) |
| 149 { | 149 { |
| 150 if (!m_bridge) | 150 if (!m_bridge) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 OwnPtr<SourceLocation> capturedLocation = SourceLocation::capture(); | 153 OwnPtr<SourceLocation> capturedLocation = SourceLocation::capture(); |
| 154 if (!capturedLocation->isEmpty()) { | 154 if (!capturedLocation->isUnknown()) { |
| 155 // If we are in JavaScript context, use the current location instead | 155 // If we are in JavaScript context, use the current location instead |
| 156 // of passed one - it's more precise. | 156 // of passed one - it's more precise. |
| 157 m_bridge->fail(reason, level, std::move(capturedLocation)); | 157 m_bridge->fail(reason, level, std::move(capturedLocation)); |
| 158 } else if (!location || location->isEmpty()) { | 158 } else if (location->isUnknown()) { |
| 159 // No information is specified by the caller - use the url | 159 // No information is specified by the caller - use the url |
| 160 // and the line number at the connection. | 160 // and the line number at the connection. |
| 161 m_bridge->fail(reason, level, m_locationAtConnection->clone()); | 161 m_bridge->fail(reason, level, m_locationAtConnection->clone()); |
| 162 } else { | 162 } else { |
| 163 // Use the specified information. | 163 // Use the specified information. |
| 164 m_bridge->fail(reason, level, std::move(location)); | 164 m_bridge->fail(reason, level, std::move(location)); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 void WorkerWebSocketChannel::disconnect() | 168 void WorkerWebSocketChannel::disconnect() |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 DEFINE_TRACE(Bridge) | 472 DEFINE_TRACE(Bridge) |
| 473 { | 473 { |
| 474 visitor->trace(m_client); | 474 visitor->trace(m_client); |
| 475 visitor->trace(m_workerGlobalScope); | 475 visitor->trace(m_workerGlobalScope); |
| 476 visitor->trace(m_syncHelper); | 476 visitor->trace(m_syncHelper); |
| 477 visitor->trace(m_peer); | 477 visitor->trace(m_peer); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace blink | 480 } // namespace blink |
| OLD | NEW |