| Differences between
and this patch
- a/Source/WebCore/ChangeLog +27 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-02-14  Takashi Toyoshima  <toyoshim@chromium.org>
2
3
        [Chromium] [WebSocket] provide a path to bind WebFrameClient and SocketStreamHandle
4
        https://bugs.webkit.org/show_bug.cgi?id=78459
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * loader/FrameLoader.cpp: Implement willOpenSocketStream.
9
        (WebCore::FrameLoader::willOpenSocketStream):
10
        (WebCore):
11
        * loader/FrameLoader.h: Add willOpenSocketStream declaration.
12
        (WebCore):
13
        (FrameLoader):
14
        * loader/FrameLoaderClient.h: Add willOpenSocketStream declaration.
15
        (WebCore):
16
        (FrameLoaderClient):
17
        (WebCore::FrameLoaderClient::willOpenSocketStream):
18
        * platform/network/chromium/SocketStreamHandle.h: Add willOpenSocketStream declaration.
19
        (WebCore):
20
        (SocketStreamHandle):
21
        * platform/network/SocketStreamHandleClient.h: Add willOpenSocketStream declaration.
22
        (WebCore::SocketStreamHandleClient::willOpenSocketStream):
23
        * websockets/WebSocketChannel.cpp: Implement willOpenSocketStream.
24
        (WebCore::WebSocketChannel::willOpenSocketStream):
25
        * websockets/WebSocketChannel.h: Add willOpenSocketStream declaration.
26
        (WebSocketChannel):
27
1
2012-02-13  Tony Chang  <tony@chromium.org>
28
2012-02-13  Tony Chang  <tony@chromium.org>
2
29
3
        Unreviewed, rolling out r107582.
30
        Unreviewed, rolling out r107582.
- a/Source/WebKit/chromium/ChangeLog +26 lines
Lines 1-3 a/Source/WebKit/chromium/ChangeLog_sec1
1
2012-02-14  Takashi Toyoshima  <toyoshim@chromium.org>
2
3
        [Chromium] [WebSocket] provide a path to bind WebFrameClient and SocketStreamHandle
4
        https://bugs.webkit.org/show_bug.cgi?id=78459
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * public/platform/WebSocketStreamHandle.h: Add setRequestorID and requestorID.
9
        (WebKit::WebSocketStreamHandle::connect):
10
        (WebKit::WebSocketStreamHandle::send):
11
        (WebKit::WebSocketStreamHandle::close):
12
        (WebSocketStreamHandle):
13
        (WebKit::WebSocketStreamHandle::setRequestorID):
14
        (WebKit::WebSocketStreamHandle::requestorID):
15
        * public/WebFrameClient.h: Add willOpenSocketStream declaration.
16
        (WebKit):
17
        (WebFrameClient):
18
        (WebKit::WebFrameClient::willOpenSocketStream):
19
        * src/FrameLoaderClientImpl.cpp: Implement willOpenSocketStream.
20
        (WebKit::FrameLoaderClientImpl::willOpenSocketStream):
21
        (WebKit):
22
        * src/FrameLoaderClientImpl.h: Implement willOpenSocketStream.
23
        (FrameLoaderClientImpl):
24
        * src/SocketStreamHandle.cpp: Call willOpenSocketStream client function.
25
        (WebCore::SocketStreamHandleInternal::connect):
26
1
2012-02-13  Nico Weber  <thakis@chromium.org>
27
2012-02-13  Nico Weber  <thakis@chromium.org>
2
28
3
        [chromium] Let WebKit::initialize call InitWebCoreSystemInterface on mac.
29
        [chromium] Let WebKit::initialize call InitWebCoreSystemInterface on mac.
- a/Source/WebCore/loader/FrameLoader.cpp -1 / +6 lines
Lines 5-11 a/Source/WebCore/loader/FrameLoader.cpp_sec1
5
 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
5
 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6
 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
6
 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7
 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
7
 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8
 * Copyright (C) 2011 Google Inc. All rights reserved.
8
 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
9
 *
9
 *
10
 * Redistribution and use in source and binary forms, with or without
10
 * Redistribution and use in source and binary forms, with or without
11
 * modification, are permitted provided that the following conditions
11
 * modification, are permitted provided that the following conditions
Lines 1416-1421 bool FrameLoader::willLoadMediaElementURL(KURL& url) a/Source/WebCore/loader/FrameLoader.cpp_sec2
1416
    return error.isNull();
1416
    return error.isNull();
