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-20120215174016.patch (text/plain), 15.58 KB, created by
Takashi Toyoshima
on 2012-02-15 00:40:17 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Toyoshima
Created:
2012-02-15 00:40:17 PST
Size:
15.58 KB
patch
obsolete
>Subversion Revision: 107786 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0a3bdc91c2a0500edbd407eeb427023199c3ed05..6ab75766ab7a652e3961506899edc74ba02ade84 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2012-02-15 Takashi Toyoshima <toyoshim@chromium.org> >+ >+ [Chromium] [WebSocket] provide a path to bind WebFrameClient and SocketStreamHandle >+ https://bugs.webkit.org/show_bug.cgi?id=78459 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * loader/FrameLoader.cpp: Implement willOpenSocketStream. >+ (WebCore::FrameLoader::willOpenSocketStream): >+ (WebCore): >+ * loader/FrameLoader.h: Add willOpenSocketStream declaration. >+ (WebCore): >+ (FrameLoader): >+ * loader/FrameLoaderClient.h: Add willOpenSocketStream declaration. >+ (WebCore): >+ (FrameLoaderClient): >+ (WebCore::FrameLoaderClient::willOpenSocketStream): >+ * platform/network/chromium/SocketStreamHandle.h: Add willOpenSocketStream declaration. >+ (WebCore): >+ (SocketStreamHandle): >+ * platform/network/SocketStreamHandleClient.h: Add willOpenSocketStream declaration. >+ (WebCore::SocketStreamHandleClient::willOpenSocketStream): >+ * websockets/WebSocketChannel.cpp: Implement willOpenSocketStream. >+ (WebCore::WebSocketChannel::willOpenSocketStream): >+ * websockets/WebSocketChannel.h: Add willOpenSocketStream declaration. >+ (WebSocketChannel): >+ > 2012-02-15 Hayato Ito <hayato@chromium.org> > > ShadowRoot: Remove a public static factory function which doesn't have any callers. >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index a2db929e5eaf6f2b9a74354a83d25cb8f1506a6e..89f10bfda574136a8f7798ab6a360c84b9f81cce 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,5 +1,31 @@ > 2012-02-14 Takashi Toyoshima <toyoshim@chromium.org> > >+ [Chromium] [WebSocket] provide a path to bind WebFrameClient and SocketStreamHandle >+ https://bugs.webkit.org/show_bug.cgi?id=78459 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * public/platform/WebSocketStreamHandle.h: Add setRequestorID and requestorID. >+ (WebKit::WebSocketStreamHandle::connect): >+ (WebKit::WebSocketStreamHandle::send): >+ (WebKit::WebSocketStreamHandle::close): >+ (WebSocketStreamHandle): >+ (WebKit::WebSocketStreamHandle::setRequestorID): >+ (WebKit::WebSocketStreamHandle::requestorID): >+ * public/WebFrameClient.h: Add willOpenSocketStream declaration. >+ (WebKit): >+ (WebFrameClient): >+ (WebKit::WebFrameClient::willOpenSocketStream): >+ * src/FrameLoaderClientImpl.cpp: Implement willOpenSocketStream. >+ (WebKit::FrameLoaderClientImpl::willOpenSocketStream): >+ (WebKit): >+ * src/FrameLoaderClientImpl.h: Implement willOpenSocketStream. >+ (FrameLoaderClientImpl): >+ * src/SocketStreamHandle.cpp: Call willOpenSocketStream client function. >+ (WebCore::SocketStreamHandleInternal::connect): >+ >+2012-02-14 Takashi Toyoshima <toyoshim@chromium.org> >+ > Provide SocketStreamHandleInternal::toWebSocketStreamHandle(SocketStreamHandle*). > https://bugs.webkit.org/show_bug.cgi?id=78581 > >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index cd228d4ba8dff0cb25f555968354dd6382d0d361..36d549e15d94827c4155c832754411f7856d6089 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -5,7 +5,7 @@ > * Copyright (C) 2008 Alp Toker <alp@atoker.com> > * Copyright (C) Research In Motion Limited 2009. All rights reserved. > * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> >- * 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 >@@ -1416,6 +1416,11 @@ bool FrameLoader::willLoadMediaElementURL(KURL& url) > return error.isNull(); > } > >+void FrameLoader::willOpenSocketStream(SocketStreamHandle* handle) >+{ >+ m_client->willOpenSocketStream(handle); >+} >+ > bool FrameLoader::shouldReloadToHandleUnreachableURL(DocumentLoader* docLoader) > { > KURL unreachableURL = docLoader->unreachableURL(); >diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h >index 218028c6472f95fb463fe1075ba98e647c4cc3b9..f29d9cf21a5a3b7261fbb3d32df3250cbf502336 100644 >--- a/Source/WebCore/loader/FrameLoader.h >+++ b/Source/WebCore/loader/FrameLoader.h >@@ -2,7 +2,7 @@ > * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. > * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) > * Copyright (C) Research In Motion Limited 2009. All rights reserved. >- * 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 >@@ -69,6 +69,7 @@ class ResourceRequest; > class ResourceResponse; > class SecurityOrigin; > class SerializedScriptValue; >+class SocketStreamHandle; > class StringWithDirection; > class SubstituteData; > >@@ -154,6 +155,7 @@ public: > void receivedMainResourceError(const ResourceError&, bool isComplete); > > bool willLoadMediaElementURL(KURL&); >+ void willOpenSocketStream(SocketStreamHandle*); > > void handleFallbackContent(); > >diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h >index 8efa5553861803677fe59c7a8d44c5c01a17959d..713f3f9e44e28a58d3e5157e7ac5a913c7fa9744 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 willOpenSocketStream(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/WebCore/platform/network/chromium/SocketStreamHandle.h b/Source/WebCore/platform/network/chromium/SocketStreamHandle.h >index 6e0214d24bc82b66557d64bd4e79196eb20df7af..576da1f986e65c4131e68a8a373674d8d1057f2d 100644 >--- a/Source/WebCore/platform/network/chromium/SocketStreamHandle.h >+++ b/Source/WebCore/platform/network/chromium/SocketStreamHandle.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 >@@ -41,6 +41,7 @@ namespace WebCore { > > class AuthenticationChallenge; > class Credential; >+ class FrameLoaderClientImpl; > class SocketStreamHandleClient; > class SocketStreamHandleInternal; > >@@ -65,6 +66,7 @@ namespace WebCore { > void receivedCancellation(const AuthenticationChallenge&); > > friend class SocketStreamHandleInternal; >+ friend class FrameLoaderClientImpl; > OwnPtr<SocketStreamHandleInternal> m_internal; > }; > >diff --git a/Source/WebCore/websockets/WebSocketChannel.cpp b/Source/WebCore/websockets/WebSocketChannel.cpp >index 8728e16cc9fae7dfc351042a4236ae0b3452c3b7..9c8fe196b159b791b08af99bd16c93cdeb121e8d 100644 >--- a/Source/WebCore/websockets/WebSocketChannel.cpp >+++ b/Source/WebCore/websockets/WebSocketChannel.cpp >@@ -267,6 +267,13 @@ void WebSocketChannel::resume() > m_resumeTimer.startOneShot(0); > } > >+void WebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle) >+{ >+ LOG(Network, "WebSocketChannel %p willOpensocketStream", this); >+ ASSERT(handle); >+ m_document->frame()->loader()->willOpenSocketStream(handle); >+} >+ > void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle) > { > LOG(Network, "WebSocketChannel %p didOpenSocketStream", this); >diff --git a/Source/WebCore/websockets/WebSocketChannel.h b/Source/WebCore/websockets/WebSocketChannel.h >index 73fc52da4e3d60cc1f15f0b1b401b8381388fedc..1464bc6d03d10d79a954b6fea3eca8ff0e88f341 100644 >--- a/Source/WebCore/websockets/WebSocketChannel.h >+++ b/Source/WebCore/websockets/WebSocketChannel.h >@@ -81,6 +81,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/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h >index d0507e3d1b5d2462bb2481a871d33d9beb050c6c..6b7d753848decac91130f88298f694206d6ea0d5 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..3a9027473e1e16e2dd978eae08920b33b029f720 100644 >--- a/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h >+++ b/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h >@@ -44,13 +44,19 @@ 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() { } >+ >+ // Set requestor ID binded to RenderView. >+ virtual void setRequestorID(int) { } >+ >+ // Get requestor ID binded to RenderView. >+ virtual int requestorID() { return 0; } > }; > > } // namespace WebKit >diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >index a85ccbd2e39a9640f71c2ef1960bd6aee894e6e9..844924de1742dfc00f186c08bdef5379d793bce4 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" >@@ -1638,4 +1640,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 0bf935d6dd98089278504f77e3e98fddf2eadc02..cf587a36da1a2aa06ff760767515bb0dfc599ee8 100644 >--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >@@ -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