Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp

Issue 2003253002: [Devtools] Allow User-Agent header override for Websockets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // it. 177 // it.
178 protocol.split(", ", true, protocols); 178 protocol.split(", ", true, protocols);
179 } 179 }
180 WebVector<WebString> webProtocols(protocols.size()); 180 WebVector<WebString> webProtocols(protocols.size());
181 for (size_t i = 0; i < protocols.size(); ++i) { 181 for (size_t i = 0; i < protocols.size(); ++i) {
182 webProtocols[i] = protocols[i]; 182 webProtocols[i] = protocols[i];
183 } 183 }
184 184
185 if (document()->frame()) 185 if (document()->frame())
186 document()->frame()->loader().client()->dispatchWillOpenWebSocket(m_hand le.get()); 186 document()->frame()->loader().client()->dispatchWillOpenWebSocket(m_hand le.get());
187 m_handle->connect(url, webProtocols, WebSecurityOrigin(getExecutionContext() ->getSecurityOrigin()), this); 187 m_handle->connect(url, webProtocols, WebSecurityOrigin(getExecutionContext() ->getSecurityOrigin()), document()->userAgent(), this);
188
189 flowControlIfNecessary(); 188 flowControlIfNecessary();
190 TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketCreate", TRACE_EVENT_SCO PE_THREAD, "data", InspectorWebSocketCreateEvent::data(document(), m_identifier, url, protocol)); 189 TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketCreate", TRACE_EVENT_SCO PE_THREAD, "data", InspectorWebSocketCreateEvent::data(document(), m_identifier, url, protocol));
191 InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, url, protocol); 190 InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, url, protocol);
192 return true; 191 return true;
193 } 192 }
194 193
195 void DocumentWebSocketChannel::send(const CString& message) 194 void DocumentWebSocketChannel::send(const CString& message)
196 { 195 {
197 WTF_LOG(Network, "DocumentWebSocketChannel %p sendText(%s)", this, message.d ata()); 196 WTF_LOG(Network, "DocumentWebSocketChannel %p sendText(%s)", this, message.d ata());
198 // FIXME: Change the inspector API to show the entire message instead 197 // FIXME: Change the inspector API to show the entire message instead
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 DEFINE_TRACE(DocumentWebSocketChannel) 580 DEFINE_TRACE(DocumentWebSocketChannel)
582 { 581 {
583 visitor->trace(m_blobLoader); 582 visitor->trace(m_blobLoader);
584 visitor->trace(m_messages); 583 visitor->trace(m_messages);
585 visitor->trace(m_client); 584 visitor->trace(m_client);
586 WebSocketChannel::trace(visitor); 585 WebSocketChannel::trace(visitor);
587 ContextLifecycleObserver::trace(visitor); 586 ContextLifecycleObserver::trace(visitor);
588 } 587 }
589 588
590 } // namespace blink 589 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698