1417
}
1417
}
1418
1418
1419
void FrameLoader::willOpenSocketStream(SocketStreamHandle* handle)
1420
{
1421
    m_client->willOpenSocketStream(handle);
1422
}
1423
1419
bool FrameLoader::shouldReloadToHandleUnreachableURL(DocumentLoader* docLoader)
1424
bool FrameLoader::shouldReloadToHandleUnreachableURL(DocumentLoader* docLoader)
1420
{
1425
{
1421
    KURL unreachableURL = docLoader->unreachableURL();
1426
    KURL unreachableURL = docLoader->unreachableURL();
- a/Source/WebCore/loader/FrameLoader.h -1 / +3 lines
Lines 2-8 a/Source/WebCore/loader/FrameLoader.h_sec1
2
 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
2
 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
3
 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
3
 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
4
 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
4
 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
5
 * Copyright (C) 2011 Google Inc. All rights reserved.
5
 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
6
 *
6
 *
7
 * Redistribution and use in source and binary forms, with or without
7
 * Redistribution and use in source and binary forms, with or without
8
 * modification, are permitted provided that the following conditions
8
 * modification, are permitted provided that the following conditions
Lines 69-74 class ResourceRequest; a/Source/WebCore/loader/FrameLoader.h_sec2
69
class ResourceResponse;
69
class ResourceResponse;
70
class SecurityOrigin;
70
class SecurityOrigin;
71
class SerializedScriptValue;
71
class SerializedScriptValue;
72
class SocketStreamHandle;
72
class StringWithDirection;
73
class StringWithDirection;
73
class SubstituteData;
74
class SubstituteData;
74
75
Lines 154-159 public: a/Source/WebCore/loader/FrameLoader.h_sec3
154
    void receivedMainResourceError(const ResourceError&, bool isComplete);
155
    void receivedMainResourceError(const ResourceError&, bool isComplete);
155
156
156
    bool willLoadMediaElementURL(KURL&);
157
    bool willLoadMediaElementURL(KURL&);
158
    void willOpenSocketStream(SocketStreamHandle*);
157
159
158
    void handleFallbackContent();
160
    void handleFallbackContent();
159
161
- a/Source/WebCore/loader/FrameLoaderClient.h +4 lines
Lines 1-5 a/Source/WebCore/loader/FrameLoaderClient.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
2
 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
Lines 95-100 namespace WebCore { a/Source/WebCore/loader/FrameLoaderClient.h_sec2
95
    class ResourceResponse;
96
    class ResourceResponse;
96
    class SecurityOrigin;
97
    class SecurityOrigin;
97
    class SharedBuffer;
98
    class SharedBuffer;
99
    class SocketStreamHandle;
98
    class StringWithDirection;
100
    class StringWithDirection;
99
    class SubstituteData;
101
    class SubstituteData;
100
    class Widget;
102
    class Widget;
Lines 331-336 namespace WebCore { a/Source/WebCore/loader/FrameLoaderClient.h_sec3
331
#if ENABLE(WEB_INTENTS)
333
#if ENABLE(WEB_INTENTS)
332
        virtual void dispatchIntent(PassRefPtr<IntentRequest>) = 0;
334
        virtual void dispatchIntent(PassRefPtr<IntentRequest>) = 0;
333
#endif
335
#endif
336
337
        virtual void willOpenSocketStream(SocketStreamHandle*) { }
334
    };
338
    };
335
339
336
} // namespace WebCore
340
} // namespace WebCore
- a/Source/WebCore/platform/network/SocketStreamHandleClient.h -1 / +2 lines
Lines 1-6 a/Source/WebCore/platform/network/SocketStreamHandleClient.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2009 Apple Inc. All rights reserved.
2
 * Copyright (C) 2009 Apple Inc. All rights reserved.
3
 * Copyright (C) 2009, 2011 Google Inc.  All rights reserved.
3
 * Copyright (C) 2009, 2011, 2012 Google Inc.  All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are
6
 * modification, are permitted provided that the following conditions are
Lines 43-48 namespace WebCore { a/Source/WebCore/platform/network/SocketStreamHandleClient.h_sec2
43
    public:
43
    public:
44
        virtual ~SocketStreamHandleClient() { }
44
        virtual ~SocketStreamHandleClient() { }
45
45
46
        virtual void willOpenSocketStream(SocketStreamHandle*) { }
46
        virtual void didOpenSocketStream(SocketStreamHandle*) { }
47
        virtual void didOpenSocketStream(SocketStreamHandle*) { }
47
        virtual void didCloseSocketStream(SocketStreamHandle*) { }
48
        virtual void didCloseSocketStream(SocketStreamHandle*) { }
48
        virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char* /*data*/, int /*length*/) { }
49
        virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char* /*data*/, int /*length*/) { }
- a/Source/WebCore/platform/network/chromium/SocketStreamHandle.h -1 / +3 lines
Lines 1-6 a/Source/WebCore/platform/network/chromium/SocketStreamHandle.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2009 Apple Inc. All rights reserved.
2
 * Copyright (C) 2009 Apple Inc. All rights reserved.
