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

Unified Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp

Issue 2564493002: Make WebSocket available again in service workers (Closed)
Patch Set: Addressed #26 Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/websocket/websocket-in-service-worker.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
index 95c0ded764028caec622a5dee76bd01b8675ae98..47d278cb56836228bf5891529c0b39d367e47dd9 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -49,6 +49,7 @@
#include "platform/network/NetworkLog.h"
#include "platform/network/WebSocketHandshakeRequest.h"
#include "platform/weborigin/SecurityOrigin.h"
+#include "public/platform/InterfaceProvider.h"
#include "public/platform/Platform.h"
#include "wtf/PtrUtil.h"
#include <memory>
@@ -174,7 +175,9 @@ bool DocumentWebSocketChannel::connect(const KURL& url,
protocol.split(", ", true, protocols);
}
- if (document()->frame()) {
+ if (document()->frame() &&
+ document()->frame()->interfaceProvider() !=
+ InterfaceProvider::getEmptyInterfaceProvider()) {
// Initialize the WebSocketHandle with the frame's InterfaceProvider to
// provide the WebSocket implementation with context about this frame.
// This is important so that the browser can show UI associated with
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/websocket/websocket-in-service-worker.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698