| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 m_url = url; | 167 m_url = url; |
| 168 Vector<String> protocols; | 168 Vector<String> protocols; |
| 169 // Avoid placing an empty token in the Vector when the protocol string is | 169 // Avoid placing an empty token in the Vector when the protocol string is |
| 170 // empty. | 170 // empty. |
| 171 if (!protocol.isEmpty()) { | 171 if (!protocol.isEmpty()) { |
| 172 // Since protocol is already verified and escaped, we can simply split | 172 // Since protocol is already verified and escaped, we can simply split |
| 173 // it. | 173 // it. |
| 174 protocol.split(", ", true, protocols); | 174 protocol.split(", ", true, protocols); |
| 175 } | 175 } |
| 176 | 176 |
| 177 if (document()->frame()) { | 177 if (document()->frame() && document()->frame()->interfaceProvider()) { |
| 178 // Initialize the WebSocketHandle with the frame's InterfaceProvider to | 178 // Initialize the WebSocketHandle with the frame's InterfaceProvider to |
| 179 // provide the WebSocket implementation with context about this frame. | 179 // provide the WebSocket implementation with context about this frame. |
| 180 // This is important so that the browser can show UI associated with | 180 // This is important so that the browser can show UI associated with |
| 181 // the WebSocket (e.g., for certificate errors). | 181 // the WebSocket (e.g., for certificate errors). |
| 182 m_handle->initialize(document()->frame()->interfaceProvider()); | 182 m_handle->initialize(document()->frame()->interfaceProvider()); |
| 183 } else { | 183 } else { |
| 184 m_handle->initialize(Platform::current()->interfaceProvider()); | 184 m_handle->initialize(Platform::current()->interfaceProvider()); |
| 185 } | 185 } |
| 186 m_handle->connect(url, protocols, document()->getSecurityOrigin(), | 186 m_handle->connect(url, protocols, document()->getSecurityOrigin(), |
| 187 document()->firstPartyForCookies(), document()->userAgent(), | 187 document()->firstPartyForCookies(), document()->userAgent(), |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 WebSocketChannel::trace(visitor); | 653 WebSocketChannel::trace(visitor); |
| 654 } | 654 } |
| 655 | 655 |
| 656 std::ostream& operator<<(std::ostream& ostream, | 656 std::ostream& operator<<(std::ostream& ostream, |
| 657 const DocumentWebSocketChannel* channel) { | 657 const DocumentWebSocketChannel* channel) { |
| 658 return ostream << "DocumentWebSocketChannel " | 658 return ostream << "DocumentWebSocketChannel " |
| 659 << static_cast<const void*>(channel); | 659 << static_cast<const void*>(channel); |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace blink | 662 } // namespace blink |
| OLD | NEW |