3
 * Copyright (C) 2009, 2011 Google Inc.  All rights reserved.
3
 * Copyright (C) 2009, 2011, 2012 Google Inc.  All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are
6
 * modification, are permitted provided that the following conditions are
Lines 41-46 namespace WebCore { a/Source/WebCore/platform/network/chromium/SocketStreamHandle.h_sec2
41
41
42
    class AuthenticationChallenge;
42
    class AuthenticationChallenge;
43
    class Credential;
43
    class Credential;
44
    class FrameLoaderClientImpl;
44
    class SocketStreamHandleClient;
45
    class SocketStreamHandleClient;
45
    class SocketStreamHandleInternal;
46
    class SocketStreamHandleInternal;
46
47
Lines 65-70 namespace WebCore { a/Source/WebCore/platform/network/chromium/SocketStreamHandle.h_sec3
65
        void receivedCancellation(const AuthenticationChallenge&);
66
        void receivedCancellation(const AuthenticationChallenge&);
66
67
67
        friend class SocketStreamHandleInternal;
68
        friend class SocketStreamHandleInternal;
69
        friend class FrameLoaderClientImpl;
68
        OwnPtr<SocketStreamHandleInternal> m_internal;
70
        OwnPtr<SocketStreamHandleInternal> m_internal;
69
    };
71
    };
70
72
- a/Source/WebCore/websockets/WebSocketChannel.cpp +7 lines
Lines 258-263 void WebSocketChannel::resume() a/Source/WebCore/websockets/WebSocketChannel.cpp_sec1
258
        m_resumeTimer.startOneShot(0);
258
        m_resumeTimer.startOneShot(0);
259
}
259
}
260
260
261
void WebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle)
262
{
263
    LOG(Network, "WebSocketChannel %p willOpensocketStream", this);
264
    ASSERT(handle);
265
    m_document->frame()->loader()->willOpenSocketStream(handle);
266
}
267
261
void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
268
void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
262
{
269
{
263
    LOG(Network, "WebSocketChannel %p didOpenSocketStream", this);
270
    LOG(Network, "WebSocketChannel %p didOpenSocketStream", this);
- a/Source/WebCore/websockets/WebSocketChannel.h +1 lines
Lines 80-85 public: a/Source/WebCore/websockets/WebSocketChannel.h_sec1
80
    virtual void resume() OVERRIDE;
80
    virtual void resume() OVERRIDE;
81
81
82
    // SocketStreamHandleClient functions.
82
    // SocketStreamHandleClient functions.
83
    virtual void willOpenSocketStream(SocketStreamHandle*) OVERRIDE;
83
    virtual void didOpenSocketStream(SocketStreamHandle*) OVERRIDE;
84
    virtual void didOpenSocketStream(SocketStreamHandle*) OVERRIDE;
84
    virtual void didCloseSocketStream(SocketStreamHandle*) OVERRIDE;
85
    virtual void didCloseSocketStream(SocketStreamHandle*) OVERRIDE;
85
    virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, int) OVERRIDE;
86
    virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, int) OVERRIDE;
- a/Source/WebKit/chromium/public/WebFrameClient.h -2 / +8 lines
Lines 1-5 a/Source/WebKit/chromium/public/WebFrameClient.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
2
 * Copyright (C) 2011, 2012 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
Lines 63-68 class WebMediaPlayerClient; a/Source/WebKit/chromium/public/WebFrameClient.h_sec2
63
class WebNode;
63
class WebNode;
64
class WebPlugin;
64
class WebPlugin;
65
class WebSharedWorker;
65
class WebSharedWorker;
66
class WebSharedWorkerClient;
67
class WebSocketStreamHandle;
66
class WebStorageQuotaCallbacks;
68
class WebStorageQuotaCallbacks;
67
class WebString;
69
class WebString;
68
class WebURL;
70
class WebURL;
Lines 70-76 class WebURLLoader; a/Source/WebKit/chromium/public/WebFrameClient.h_sec3
70
class WebURLRequest;
72
class WebURLRequest;
71
class WebURLResponse;
73
class WebURLResponse;
72
class WebWorker;
74
class WebWorker;
73
class WebSharedWorkerClient;
74
struct WebPluginParams;
75
struct WebPluginParams;
75
struct WebRect;
76
struct WebRect;
76
struct WebSize;
77
struct WebSize;
Lines 385-390 public: a/Source/WebKit/chromium/public/WebFrameClient.h_sec4
385
    // object to coordinate replies to the intent invocation.
386
    // object to coordinate replies to the intent invocation.
386
    virtual void dispatchIntent(WebFrame*, const WebIntentRequest&) { }
387
    virtual void dispatchIntent(WebFrame*, const WebIntentRequest&) { }
387
388
389
    // WebSocket -----------------------------------------------------
390
391
    // A WebSocket object is going to open new stream connection.
