| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 SyntaxError, "The subprotocol '" + | 357 SyntaxError, "The subprotocol '" + |
| 358 encodeSubprotocolString(protocols[i]) + | 358 encodeSubprotocolString(protocols[i]) + |
| 359 "' is invalid."); | 359 "' is invalid."); |
| 360 return; | 360 return; |
| 361 } | 361 } |
| 362 } | 362 } |
| 363 | 363 |
| 364 // Fail if there're duplicated elements in |protocols|. | 364 // Fail if there're duplicated elements in |protocols|. |
| 365 HashSet<String> visited; | 365 HashSet<String> visited; |
| 366 for (size_t i = 0; i < protocols.size(); ++i) { | 366 for (size_t i = 0; i < protocols.size(); ++i) { |
| 367 if (!visited.add(protocols[i]).isNewEntry) { | 367 if (!visited.insert(protocols[i]).isNewEntry) { |
| 368 m_state = kClosed; | 368 m_state = kClosed; |
| 369 exceptionState.throwDOMException( | 369 exceptionState.throwDOMException( |
| 370 SyntaxError, "The subprotocol '" + | 370 SyntaxError, "The subprotocol '" + |
| 371 encodeSubprotocolString(protocols[i]) + | 371 encodeSubprotocolString(protocols[i]) + |
| 372 "' is duplicated."); | 372 "' is duplicated."); |
| 373 return; | 373 return; |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 if (getExecutionContext()->getSecurityOrigin()->hasSuborigin()) { | 377 if (getExecutionContext()->getSecurityOrigin()->hasSuborigin()) { |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 | 864 |
| 865 DEFINE_TRACE(DOMWebSocket) { | 865 DEFINE_TRACE(DOMWebSocket) { |
| 866 visitor->trace(m_channel); | 866 visitor->trace(m_channel); |
| 867 visitor->trace(m_eventQueue); | 867 visitor->trace(m_eventQueue); |
| 868 WebSocketChannelClient::trace(visitor); | 868 WebSocketChannelClient::trace(visitor); |
| 869 EventTargetWithInlineData::trace(visitor); | 869 EventTargetWithInlineData::trace(visitor); |
| 870 SuspendableObject::trace(visitor); | 870 SuspendableObject::trace(visitor); |
| 871 } | 871 } |
| 872 | 872 |
| 873 } // namespace blink | 873 } // namespace blink |
| OLD | NEW |