WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-78459-20120310101913.patch (text/plain), 13.26 KB, created by
Takashi Toyoshima
on 2012-03-09 17:19:15 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Toyoshima
Created:
2012-03-09 17:19:15 PST
Size:
13.26 KB
patch
obsolete
>Subversion Revision: 110321 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 499a051be641070ec660548bebbcbc74a6faeaf7..53d06e026d3c4eec9b300b3a975d680bbf6ba048 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2012-02-28 Takashi Toyoshima <toyoshim@chromium.org> >+ >+ [Chromium] [WebSocket] provide WebFrameClient with a chance of >+ accessing to opening WebSocketStreamHandle. >+ https://bugs.webkit.org/show_bug.cgi?id=78459 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add willOpenSocketStream client function to WebFrameClient with an >+ argument representing an opening SocketStreamHandle. >+ These mechanisms provide embedders with a chance to bind arbitrary >+ data to a WebSocketStreamHandle from WebFrameClient to which the >+ WebSocket object having the WebSocketStreamHandle belongs. >+ >+ No new tests because this change just provide mechanisms to embedders. >+ >+ * Modules/websockets/WebSocketChannel.cpp: Implement willOpenSocketStream to call a client function in WebFrameClient. >+ (WebCore::WebSocketChannel::willOpenSocketStream): >+ (WebCore): >+ * Modules/websockets/WebSocketChannel.h: Add willOpenSocketStream declaration. >+ (WebSocketChannel): >+ * loader/FrameLoaderClient.h: Add dispatchWillOpenSocketStream declaration. >+ (WebCore): >+ (FrameLoaderClient): >+ (WebCore::FrameLoaderClient::dispatchWillOpenSocketStream): >+ * platform/network/SocketStreamHandleClient.h: Add willOpenSocketStream declaration. >+ (WebCore::SocketStreamHandleClient::willOpenSocketStream): >+ > 2012-03-09 Ryosuke Niwa <rniwa@webkit.org> > > Remove a bogus assertion. This condition is no longer true for non-document tree scopes. >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 9155993a516fee8265bc2b2ad0e0a0792d1aff34..8350b63df1dfdc2cc0dab3ca4c83213ea751a01b 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,35 @@ >+2012-02-28 Takashi Toyoshima <toyoshim@chromium.org> >+ >+ [Chromium] [WebSocket] provide WebFrameClient with a chance of >+ accessing to opening WebSocketStreamHandle. >+ https://bugs.webkit.org/show_bug.cgi?id=78459 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add willOpenSocketStream client function to WebFrameClient with an >+ argument representing an opening SocketStreamHandle. >+ These mechanisms provide embedders with a chance to bind arbitrary >+ data to a WebSocketStreamHandle from WebFrameClient to which the >+ WebSocket object having the WebSocketStreamHandle belongs. >+ >+ No new tests because this change just provide mechanisms to embedders. >+ >+ * public/WebFrameClient.h: Add willOpenSocketStream declaration. >+ (WebKit): >+ (WebFrameClient): >+ (WebKit::WebFrameClient::willOpenSocketStream): >+ * public/platform/WebSocketStreamHandle.h: Add default implementation to virtual functions. >+ (WebKit::WebSocketStreamHandle::connect): >+ (WebKit::WebSocketStreamHandle::send): >+ (WebKit::WebSocketStreamHandle::close): >+ * src/FrameLoaderClientImpl.cpp: Implement willOpenSocketStream. >+ (WebKit::FrameLoaderClientImpl::willOpenSocketStream): >+ (WebKit): >+ * src/FrameLoaderClientImpl.h: Add willOpenSocketStream declaratioin. >+ (FrameLoaderClientImpl): >+ * src/SocketStreamHandle.cpp: Call willOpenSocketStream client function. >+ (WebCore::SocketStreamHandleInternal::connect): >+ > 2012-03-09 Dana Jansens <danakj@chromium.org> > > [chromium] Use opaque paints in CCOcclusionTracker >diff --git a/Source/WebCore/Modules/websockets/WebSocketChannel.cpp b/Source/WebCore/Modules/websockets/WebSocketChannel.cpp >index 6c976aac9ee26f2be725be28f5c022f1fb05c29a..46322f8c8ec490863cf9491dcc59ec953ab29618 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketChannel.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocketChannel.cpp >@@ -39,6 +39,9 @@ > #include "Document.h" > #include "FileError.h" > #include "FileReaderLoader.h" >+#include "Frame.h" >+#include "FrameLoader.h" >+#include "FrameLoaderClient.h" > #include "InspectorInstrumentation.h" > #include "Logging.h" > #include "Page.h" >@@ -265,6 +268,15 @@ void WebSocketChannel::resume() > m_resumeTimer.startOneShot(0); > } > >+void WebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle) >+{ >+ LOG(Network, "WebSocketChannel %p willOpensocketStream", this); >+ ASSERT(handle); >+ Frame* frame = m_document->frame(); >+ if (frame) >+ frame->loader()->client()->dispatchWillOpenSocketStream(handle); >+} >+ > void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle) > { > LOG(Network, "WebSocketChannel %p didOpenSocketStream", this); >diff --git a/Source/WebCore/Modules/websockets/WebSocketChannel.h b/Source/WebCore/Modules/websockets/WebSocketChannel.h >index 62b4fd35f9366598bc95aa055f47afa5c96d65a2..62b273e08e0507755a8d99e0f22dab5c4f31eb58 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketChannel.h >+++ b/Source/WebCore/Modules/websockets/WebSocketChannel.h >@@ -84,6 +84,7 @@ public: > virtual void resume() OVERRIDE; > > // SocketStreamHandleClient functions. >+ virtual void willOpenSocketStream(SocketStreamHandle*) OVERRIDE; > virtual void didOpenSocketStream(SocketStreamHandle*) OVERRIDE; > virtual void didCloseSocketStream(SocketStreamHandle*) OVERRIDE; > virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, int) OVERRIDE; >diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h >index 235c41c837f8495bd5755b56ae7898b1aaa888b9..202f33871146f4ba2a1d0c71a2aa8edb4339d3ce 100644 >--- a/Source/WebCore/loader/FrameLoaderClient.h >+++ b/Source/WebCore/loader/FrameLoaderClient.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. >+ * Copyright (C) 2012 Google Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -95,6 +96,7 @@ namespace WebCore { > class ResourceResponse; > class SecurityOrigin; > class SharedBuffer; >+ class SocketStreamHandle; > class StringWithDirection; > class SubstituteData; > class Widget; >@@ -331,6 +333,8 @@ namespace WebCore { > #if ENABLE(WEB_INTENTS) > virtual void dispatchIntent(PassRefPtr<IntentRequest>) = 0; > #endif >+ >+ virtual void dispatchWillOpenSocketStream(SocketStreamHandle*) { } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/network/SocketStreamHandleClient.h b/Source/WebCore/platform/network/SocketStreamHandleClient.h >index 573986a8947883ec9f7c9d9f62ef3188b31241bb..bff6676b96abdcad2da49c4fdb4f964cd1a58100 100644 >--- a/Source/WebCore/platform/network/SocketStreamHandleClient.h >+++ b/Source/WebCore/platform/network/SocketStreamHandleClient.h >@@ -1,6 +1,6 @@ > /* > * Copyright (C) 2009 Apple Inc. All rights reserved. >- * Copyright (C) 2009, 2011 Google Inc. All rights reserved. >+ * Copyright (C) 2009, 2011, 2012 Google Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are >@@ -43,6 +43,7 @@ namespace WebCore { > public: > virtual ~SocketStreamHandleClient() { } > >+ virtual void willOpenSocketStream(SocketStreamHandle*) { } > virtual void didOpenSocketStream(SocketStreamHandle*) { } > virtual void didCloseSocketStream(SocketStreamHandle*) { } > virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char* /*data*/, int /*length*/) { } >diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h >index fa6fc7a3351cdaaa3b67c6962a415677b9ba5098..f390a8f7c2a9a44df11fd84c203f83b981aa2297 100644 >--- a/Source/WebKit/chromium/public/WebFrameClient.h >+++ b/Source/WebKit/chromium/public/WebFrameClient.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2011 Google Inc. All rights reserved. >+ * Copyright (C) 2011, 2012 Google Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are >@@ -63,6 +63,8 @@ class WebMediaPlayerClient; > class WebNode; > class WebPlugin; > class WebSharedWorker; >+class WebSharedWorkerClient; >+class WebSocketStreamHandle; > class WebStorageQuotaCallbacks; > class WebString; > class WebURL; >@@ -70,7 +72,6 @@ class WebURLLoader; > class WebURLRequest; > class WebURLResponse; > class WebWorker; >-class WebSharedWorkerClient; > struct WebPluginParams; > struct WebRect; > struct WebSize; >@@ -385,6 +386,11 @@ public: > // object to coordinate replies to the intent invocation. > virtual void dispatchIntent(WebFrame*, const WebIntentRequest&) { } > >+ // WebSocket ----------------------------------------------------- >+ >+ // A WebSocket object is going to open new stream connection. >+ virtual void willOpenSocketStream(WebSocketStreamHandle*) { } >+ > // Messages ------------------------------------------------------ > > // Notifies the embedder that a postMessage was issued on this frame, and >diff --git a/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h b/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h >index ededa0e43136bfc94211d799a5d2843c2154a111..af9672de14b45dbba374b5f6816c0d8301f49141 100644 >--- a/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h >+++ b/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2009 Google Inc. All rights reserved. >+ * Copyright (C) 2009, 2012 Google Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are >@@ -44,13 +44,13 @@ public: > virtual ~WebSocketStreamHandle() { } > > // Connect new socket stream asynchronously. >- virtual void connect(const WebURL&, WebSocketStreamHandleClient*) = 0; >+ virtual void connect(const WebURL&, WebSocketStreamHandleClient*) { } > > // Send web socket frame data on the socket stream. >- virtual bool send(const WebData&) = 0; >+ virtual bool send(const WebData&) { return false; } > > // Close the socket stream. >- virtual void close() = 0; >+ virtual void close() { } > }; > > } // namespace WebKit >diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >index 2dada5c50725f080dffdfc4c87bde746cf6ec721..f13f07801cda5ed636820c982f1db169560606bb 100644 >--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2009 Google Inc. All rights reserved. >+ * Copyright (C) 2009, 2012 Google Inc. All rights reserved. > * Copyright (C) 2011 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without >@@ -59,6 +59,7 @@ > #include "ResourceHandleInternal.h" > #include "ResourceLoader.h" > #include "Settings.h" >+#include "SocketStreamHandleInternal.h" > #include "StringExtras.h" > #include "WebDOMEvent.h" > #include "WebDataSourceImpl.h" >@@ -78,6 +79,7 @@ > #include "WebPluginLoadObserver.h" > #include "WebPluginParams.h" > #include "WebSecurityOrigin.h" >+#include "platform/WebSocketStreamHandle.h" > #include "platform/WebURL.h" > #include "platform/WebURLError.h" > #include "platform/WebVector.h" >@@ -1649,4 +1651,9 @@ void FrameLoaderClientImpl::dispatchIntent(PassRefPtr<WebCore::IntentRequest> in > } > #endif > >+void FrameLoaderClientImpl::willOpenSocketStream(SocketStreamHandle* handle) >+{ >+ m_webFrame->client()->willOpenSocketStream(SocketStreamHandleInternal::toWebSocketStreamHandle(handle)); >+} >+ > } // namespace WebKit >diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >index 53d5997e8fcc18c4b1e25c0754fad06ee959f35e..a0f0cd89891137d350ce6588810d1efaca7b743c 100644 >--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2009 Google Inc. All rights reserved. >+ * Copyright (C) 2009, 2012 Google Inc. All rights reserved. > * Copyright (C) 2011 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without >@@ -212,6 +212,8 @@ public: > virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE; > #endif > >+ virtual void willOpenSocketStream(WebCore::SocketStreamHandle*) OVERRIDE; >+ > private: > void makeDocumentView(); > >diff --git a/Source/WebKit/chromium/src/SocketStreamHandle.cpp b/Source/WebKit/chromium/src/SocketStreamHandle.cpp >index 298e733a41cb3487968953a7f528e5e2373cb273..6a32299afefeed817c83de2157c66ba735086ad3 100644 >--- a/Source/WebKit/chromium/src/SocketStreamHandle.cpp >+++ b/Source/WebKit/chromium/src/SocketStreamHandle.cpp >@@ -64,6 +64,9 @@ void SocketStreamHandleInternal::connect(const KURL& url) > m_socket = adoptPtr(webKitPlatformSupport()->createSocketStreamHandle()); > LOG(Network, "connect"); > ASSERT(m_socket); >+ ASSERT(m_handle); >+ if (m_handle->m_client) >+ m_handle->m_client->willOpenSocketStream(m_handle); > m_socket->connect(url, this); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 78459
:
126731
|
126939
|
127126
|
127955
|
128198
|
129343
|
131139
|
131382
|
131441
|
131747
|
132638
|
133033