392
    virtual void willOpenSocketStream(WebSocketStreamHandle*) { }
393
388
    // Messages ------------------------------------------------------
394
    // Messages ------------------------------------------------------
389
395
390
    // Notifies the embedder that a postMessage was issued on this frame, and
396
    // Notifies the embedder that a postMessage was issued on this frame, and
- a/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h -3 / +9 lines
Lines 44-56 public: a/Source/WebKit/chromium/public/platform/WebSocketStreamHandle.h_sec1
44
    virtual ~WebSocketStreamHandle() { }
44
    virtual ~WebSocketStreamHandle() { }
45
45
46
    // Connect new socket stream asynchronously.
46
    // Connect new socket stream asynchronously.
47
    virtual void connect(const WebURL&, WebSocketStreamHandleClient*) = 0;
47
    virtual void connect(const WebURL&, WebSocketStreamHandleClient*) { }
48
48
49
    // Send web socket frame data on the socket stream.
49
    // Send web socket frame data on the socket stream.
50
    virtual bool send(const WebData&) = 0;
50
    virtual bool send(const WebData&) { return false; }
51
51
52
    // Close the socket stream.
52
    // Close the socket stream.
53
    virtual void close() = 0;
53
    virtual void close() { }
54
55
    // Set requestor ID binded to RenderView.
56
    virtual void setRequestorID(int) { }
57
58
    // Get requestor ID binded to RenderView.
59
    virtual int requestorID() { return 0; }
54
};
60
};
55
61
56
} // namespace WebKit
62
} // namespace WebKit
- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp -1 / +8 lines
Lines 1-5 a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp_sec1
1
/*
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
2
 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3
 * Copyright (C) 2011 Apple Inc. All rights reserved.
3
 * Copyright (C) 2011 Apple Inc. All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
Lines 59-64 a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp_sec2
59
#include "ResourceHandleInternal.h"
59
#include "ResourceHandleInternal.h"
60
#include "ResourceLoader.h"
60
#include "ResourceLoader.h"
61
#include "Settings.h"
61
#include "Settings.h"
62
#include "SocketStreamHandleInternal.h"
62
#include "StringExtras.h"
63
#include "StringExtras.h"
63
#include "WebDOMEvent.h"
64
#include "WebDOMEvent.h"
64
#include "WebDataSourceImpl.h"
65
#include "WebDataSourceImpl.h"
Lines 78-83 a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp_sec3
78
#include "WebPluginLoadObserver.h"
79
#include "WebPluginLoadObserver.h"
79
#include "WebPluginParams.h"
80
#include "WebPluginParams.h"
80
#include "WebSecurityOrigin.h"
81
#include "WebSecurityOrigin.h"
82
#include "platform/WebSocketStreamHandle.h"
81
#include "platform/WebURL.h"
83
#include "platform/WebURL.h"
82
#include "platform/WebURLError.h"
84
#include "platform/WebURLError.h"
83
#include "platform/WebVector.h"
85
#include "platform/WebVector.h"
Lines 1638-1641 void FrameLoaderClientImpl::dispatchIntent(PassRefPtr<WebCore::IntentRequest> in a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp_sec4
1638
}
1640
}
1639
#endif
1641
#endif
1640
1642
1643
void FrameLoaderClientImpl::willOpenSocketStream(SocketStreamHandle* handle)
1644
{
1645
    m_webFrame->client()->willOpenSocketStream(SocketStreamHandleInternal::toWebSocketStreamHandle(handle));
1646
}
1647
1641
} // namespace WebKit
1648
} // namespace WebKit
- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +2 lines
Lines 212-217 public: a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h_sec1
212
    virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE;
212
    virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE;
213
#endif
213
#endif
214
214
215
    virtual void willOpenSocketStream(WebCore::SocketStreamHandle*) OVERRIDE;
216
215
private:
217
private:
216
    void makeDocumentView();
218
    void makeDocumentView();
217
219
- a/Source/WebKit/chromium/src/SocketStreamHandle.cpp +3 lines
Lines 92-97 void SocketStreamHandleInternal::connect(const KURL& url) a/Source/WebKit/chromium/src/SocketStreamHandle.cpp_sec1
92
    m_socket = adoptPtr(webKitPlatformSupport()->createSocketStreamHandle());
92
    m_socket = adoptPtr(webKitPlatformSupport()->createSocketStreamHandle());
93
    LOG(Network, "connect");
93
    LOG(Network, "connect");
94
    ASSERT(m_socket);
94
    ASSERT(m_socket);
95
    ASSERT(m_handle);
96
    if (m_handle->m_client)
97
        m_handle->m_client->willOpenSocketStream(m_handle);
95
    m_socket->connect(url, this);
98
    m_socket->connect(url, this);
96
}
99
}
97
100

Return to Bug 78459