| Differences between
and this patch
- a/Source/Platform/ChangeLog +35 lines
Lines 1-3 a/Source/Platform/ChangeLog_sec1
1
2012-04-27  Gavin Peters  <gavinp@chromium.org>
2
3
        Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering.
4
        https://bugs.webkit.org/show_bug.cgi?id=85005
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The prerender case isn't quite a resource load, and using resource loading to
9
        retrieve them has constrained the API, and unnecessarily complicated the loader.
10
11
        The new Prerenderer and PrerenderHandle let <link rel=prerender...> elements signal
12
        removal and unload to their platform.
13
14
        * Platform.gypi:
15
        * chromium/public/Platform.h:
16
        (WebKit):
17
        (Platform):
18
        (WebKit::Platform::createPrerenderingPlatform):
19
        * chromium/public/WebPrerender.h: Copied from Source/WebCore/html/LinkRelAttribute.h.
20
        (WebCore):
21
        (WebKit):
22
        (WebPrerender):
23
        (ExtraData):
24
        (WebKit::WebPrerender::ExtraData::~ExtraData):
25
        * chromium/public/WebPrerenderingPlatform.h: Copied from Source/WebCore/loader/LinkLoader.h.
26
        (WebKit):
27
        (WebPrerenderingPlatform):
28
        (WebKit::WebPrerenderingPlatform::~WebPrerenderingPlatform):
29
        (WebKit::WebPrerenderingPlatform::WebPrerenderingPlatform):
30
        * chromium/public/WebURLRequest.h:
31
        * chromium/src/WebPrerenderingPlatform.cpp: Copied from Source/WebCore/html/LinkRelAttribute.h.
32
        (WebKit):
33
        (WebKit::WebPrerenderingPlatform::setPlatform):
34
        (WebKit::WebPrerenderingPlatform::getPlatform):
35
1
2012-04-25  Dana Jansens  <danakj@chromium.org>
36
2012-04-25  Dana Jansens  <danakj@chromium.org>
2
37
3
        [chromium] Remove guarded virtual methods from WebFilterOperation API
38
        [chromium] Remove guarded virtual methods from WebFilterOperation API
- a/Source/WebCore/ChangeLog +126 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-04-27  Gavin Peters  <gavinp@chromium.org>
2
3
        Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering.
4
        https://bugs.webkit.org/show_bug.cgi?id=85005
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The prerender case isn't quite a resource load, and using resource loading to
9
        retrieve them has constrained the API, and unnecessarily complicated the loader.
10
11
        The new Prerenderer and PrerenderHandle let <link rel=prerender...> elements signal
12
        removal and unload to their platform.
13
14
        No new tests, as this interface requires a full platform to work, and doesn't affect layout.  Test
15
        it with your platform when implemented for it.
16
17
        * GNUmakefile.list.am:
18
        * Target.pri:
19
        * WebCore.gypi:
20
        * WebCore.vcproj/WebCore.vcproj:
21
        * WebCore.xcodeproj/project.pbxproj:
22
        * dom/Document.cpp:
23
        (WebCore::Document::Document):
24
        * dom/Document.h:
25
        (WebCore):
26
        (Document):
27
        (WebCore::Document::prerenderer):
28
        * html/HTMLLinkElement.cpp:
29
        (WebCore::HTMLLinkElement::removedFrom):
30
        * html/LinkRelAttribute.cpp:
31
        (WebCore::LinkRelAttribute::LinkRelAttribute):
32
        * html/LinkRelAttribute.h:
33
        (LinkRelAttribute):
34
        * loader/LinkLoader.cpp:
35
        (WebCore::LinkLoader::loadLink):
36
        (WebCore::LinkLoader::released):
37
        * loader/LinkLoader.h:
38
        (WebCore):
39
        (LinkLoader):
40
        * loader/Prerenderer.cpp: Added.
41
        (WebCore):
42
        (WebCore::Prerenderer::create):
43
        (WebCore::Prerenderer::Prerenderer):
44
        (WebCore::Prerenderer::~Prerenderer):
45
        (WebCore::Prerenderer::render):
46
        (WebCore::Prerenderer::stop):
47
        (WebCore::Prerenderer::suspend):
48
        (WebCore::Prerenderer::resume):
49
        (WebCore::Prerenderer::document):
50
        (WebCore::Prerenderer::client):
51
        * loader/Prerenderer.h: Copied from Source/WebCore/loader/LinkLoader.h.
52
        (WebCore):
53
        (Prerenderer):
54
        * loader/PrerendererClient.cpp: Copied from Source/WebCore/html/LinkRelAttribute.h.
55
        (WebCore):
56
        (WebCore::PrerendererClient::supplementName):
57
        (WebCore::PrerendererClient::from):
58
        (WebCore::providePrerendererClientTo):
59
        * loader/PrerendererClient.h: Copied from Source/WebCore/html/LinkRelAttribute.h.
60
        (WebCore):
61
        (PrerendererClient):
62
        (WebCore::PrerendererClient::~PrerendererClient):
63
        (WebCore::PrerendererClient::PrerendererClient):
64
        * loader/cache/CachedResource.cpp:
65
        (WebCore::defaultPriorityForResourceType):
66
        (WebCore::cachedResourceTypeToTargetType):
67
        (WebCore::CachedResource::load):
68
        * loader/cache/CachedResource.h:
69
        (WebCore::CachedResource::ignoreForRequestCount):
70
        * loader/cache/CachedResourceLoader.cpp:
71
        (WebCore::createResource):
72
        (WebCore::CachedResourceLoader::requestLinkResource):
73
        (WebCore::CachedResourceLoader::checkInsecureContent):
74
        (WebCore::CachedResourceLoader::canRequest):
75
        * platform/PrerenderHandle.h: Copied from Source/WebCore/loader/LinkLoader.h.
76
        (WebCore):
77
        (PrerenderHandle):
78
        * platform/chromium/Prerender.cpp: Added.
79
        (WebCore):
80
        (WebCore::Prerender::Prerender):
81
        (WebCore::Prerender::~Prerender):
82
        (WebCore::Prerender::setState):
83
        (WebCore::Prerender::add):
84
        (WebCore::Prerender::cancel):
85
        (WebCore::Prerender::abandon):
86
        (WebCore::Prerender::suspend):
87
        (WebCore::Prerender::resume):
88
        * platform/chromium/Prerender.h: Copied from Source/WebCore/loader/LinkLoader.h.
89
        (WebKit):
90
        (WebCore):
91
        (Prerender):
92
        (ExtraData):
93
        (WebCore::Prerender::ExtraData::~ExtraData):
94
        (WebCore::Prerender::url):
95
        (WebCore::Prerender::referrer):
96
        (WebCore::Prerender::referrerPolicy):
97
        (WebCore::Prerender::setExtraData):
98
        (WebCore::Prerender::extraData):
99
        * platform/chromium/PrerenderHandle.cpp: Copied from Source/WebCore/loader/LinkLoader.h.
100
        (WebCore):
101
        (WebCore::PrerenderHandle::create):
102
        (WebCore::PrerenderHandle::PrerenderHandle):
103
        (WebCore::PrerenderHandle::~PrerenderHandle):
104
        (WebCore::PrerenderHandle::prerender):
105
        (WebCore::PrerenderHandle::add):
106
        (WebCore::PrerenderHandle::cancel):
107
        (WebCore::PrerenderHandle::abandon):
108
        (WebCore::PrerenderHandle::suspend):
109
        (WebCore::PrerenderHandle::resume):
110
        (WebCore::PrerenderHandle::url):
111
        (WebCore::PrerenderHandle::referrer):
112
        (WebCore::PrerenderHandle::referrerPolicy):
113
        * platform/chromium/support/WebPrerender.cpp: Added.
114
        (WebKit::WebPrerender::WebPrerender):
115
        (WebKit):
116
        (WebKit::WebPrerender::~WebPrerender):
117
        (WebKit::WebPrerender::url):
118
        (WebKit::WebPrerender::referrer):
119
        (WebKit::WebPrerender::referrerPolicy):
120
        (WebKit::WebPrerender::setExtraData):
121
        (WebKit::WebPrerender::extraData):
122
        * platform/network/blackberry/ResourceRequest.h:
123
        * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
124
        (WebCore::platformTargetTypeForRequest):
125
        * platform/network/chromium/ResourceRequest.h:
126
1
2012-04-26  Ryosuke Niwa  <rniwa@webkit.org>
127
2012-04-26  Ryosuke Niwa  <rniwa@webkit.org>
2
128
3
        REGRESSION (r94497): Pressing Command+A when inline (Marked Text) is not empty will clean whole content
129
        REGRESSION (r94497): Pressing Command+A when inline (Marked Text) is not empty will clean whole content
- a/Source/WebKit/chromium/ChangeLog +35 lines
Lines 1-3 a/Source/WebKit/chromium/ChangeLog_sec1
1
2012-04-27  Gavin Peters  <gavinp@chromium.org>
2
3
        Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering.
4
        https://bugs.webkit.org/show_bug.cgi?id=85005
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The prerender case isn't quite a resource load, and using resource loading to
9
        retrieve them has constrained the API, and unnecessarily complicated the loader.
10
11
        The new Prerenderer and PrerenderHandle let <link rel=prerender...> elements signal
12
        removal and unload to their platform.
13
14
        * DEPS:
15
        * WebKit.gyp:
16
        * public/WebPrerendererClient.h: Copied from Source/WebCore/html/LinkRelAttribute.h.
17
        (WebKit):
18
        (WebPrerendererClient):
19
        * public/WebView.h:
20
        (WebKit):
21
        * src/PrerendererClientImpl.cpp: Copied from Source/WebCore/html/LinkRelAttribute.h.
22
        (WebKit):
23
        (WebKit::PrerendererClientImpl::PrerendererClientImpl):
24
        (WebKit::PrerendererClientImpl::willAddPrerender):
25
        * src/PrerendererClientImpl.h: Copied from Source/WebCore/html/LinkRelAttribute.h.
26
        (WebCore):
27
        (WebKit):
28
        (PrerendererClientImpl):
29
        * src/WebViewImpl.cpp:
30
        (WebKit::WebViewImpl::setPrerendererClient):
31
        (WebKit):
32
        * src/WebViewImpl.h:
33
        (WebKit):
34
        (WebViewImpl):
35
1
2012-04-24  James Robinson  <jamesr@chromium.org>
36
2012-04-24  James Robinson  <jamesr@chromium.org>
2
37
3
        [chromium] Move ProgramBinding definitions to LayerRendererChromium and normalize naming
38
        [chromium] Move ProgramBinding definitions to LayerRendererChromium and normalize naming
- a/Source/Platform/Platform.gypi +4 lines
Lines 72-77 a/Source/Platform/Platform.gypi_sec1
72
            'chromium/public/WebPeerConnectionHandler.h',
72
            'chromium/public/WebPeerConnectionHandler.h',
73
            'chromium/public/WebPeerConnectionHandlerClient.h',
73
            'chromium/public/WebPeerConnectionHandlerClient.h',
74
            'chromium/public/WebPoint.h',
74
            'chromium/public/WebPoint.h',
75
            'chromium/public/WebPrerender.h',
76
            'chromium/public/WebPrerenderingPlatform.h',
75
            'chromium/public/WebPrivateOwnPtr.h',
77
            'chromium/public/WebPrivateOwnPtr.h',
76
            'chromium/public/WebPrivatePtr.h',
78
            'chromium/public/WebPrivatePtr.h',
77
            'chromium/public/WebRect.h',
79
            'chromium/public/WebRect.h',
Lines 85-90 a/Source/Platform/Platform.gypi_sec2
85
            'chromium/public/WebString.h',
87
            'chromium/public/WebString.h',
86
            'chromium/public/WebThread.h',
88
            'chromium/public/WebThread.h',
87
            'chromium/public/WebThreadSafeData.h',
89
            'chromium/public/WebThreadSafeData.h',
90
            'chromium/public/WebPrerender.h',
88
            'chromium/public/WebURL.h',
91
            'chromium/public/WebURL.h',
89
            'chromium/public/WebURLError.h',
92
            'chromium/public/WebURLError.h',
90
            'chromium/public/WebURLLoadTiming.h',
93
            'chromium/public/WebURLLoadTiming.h',
Lines 98-103 a/Source/Platform/Platform.gypi_sec3
98
            'chromium/src/Platform.cpp',
101
            'chromium/src/Platform.cpp',
99
            'chromium/src/WebCString.cpp',
102
            'chromium/src/WebCString.cpp',
100
            'chromium/src/WebFloatQuad.cpp',
103
            'chromium/src/WebFloatQuad.cpp',
104
            'chromium/src/WebPrerenderingPlatform.cpp',
101
            'chromium/src/WebString.cpp',
105
            'chromium/src/WebString.cpp',
102
            'chromium/src/WebVideoFrame.cpp',
106
            'chromium/src/WebVideoFrame.cpp',
103
        ]
107
        ]
- a/Source/Platform/chromium/public/Platform.h +3 lines
Lines 49-54 class WebPeerConnectionHandler; a/Source/Platform/chromium/public/Platform.h_sec1
49
class WebPeerConnectionHandlerClient;
49
class WebPeerConnectionHandlerClient;
50
class WebURL;
50
class WebURL;
51
class WebURLLoader;
51
class WebURLLoader;
52
class WebPrerenderingPlatform;
52
class WebSocketStreamHandle;
53
class WebSocketStreamHandle;
53
class WebThread;
54
class WebThread;
54
55
Lines 283-288 public: a/Source/Platform/chromium/public/Platform.h_sec2
283
    // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value.
284
    // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value.
284
    virtual void histogramEnumeration(const char* name, int sample, int boundaryValue) { }
285
    virtual void histogramEnumeration(const char* name, int sample, int boundaryValue) { }
285
286
287
    // Prerender
288
    virtual WebPrerenderingPlatform* createPrerenderingPlatform() { return 0; }
286
289
287
    // WebRTC ----------------------------------------------------------
290
    // WebRTC ----------------------------------------------------------
288
291
- a/Source/Platform/chromium/public/WebPrerender.h +79 lines
Line 0 a/Source/Platform/chromium/public/WebPrerender.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef WebPrerender_h
32
#define WebPrerender_h
33
34
#include "WebCommon.h"
35
#include "WebPrivatePtr.h"
36
#include "WebReferrerPolicy.h"
37
#include "WebString.h"
38
#include "WebURL.h"
39
40
#if WEBKIT_IMPLEMENTATION
41
#include <wtf/PassRefPtr.h>
42
#endif
43
44
namespace WebCore {
45
class Prerender;
46
}
47
48
namespace WebKit {
49
50
struct WebSize;
51
52
class WebPrerender {
53
public:
54
    class ExtraData {
55
    public:
56
        virtual ~ExtraData() { }
57
    };
58
59
#if WEBKIT_IMPLEMENTATION
60
    explicit WebPrerender(PassRefPtr<WebCore::Prerender>);
61
    ~WebPrerender();
62
#endif
63
64
    WEBKIT_EXPORT WebURL url() const;
65
    WEBKIT_EXPORT WebString referrer() const;
66
    WEBKIT_EXPORT WebReferrerPolicy referrerPolicy() const;
67
68
    WEBKIT_EXPORT void setExtraData(ExtraData*);
69
    WEBKIT_EXPORT const ExtraData* extraData() const;
70
71
private:
72
    WebPrerender();
73
74
    WebPrivatePtr<WebCore::Prerender> m_private;
75
};
76
77
} // namespace WebKit
78
79
#endif // WebPrerender_h
- a/Source/Platform/chromium/public/WebPrerenderingPlatform.h +67 lines
Line 0 a/Source/Platform/chromium/public/WebPrerenderingPlatform.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef WebPrerenderingPlatform_h
32
#define WebPrerenderingPlatform_h
33
34
#include "WebCommon.h"
35
36
namespace WebKit {
37
38
class WebPrerender;
39
40
class WebPrerenderingPlatform {
41
public:
42
    virtual ~WebPrerenderingPlatform() { }
43
44
    // A prerender link element is added when it is inserted into a document.
45
    virtual void add(const WebPrerender&) = 0;
46
47
    // A prerender is abandoned when it's navigated away from or suspended in the page cache. This
48
    // is a weaker signal than cancel(), since the launcher hasn't indicated that the prerender isn't
49
    // wanted, and we may end up using it after, for instance, a short redirect chain.
50
    virtual void cancel(const WebPrerender&) = 0;
51
52
    // A prerender is canceled when it is removed from a document.
53
    virtual void abandon(const WebPrerender&) = 0;
54
55
    WEBKIT_EXPORT static void setPlatform(WebPrerenderingPlatform*);
56
    WEBKIT_EXPORT static WebPrerenderingPlatform* getPlatform();
57
58
protected:
59
    WebPrerenderingPlatform() { }
60
61
private:
62
    static WebPrerenderingPlatform* s_platform;
63
};
64
65
} // namespace WebKit
66
67
#endif // WebPrerenderingPlatform_h
- a/Source/Platform/chromium/public/WebURLRequest.h -5 / +7 lines
Lines 69-79 public: a/Source/Platform/chromium/public/WebURLRequest.h_sec1
69
        TargetIsWorker = 9,
69
        TargetIsWorker = 9,
70
        TargetIsSharedWorker = 10,
70
        TargetIsSharedWorker = 10,
71
        TargetIsPrefetch = 11,
71
        TargetIsPrefetch = 11,
72
        TargetIsPrerender = 12,
72
        TargetIsFavicon = 12,
73
        TargetIsFavicon = 13,
73
        TargetIsXHR = 13,
74
        TargetIsXHR = 14,
74
        TargetIsTextTrack = 14,
75
        TargetIsTextTrack = 15,
75
        TargetIsUnspecified = 15,
76
        TargetIsUnspecified = 16,
76
        // FIXME: This old enum value is only being left in while prerendering is staging into chromium. After http://codereview.chromium.org/10244007/
77
        // lands, this should be removed.
78
        TargetIsPrerender = TargetIsUnspecified,
77
    };
79
    };
78
80
79
    class ExtraData {
81
    class ExtraData {
- a/Source/Platform/chromium/src/WebPrerenderingPlatform.cpp +47 lines
Line 0 a/Source/Platform/chromium/src/WebPrerenderingPlatform.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include <public/WebPrerenderingPlatform.h>
32
33
namespace WebKit {
34
35
WebPrerenderingPlatform* WebPrerenderingPlatform::s_platform = 0;
36
37
void WebPrerenderingPlatform::setPlatform(WebPrerenderingPlatform* platform)
38
{
39
    s_platform = platform;
40
}
41
42
WebPrerenderingPlatform* WebPrerenderingPlatform::getPlatform()
43
{
44
    return s_platform;
45
}
46
47
}
- a/Source/WebCore/GNUmakefile.list.am +5 lines
Lines 2841-2846 webcore_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec1
2841
	Source/WebCore/loader/PolicyCallback.h \
2841
	Source/WebCore/loader/PolicyCallback.h \
2842
	Source/WebCore/loader/PolicyChecker.cpp \
2842
	Source/WebCore/loader/PolicyChecker.cpp \
2843
	Source/WebCore/loader/PolicyChecker.h \
2843
	Source/WebCore/loader/PolicyChecker.h \
2844
	Source/WebCore/loader/Prerenderer.cpp \
2845
	Source/WebCore/loader/Prerenderer.h \
2846
	Source/WebCore/loader/PrerendererClient.cpp \
2847
	Source/WebCore/loader/PrerendererClient.h \
2844
	Source/WebCore/loader/ProgressTracker.cpp \
2848
	Source/WebCore/loader/ProgressTracker.cpp \
2845
	Source/WebCore/loader/ProgressTracker.h \
2849
	Source/WebCore/loader/ProgressTracker.h \
2846
	Source/WebCore/loader/NavigationScheduler.cpp \
2850
	Source/WebCore/loader/NavigationScheduler.cpp \
Lines 3533-3538 webcore_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec2
3533
	Source/WebCore/platform/PopupMenuClient.h \
3537
	Source/WebCore/platform/PopupMenuClient.h \
3534
	Source/WebCore/platform/PopupMenu.h \
3538
	Source/WebCore/platform/PopupMenu.h \
3535
	Source/WebCore/platform/PopupMenuStyle.h \
3539
	Source/WebCore/platform/PopupMenuStyle.h \
3540
	Source/WebCore/platform/PrerenderHandle.h \
3536
	Source/WebCore/platform/PurgeableBuffer.h \
3541
	Source/WebCore/platform/PurgeableBuffer.h \
3537
	Source/WebCore/platform/PurgePriority.h \
3542
	Source/WebCore/platform/PurgePriority.h \
3538
	Source/WebCore/platform/ReferrerPolicy.h \
3543
	Source/WebCore/platform/ReferrerPolicy.h \
- a/Source/WebCore/Target.pri +5 lines
Lines 976-981 SOURCES += \ a/Source/WebCore/Target.pri_sec1
976
    loader/PolicyCallback.cpp \
976
    loader/PolicyCallback.cpp \
977
    loader/PolicyChecker.cpp \
977
    loader/PolicyChecker.cpp \
978
    loader/ProgressTracker.cpp \
978
    loader/ProgressTracker.cpp \
979
    loader/Prerenderer.cpp \
980
    loader/PrerendererClient.cpp \
979
    loader/NavigationScheduler.cpp \
981
    loader/NavigationScheduler.cpp \
980
    loader/ResourceLoader.cpp \
982
    loader/ResourceLoader.cpp \
981
    loader/ResourceLoadNotifier.cpp \
983
    loader/ResourceLoadNotifier.cpp \
Lines 2096-2101 HEADERS += \ a/Source/WebCore/Target.pri_sec2
2096
    loader/NavigationAction.h \
2098
    loader/NavigationAction.h \
2097
    loader/NetscapePlugInStreamLoader.h \
2099
    loader/NetscapePlugInStreamLoader.h \
2098
    loader/PlaceholderDocument.h \
2100
    loader/PlaceholderDocument.h \
2101
    loader/Prerenderer.h \
2102
    loader/PrerendererClient.h \
2099
    loader/ProgressTracker.h \
2103
    loader/ProgressTracker.h \
2100
    loader/ResourceLoader.h \
2104
    loader/ResourceLoader.h \
2101
    loader/SubresourceLoader.h \
2105
    loader/SubresourceLoader.h \
Lines 2380-2385 HEADERS += \ a/Source/WebCore/Target.pri_sec3
2380
    platform/Timer.h \
2384
    platform/Timer.h \
2381
    platform/Widget.h \
2385
    platform/Widget.h \
2382
    platform/PlatformStrategies.h \
2386
    platform/PlatformStrategies.h \
2387
    platform/PrerenderHandle.h \
2383
    platform/LocalizedStrings.h \
2388
    platform/LocalizedStrings.h \
2384
    plugins/DOMMimeTypeArray.h \
2389
    plugins/DOMMimeTypeArray.h \
2385
    plugins/DOMMimeType.h \
2390
    plugins/DOMMimeType.h \
- a/Source/WebCore/WebCore.gypi +9 lines
Lines 2855-2860 a/Source/WebCore/WebCore.gypi_sec1
2855
            'loader/PlaceholderDocument.h',
2855
            'loader/PlaceholderDocument.h',
2856
            'loader/PolicyCallback.cpp',
2856
            'loader/PolicyCallback.cpp',
2857
            'loader/PolicyChecker.cpp',
2857
            'loader/PolicyChecker.cpp',
2858
            'loader/Prerenderer.cpp',
2859
            'loader/Prerenderer.h',
2860
            'loader/PrerendererClient.cpp',
2861
            'loader/PrerendererClient.h',
2858
            'loader/ProgressTracker.cpp',
2862
            'loader/ProgressTracker.cpp',
2859
            'loader/ResourceLoadNotifier.cpp',
2863
            'loader/ResourceLoadNotifier.cpp',
2860
            'loader/ResourceLoadScheduler.cpp',
2864
            'loader/ResourceLoadScheduler.cpp',
Lines 3138-3143 a/Source/WebCore/WebCore.gypi_sec2
3138
            'platform/PlatformStrategies.cpp',
3142
            'platform/PlatformStrategies.cpp',
3139
            'platform/PlatformTouchEvent.h',
3143
            'platform/PlatformTouchEvent.h',
3140
            'platform/PlatformTouchPoint.h',
3144
            'platform/PlatformTouchPoint.h',
3145
            'platform/PrerenderHandle.h',
3141
            'platform/PurgeableBuffer.h',
3146
            'platform/PurgeableBuffer.h',
3142
            'platform/ReferrerPolicy.h',
3147
            'platform/ReferrerPolicy.h',
3143
            'platform/RunLoopTimer.h',
3148
            'platform/RunLoopTimer.h',
Lines 3316-3321 a/Source/WebCore/WebCore.gypi_sec3
3316
            'platform/chromium/PopupListBox.cpp',
3321
            'platform/chromium/PopupListBox.cpp',
3317
            'platform/chromium/PopupListBox.h',
3322
            'platform/chromium/PopupListBox.h',
3318
            'platform/chromium/PopupMenuPrivate.h',
3323
            'platform/chromium/PopupMenuPrivate.h',
3324
            'platform/chromium/Prerender.cpp',
3325
            'platform/chromium/Prerender.h',
3326
            'platform/chromium/PrerenderHandle.cpp',
3319
            'platform/chromium/SSLKeyGeneratorChromium.cpp',
3327
            'platform/chromium/SSLKeyGeneratorChromium.cpp',
3320
            'platform/chromium/ScrollbarThemeChromium.cpp',
3328
            'platform/chromium/ScrollbarThemeChromium.cpp',
3321
            'platform/chromium/ScrollbarThemeChromium.h',
3329
            'platform/chromium/ScrollbarThemeChromium.h',
Lines 8254-8259 a/Source/WebCore/WebCore.gypi_sec4
8254
            'platform/chromium/support/WebMediaStreamDescriptor.cpp',
8262
            'platform/chromium/support/WebMediaStreamDescriptor.cpp',
8255
            'platform/chromium/support/WebMediaStreamSource.cpp',
8263
            'platform/chromium/support/WebMediaStreamSource.cpp',
8256
            'platform/chromium/support/WebMediaStreamSourcesRequest.cpp',
8264
            'platform/chromium/support/WebMediaStreamSourcesRequest.cpp',
8265
            'platform/chromium/support/WebPrerender.cpp',
8257
            'platform/chromium/support/WebThreadSafeData.cpp',
8266
            'platform/chromium/support/WebThreadSafeData.cpp',
8258
            'platform/chromium/support/WebURL.cpp',
8267
            'platform/chromium/support/WebURL.cpp',
8259
            'platform/chromium/support/WebURLError.cpp',
8268
            'platform/chromium/support/WebURLError.cpp',
- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj +20 lines
Lines 26938-26943 a/Source/WebCore/WebCore.vcproj/WebCore.vcproj_sec1
26938
				>
26938
				>
26939
			</File>
26939
			</File>
26940
			<File
26940
			<File
26941
				RelativePath="..\loader\Prerenderer.cpp"
26942
				>
26943
			</File>
26944
			<File
26945
				RelativePath="..\loader\Prerenderer.h"
26946
				>
26947
			</File>
26948
			<File
26949
				RelativePath="..\loader\PrerendererClient.cpp"
26950
				>
26951
			</File>
26952
			<File
26953
				RelativePath="..\loader\PrerendererClient.h"
26954
				>
26955
			</File>
26956
			<File
26941
				RelativePath="..\loader\ProgressTracker.cpp"
26957
				RelativePath="..\loader\ProgressTracker.cpp"
26942
				>
26958
				>
26943
			</File>
26959
			</File>
Lines 27814-27819 a/Source/WebCore/WebCore.vcproj/WebCore.vcproj_sec2
27814
				>
27830
				>
27815
			</File>
27831
			</File>
27816
			<File
27832
			<File
27833
				RelativePath="..\platform\PrerenderHandle.h"
27834
				>
27835
			</File>
27836
			<File
27817
				RelativePath="..\platform\PurgeableBuffer.h"
27837
				RelativePath="..\platform\PurgeableBuffer.h"
27818
				>
27838
				>
27819
			</File>
27839
			</File>
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +20 lines
Lines 3598-3603 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
3598
		97F8E666151D4A4E00D2D181 /* WorkerContextNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F8E662151D4A3F00D2D181 /* WorkerContextNotifications.h */; };
3598
		97F8E666151D4A4E00D2D181 /* WorkerContextNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F8E662151D4A3F00D2D181 /* WorkerContextNotifications.h */; };
3599
		9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9831AE49154225A200FE2644 /* ReferrerPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
3599
		9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9831AE49154225A200FE2644 /* ReferrerPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
3600
		984264F112D5280A000D88A4 /* LinkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */; };
3600
		984264F112D5280A000D88A4 /* LinkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */; };
3601
		9856F8CC1549E82400B04F3A /* Prerenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9856F8C81549E82400B04F3A /* Prerenderer.cpp */; };
3602
		9856F8CD1549E82400B04F3A /* Prerenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9856F8C91549E82400B04F3A /* Prerenderer.h */; };
3603
		9856F8CE1549E82400B04F3A /* PrerendererClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9856F8CA1549E82400B04F3A /* PrerendererClient.cpp */; };
3604
		9856F8CF1549E82400B04F3A /* PrerendererClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 9856F8CB1549E82400B04F3A /* PrerendererClient.h */; };
3605
		9856F8D11549E84F00B04F3A /* PrerenderHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9856F8D01549E84F00B04F3A /* PrerenderHandle.h */; };
3601
		985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */; };
3606
		985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */; };
3602
		985BB96E13A94058007A0B69 /* LinkRelAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 985BB96C13A94058007A0B69 /* LinkRelAttribute.h */; };
3607
		985BB96E13A94058007A0B69 /* LinkRelAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 985BB96C13A94058007A0B69 /* LinkRelAttribute.h */; };
3603
		98CE4326129E00BD005821DC /* LinkLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 98CE4325129E00BD005821DC /* LinkLoader.cpp */; };
3608
		98CE4326129E00BD005821DC /* LinkLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 98CE4325129E00BD005821DC /* LinkLoader.cpp */; };
Lines 10629-10634 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
10629
		97F8E663151D4A3F00D2D181 /* WorkerContextNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WorkerContextNotifications.idl; path = notifications/WorkerContextNotifications.idl; sourceTree = "<group>"; };
10634
		97F8E663151D4A3F00D2D181 /* WorkerContextNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WorkerContextNotifications.idl; path = notifications/WorkerContextNotifications.idl; sourceTree = "<group>"; };
10630
		9831AE49154225A200FE2644 /* ReferrerPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReferrerPolicy.h; sourceTree = "<group>"; };
10635
		9831AE49154225A200FE2644 /* ReferrerPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReferrerPolicy.h; sourceTree = "<group>"; };
10631
		984264EF12D5280A000D88A4 /* LinkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoaderClient.h; sourceTree = "<group>"; };
10636
		984264EF12D5280A000D88A4 /* LinkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoaderClient.h; sourceTree = "<group>"; };
10637
		9856F8C81549E82400B04F3A /* Prerenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Prerenderer.cpp; path = loader/Prerenderer.cpp; sourceTree = SOURCE_ROOT; };
10638
		9856F8C91549E82400B04F3A /* Prerenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prerenderer.h; path = loader/Prerenderer.h; sourceTree = SOURCE_ROOT; };
10639
		9856F8CA1549E82400B04F3A /* PrerendererClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrerendererClient.cpp; path = loader/PrerendererClient.cpp; sourceTree = SOURCE_ROOT; };
10640
		9856F8CB1549E82400B04F3A /* PrerendererClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrerendererClient.h; path = loader/PrerendererClient.h; sourceTree = SOURCE_ROOT; };
10641
		9856F8D01549E84F00B04F3A /* PrerenderHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrerenderHandle.h; sourceTree = "<group>"; };
10632
		985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkRelAttribute.cpp; sourceTree = "<group>"; };
10642
		985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkRelAttribute.cpp; sourceTree = "<group>"; };
10633
		985BB96C13A94058007A0B69 /* LinkRelAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkRelAttribute.h; sourceTree = "<group>"; };
10643
		985BB96C13A94058007A0B69 /* LinkRelAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkRelAttribute.h; sourceTree = "<group>"; };
10634
		98CE4325129E00BD005821DC /* LinkLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkLoader.cpp; sourceTree = "<group>"; };
10644
		98CE4325129E00BD005821DC /* LinkLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkLoader.cpp; sourceTree = "<group>"; };
Lines 14102-14107 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
14102
				1A8F6BB40DB55CDC001DB794 /* ApplicationCacheGroup.h */,
14112
				1A8F6BB40DB55CDC001DB794 /* ApplicationCacheGroup.h */,
14103
				24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */,
14113
				24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */,
14104
				24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */,
14114
				24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */,
14115
				9856F8C81549E82400B04F3A /* Prerenderer.cpp */,
14116
				9856F8C91549E82400B04F3A /* Prerenderer.h */,
14117
				9856F8CA1549E82400B04F3A /* PrerendererClient.cpp */,
14118
				9856F8CB1549E82400B04F3A /* PrerendererClient.h */,
14105
				1A8F6BB50DB55CDC001DB794 /* ApplicationCacheResource.cpp */,
14119
				1A8F6BB50DB55CDC001DB794 /* ApplicationCacheResource.cpp */,
14106
				1A8F6BB60DB55CDC001DB794 /* ApplicationCacheResource.h */,
14120
				1A8F6BB60DB55CDC001DB794 /* ApplicationCacheResource.h */,
14107
				1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */,
14121
				1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */,
Lines 14886-14891 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
14886
				49E912A50EFAC906009D0CAF /* Animation.cpp */,
14900
				49E912A50EFAC906009D0CAF /* Animation.cpp */,
14887
				49E912A60EFAC906009D0CAF /* Animation.h */,
14901
				49E912A60EFAC906009D0CAF /* Animation.h */,
14888
				49E912A70EFAC906009D0CAF /* AnimationList.cpp */,
14902
				49E912A70EFAC906009D0CAF /* AnimationList.cpp */,
14903
				9856F8D01549E84F00B04F3A /* PrerenderHandle.h */,
14889
				49E912A80EFAC906009D0CAF /* AnimationList.h */,
14904
				49E912A80EFAC906009D0CAF /* AnimationList.h */,
14890
				0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */,
14905
				0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */,
14891
				49E912A90EFAC906009D0CAF /* TimingFunction.h */,
14906
				49E912A90EFAC906009D0CAF /* TimingFunction.h */,
Lines 24823-24828 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
24823
				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
24838
				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
24824
				977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
24839
				977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
24825
				FD537353137B651800008DCE /* ZeroPole.h in Headers */,
24840
				FD537353137B651800008DCE /* ZeroPole.h in Headers */,
24841
				9856F8CD1549E82400B04F3A /* Prerenderer.h in Headers */,
24842
				9856F8CF1549E82400B04F3A /* PrerendererClient.h in Headers */,
24843
				9856F8D11549E84F00B04F3A /* PrerenderHandle.h in Headers */,
24826
			);
24844
			);
24827
			runOnlyForDeploymentPostprocessing = 0;
24845
			runOnlyForDeploymentPostprocessing = 0;
24828
		};
24846
		};
Lines 27837-27842 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
27837
				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
27855
				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
27838
				977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
27856
				977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
27839
				FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
27857
				FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
27858
				9856F8CC1549E82400B04F3A /* Prerenderer.cpp in Sources */,
27859
				9856F8CE1549E82400B04F3A /* PrerendererClient.cpp in Sources */,
27840
			);
27860
			);
27841
			runOnlyForDeploymentPostprocessing = 0;
27861
			runOnlyForDeploymentPostprocessing = 0;
27842
		};
27862
		};
- a/Source/WebCore/dom/Document.cpp -1 / +7 lines
Lines 206-211 a/Source/WebCore/dom/Document.cpp_sec1
206
#include "NodeRareData.h"
206
#include "NodeRareData.h"
207
#endif
207
#endif
208
208
209
#if ENABLE(LINK_PRERENDER)
210
#include "Prerenderer.h"
211
#endif
212
209
using namespace std;
213
using namespace std;
210
using namespace WTF;
214
using namespace WTF;
211
using namespace Unicode;
215
using namespace Unicode;
Lines 506-512 Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) a/Source/WebCore/dom/Document.cpp_sec2
506
    m_markers = adoptPtr(new DocumentMarkerController);
510
    m_markers = adoptPtr(new DocumentMarkerController);
507
511
508
    m_cachedResourceLoader = adoptPtr(new CachedResourceLoader(this));
512
    m_cachedResourceLoader = adoptPtr(new CachedResourceLoader(this));
509
513
#if ENABLE(LINK_PRERENDER)
514
    m_prerenderer = Prerenderer::create(this);
515
#endif
510
    m_visuallyOrdered = false;
516
    m_visuallyOrdered = false;
511
    m_bParsing = false;
517
    m_bParsing = false;
512
    m_wellFormed = false;
518
    m_wellFormed = false;
- a/Source/WebCore/dom/Document.h +13 lines
Lines 166-171 class ScriptedAnimationController; a/Source/WebCore/dom/Document.h_sec1
166
class MicroDataItemList;
166
class MicroDataItemList;
167
#endif
167
#endif
168
168
169
#if ENABLE(LINK_PRERENDER)
170
class Prerenderer;
171
#endif
172
169
typedef int ExceptionCode;
173
typedef int ExceptionCode;
170
174
171
class FormElementKey {
175
class FormElementKey {
Lines 1146-1151 public: a/Source/WebCore/dom/Document.h_sec2
1146
1150
1147
    IntSize viewportSize() const;
1151
    IntSize viewportSize() const;
1148
1152
1153
#if ENABLE(LINK_PRERENDER)
1154
    Prerenderer* prerenderer() { return m_prerenderer.get(); }
1155
#endif
1156
1149
protected:
1157
protected:
1150
    Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
1158
    Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
1151
1159
Lines 1487-1492 private: a/Source/WebCore/dom/Document.h_sec3
1487
1495
1488
    Timer<Document> m_pendingTasksTimer;
1496
    Timer<Document> m_pendingTasksTimer;
1489
    Vector<OwnPtr<Task> > m_pendingTasks;
1497
    Vector<OwnPtr<Task> > m_pendingTasks;
1498
1499
#if ENABLE(LINK_PRERENDER)
1500
    OwnPtr<Prerenderer> m_prerenderer;
1501
#endif
1502
1490
    bool m_scheduledTasksAreSuspended;
1503
    bool m_scheduledTasksAreSuspended;
1491
    
1504
    
1492
    bool m_visualUpdatesAllowed;
1505
    bool m_visualUpdatesAllowed;
- a/Source/WebCore/html/HTMLLinkElement.cpp +2 lines
Lines 265-270 void HTMLLinkElement::removedFrom(Node* insertionPoint) a/Source/WebCore/html/HTMLLinkElement.cpp_sec1
265
    if (!insertionPoint->inDocument())
265
    if (!insertionPoint->inDocument())
266
        return;
266
        return;
267
267
268
    m_linkLoader.released();
269
268
    if (m_isInShadowTree) {
270
    if (m_isInShadowTree) {
269
        ASSERT(!m_sheet);
271
        ASSERT(!m_sheet);
270
        return;
272
        return;
- a/Source/WebCore/html/LinkRelAttribute.cpp -4 / +10 lines
Lines 41-49 LinkRelAttribute::LinkRelAttribute() a/Source/WebCore/html/LinkRelAttribute.cpp_sec1
41
    , m_isDNSPrefetch(false)
41
    , m_isDNSPrefetch(false)
42
#if ENABLE(LINK_PREFETCH)
42
#if ENABLE(LINK_PREFETCH)
43
    , m_isLinkPrefetch(false)
43
    , m_isLinkPrefetch(false)
44
    , m_isLinkPrerender(false)
45
    , m_isLinkSubresource(false)
44
    , m_isLinkSubresource(false)
46
#endif
45
#endif
46
#if ENABLE(LINK_PRERENDER)
47
    , m_isLinkPrerender(false)
48
#endif
47
{
49
{
48
}
50
}
49
51
Lines 54-62 LinkRelAttribute::LinkRelAttribute(const String& rel) a/Source/WebCore/html/LinkRelAttribute.cpp_sec2
54
    , m_isDNSPrefetch(false)
56
    , m_isDNSPrefetch(false)
55
#if ENABLE(LINK_PREFETCH)
57
#if ENABLE(LINK_PREFETCH)
56
    , m_isLinkPrefetch(false)
58
    , m_isLinkPrefetch(false)
57
    , m_isLinkPrerender(false)
58
    , m_isLinkSubresource(false)
59
    , m_isLinkSubresource(false)
59
#endif
60
#endif
61
#if ENABLE(LINK_PRERENDER)
62
    , m_isLinkPrerender(false)
63
#endif
60
{
64
{
61
    if (equalIgnoringCase(rel, "stylesheet"))
65
    if (equalIgnoringCase(rel, "stylesheet"))
62
        m_isStyleSheet = true;
66
        m_isStyleSheet = true;
Lines 96-106 LinkRelAttribute::LinkRelAttribute(const String& rel) a/Source/WebCore/html/LinkRelAttribute.cpp_sec3
96
#if ENABLE(LINK_PREFETCH)
100
#if ENABLE(LINK_PREFETCH)
97
            else if (equalIgnoringCase(*it, "prefetch"))
101
            else if (equalIgnoringCase(*it, "prefetch"))
98
              m_isLinkPrefetch = true;
102
              m_isLinkPrefetch = true;
99
            else if (equalIgnoringCase(*it, "prerender"))
100
              m_isLinkPrerender = true;
101
            else if (equalIgnoringCase(*it, "subresource"))
103
            else if (equalIgnoringCase(*it, "subresource"))
102
              m_isLinkSubresource = true;
104
              m_isLinkSubresource = true;
103
#endif
105
#endif
106
#if ENABLE(LINK_PRERENDER)
107
            else if (equalIgnoringCase(*it, "prerender"))
108
              m_isLinkPrerender = true;
109
#endif
104
        }
110
        }
105
    }
111
    }
106
}
112
}
- a/Source/WebCore/html/LinkRelAttribute.h -1 / +3 lines
Lines 44-52 public: a/Source/WebCore/html/LinkRelAttribute.h_sec1
44
    bool m_isDNSPrefetch;
44
    bool m_isDNSPrefetch;
45
#if ENABLE(LINK_PREFETCH)
45
#if ENABLE(LINK_PREFETCH)
46
    bool m_isLinkPrefetch;
46
    bool m_isLinkPrefetch;
47
    bool m_isLinkPrerender;
48
    bool m_isLinkSubresource;
47
    bool m_isLinkSubresource;
49
#endif
48
#endif
49
#if ENABLE(LINK_PRERENDER)
50
    bool m_isLinkPrerender;
51
#endif
50
52
51
    LinkRelAttribute();
53
    LinkRelAttribute();
52
    explicit LinkRelAttribute(const String&);
54
    explicit LinkRelAttribute(const String&);
- a/Source/WebCore/loader/LinkLoader.cpp -4 / +25 lines
Lines 44-49 a/Source/WebCore/loader/LinkLoader.cpp_sec1
44
#include "Settings.h"
44
#include "Settings.h"
45
#include "StyleResolver.h"
45
#include "StyleResolver.h"
46
46
47
#if ENABLE(LINK_PRERENDER)
48
#include "PrerenderHandle.h"
49
#include "Prerenderer.h"
50
#endif
51
47
namespace WebCore {
52
namespace WebCore {
48
53
49
LinkLoader::LinkLoader(LinkLoaderClient* client)
54
LinkLoader::LinkLoader(LinkLoaderClient* client)
Lines 103-109 bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const String& ty a/Source/WebCore/loader/LinkLoader.cpp_sec2
103
    }
108
    }
104
109
105
#if ENABLE(LINK_PREFETCH)
110
#if ENABLE(LINK_PREFETCH)
106
    if ((relAttribute.m_isLinkPrefetch || relAttribute.m_isLinkPrerender || relAttribute.m_isLinkSubresource) && href.isValid() && document->frame()) {
111
    if ((relAttribute.m_isLinkPrefetch || relAttribute.m_isLinkSubresource) && href.isValid() && document->frame()) {
107
        if (!m_client->shouldLoadLink())
112
        if (!m_client->shouldLoadLink())
108
            return false;
113
            return false;
109
        ResourceLoadPriority priority = ResourceLoadPriorityUnresolved;
114
        ResourceLoadPriority priority = ResourceLoadPriorityUnresolved;
Lines 113-121 bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const String& ty a/Source/WebCore/loader/LinkLoader.cpp_sec3
113
        if (relAttribute.m_isLinkSubresource) {
118
        if (relAttribute.m_isLinkSubresource) {
114
            priority = ResourceLoadPriorityLow;
119
            priority = ResourceLoadPriorityLow;
115
            type = CachedResource::LinkSubresource;
120
            type = CachedResource::LinkSubresource;
116
        } else if (relAttribute.m_isLinkPrerender)
121
        }
117
            type = CachedResource::LinkPrerender;
118
119
        ResourceRequest linkRequest(document->completeURL(href));
122
        ResourceRequest linkRequest(document->completeURL(href));
120
        
123
        
121
        if (m_cachedLinkResource) {
124
        if (m_cachedLinkResource) {
Lines 127-134 bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const String& ty a/Source/WebCore/loader/LinkLoader.cpp_sec4
127
            m_cachedLinkResource->addClient(this);
130
            m_cachedLinkResource->addClient(this);
128
    }
131
    }
129
#endif
132
#endif
133
134
#if ENABLE(LINK_PRERENDER)
135
    if (relAttribute.m_isLinkPrerender) {
136
        ASSERT(!m_prerenderHandle);
137
        m_prerenderHandle = document->prerenderer()->render(href);
138
    }
139
#endif
130
    return true;
140
    return true;
131
}
141
}
132
142
143
void LinkLoader::released()
144
{
145
    // Only prerenders need treatment here; other links either use the CachedResource interface, or are notionally
146
    // atomic (dns prefetch).
147
#if ENABLE(LINK_PRERENDER)
148
    if (m_prerenderHandle) {
149
        m_prerenderHandle->cancel();
150
        m_prerenderHandle.clear();
151
    }
152
#endif
153
}
133
154
134
}
155
}
- a/Source/WebCore/loader/LinkLoader.h +10 lines
Lines 37-45 a/Source/WebCore/loader/LinkLoader.h_sec1
37
#include "LinkLoaderClient.h"
37
#include "LinkLoaderClient.h"
38
#include "Timer.h"
38
#include "Timer.h"
39
39
40
#include <wtf/RefPtr.h>
41
40
namespace WebCore {
42
namespace WebCore {
41
43
42
struct LinkRelAttribute;
44
struct LinkRelAttribute;
45
#if ENABLE(LINK_PRERENDER)
46
class PrerenderHandle;
47
#endif
43
48
44
// The LinkLoader can load link rel types icon, dns-prefetch, subresource, prefetch and prerender.
49
// The LinkLoader can load link rel types icon, dns-prefetch, subresource, prefetch and prerender.
45
class LinkLoader : public CachedResourceClient {
50
class LinkLoader : public CachedResourceClient {
Lines 50-55 public: a/Source/WebCore/loader/LinkLoader.h_sec2
50
    // from CachedResourceClient
55
    // from CachedResourceClient
51
    virtual void notifyFinished(CachedResource*);
56
    virtual void notifyFinished(CachedResource*);
52
    
57
    
58
    void released();
53
    bool loadLink(const LinkRelAttribute&, const String& type, const String& sizes, const KURL&, Document*);
59
    bool loadLink(const LinkRelAttribute&, const String& type, const String& sizes, const KURL&, Document*);
54
60
55
private:
61
private:
Lines 61-66 private: a/Source/WebCore/loader/LinkLoader.h_sec3
61
    CachedResourceHandle<CachedResource> m_cachedLinkResource;
67
    CachedResourceHandle<CachedResource> m_cachedLinkResource;
62
    Timer<LinkLoader> m_linkLoadTimer;
68
    Timer<LinkLoader> m_linkLoadTimer;
63
    Timer<LinkLoader> m_linkLoadingErrorTimer;
69
    Timer<LinkLoader> m_linkLoadingErrorTimer;
70
71
#if ENABLE(LINK_PRERENDER)
72
    RefPtr<PrerenderHandle> m_prerenderHandle;
73
#endif
64
};
74
};
65
    
75
    
66
}
76
}
- a/Source/WebCore/loader/Prerenderer.cpp +137 lines
Line 0 a/Source/WebCore/loader/Prerenderer.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#include "config.h"
33
#include "Prerenderer.h"
34
35
#if ENABLE(LINK_PRERENDER)
36
37
#include "Document.h"
38
#include "Frame.h"
39
#include "FrameLoader.h"
40
#include "PrerenderHandle.h"
41
#include "PrerendererClient.h"
42
#include "ReferrerPolicy.h"
43
#include "SecurityPolicy.h"
44
45
#include <wtf/PassOwnPtr.h>
46
#include <wtf/PassRefPtr.h>
47
#include <wtf/RefPtr.h>
48
#include <wtf/text/WTFString.h>
49
50
namespace WebCore {
51
52
// static
53
PassOwnPtr<Prerenderer> Prerenderer::create(Document* document)
54
{
55
    Prerenderer* prerenderer = new Prerenderer(document);
56
    prerenderer->suspendIfNeeded();
57
    return adoptPtr(prerenderer);
58
}
59
60
Prerenderer::Prerenderer(Document* document)
61
    : ActiveDOMObject(document, this)
62
    , m_client(0)
63
{
64
}
65
66
Prerenderer::~Prerenderer()
67
{
68
}
69
70
PassRefPtr<PrerenderHandle> Prerenderer::render(const KURL& url)
71
{
72
    // Prerenders are unlike requests in most ways (for instance, they pass down fragments, and they don't return data),
73
    // but they do have referrers.
74
    const ReferrerPolicy referrerPolicy = document()->referrerPolicy();
75
    const String referrer = SecurityPolicy::generateReferrerHeader(referrerPolicy, url, document()->frame()->loader()->outgoingReferrer());
76
77
    RefPtr<PrerenderHandle> prerenderHandle = PrerenderHandle::create(url, referrer, referrerPolicy);
78
79
    client()->willAddPrerender(prerenderHandle.get());
80
    prerenderHandle->add();
81
82
    m_activeHandles.append(prerenderHandle);
83
    return prerenderHandle;
84
}
85
86
void Prerenderer::stop()
87
{
88
    while (!m_activeHandles.isEmpty()) {
89
        RefPtr<PrerenderHandle> handle = m_activeHandles[0].release();
90
        m_activeHandles.remove(0);
91
        handle->abandon();
92
    }
93
    while (!m_suspendedHandles.isEmpty()) {
94
        RefPtr<PrerenderHandle> handle = m_suspendedHandles[0].release();
95
        m_suspendedHandles.remove(0);
96
        handle->abandon();
97
    }
98
}
99
100
void Prerenderer::suspend(ReasonForSuspension reason)
101
{
102
    if (reason == DocumentWillBecomeInactive || reason == PageWillBeSuspended) {
103
        while (!m_activeHandles.isEmpty()) {
104
            RefPtr<PrerenderHandle> handle = m_activeHandles[0].release();
105
            m_activeHandles.remove(0);
106
            handle->suspend();
107
            m_suspendedHandles.append(handle);
108
        }
109
    }
110
}
111
112
void Prerenderer::resume()
113
{
114
    while (!m_suspendedHandles.isEmpty()) {
115
        RefPtr<PrerenderHandle> handle = m_suspendedHandles[0].release();
116
        m_suspendedHandles.remove(0);
117
        handle->resume();
118
        m_activeHandles.append(handle);
119
    }
120
}
121
122
Document* Prerenderer::document()
123
{
124
    ASSERT(scriptExecutionContext()->isDocument());
125
    return static_cast<Document*>(scriptExecutionContext());
126
}
127
128
PrerendererClient* Prerenderer::client()
129
{
130
    if (!m_client)
131
        m_client = PrerendererClient::from(document()->page());
132
    return m_client;
133
}
134
135
}
136
137
#endif // ENABLE(LINK_PRERENDER)
- a/Source/WebCore/loader/Prerenderer.h +85 lines
Line 0 a/Source/WebCore/loader/Prerenderer.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#ifndef Prerenderer_h
33
#define Prerenderer_h
34
35
#if ENABLE(LINK_PRERENDER)
36
37
#include "ActiveDOMObject.h"
38
#include "KURL.h"
39
#include <wtf/OwnPtr.h>
40
#include <wtf/PassOwnPtr.h>
41
#include <wtf/PassRefPtr.h>
42
#include <wtf/RefPtr.h>
43
#include <wtf/SinglyLinkedList.h>
44
#include <wtf/Vector.h>
45
46
namespace WebCore {
47
48
class Document;
49
class PrerenderHandle;
50
class PrerendererClient;
51
class Page;
52
53
class Prerenderer : public ActiveDOMObject {
54
    WTF_MAKE_NONCOPYABLE(Prerenderer);
55
public:
56
    virtual ~Prerenderer();
57
58
    PassRefPtr<PrerenderHandle> render(const KURL&);
59
60
    static PassOwnPtr<Prerenderer> create(Document*);
61
62
private:
63
    typedef Vector<RefPtr<PrerenderHandle> > HandleVector;
64
    typedef Vector<KURL> KURLVector;
65
66
    Prerenderer(Document*);
67
68
    virtual bool canSuspend() const OVERRIDE { return true; }
69
    virtual void stop() OVERRIDE;
70
    virtual void suspend(ReasonForSuspension) OVERRIDE;
71
    virtual void resume() OVERRIDE;
72
73
    Document* document();
74
    PrerendererClient* client();
75
76
    PrerendererClient* m_client;
77
    HandleVector m_activeHandles;
78
    HandleVector m_suspendedHandles;
79
};
80
81
}
82
83
#endif // ENABLE(LINK_PRERENDER)
84
85
#endif // Prerenderer_h
- a/Source/WebCore/loader/PrerendererClient.cpp +65 lines
Line 0 a/Source/WebCore/loader/PrerendererClient.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#include "config.h"
33
#include "PrerendererClient.h"
34
35
#include "Page.h"
36
#include "Supplementable.h"
37
#include <wtf/text/AtomicString.h>
38
39
#if ENABLE(LINK_PRERENDER)
40
41
namespace WebCore {
42
43
// static
44
const AtomicString& PrerendererClient::supplementName()
45
{
46
    DEFINE_STATIC_LOCAL(AtomicString, name, ("PrerendererClient"));
47
    return name;
48
}
49
50
// static
51
PrerendererClient* PrerendererClient::from(Page* page)
52
{
53
    PrerendererClient* supplement = static_cast<PrerendererClient*>(Supplement<Page>::from(page, supplementName()));
54
    ASSERT(supplement);
55
    return supplement;
56
}
57
58
void providePrerendererClientTo(Page* page, PrerendererClient* client)
59
{
60
    PrerendererClient::provideTo(page, PrerendererClient::supplementName(), adoptPtr(client));
61
}
62
63
}
64
65
#endif
- a/Source/WebCore/loader/PrerendererClient.h +65 lines
Line 0 a/Source/WebCore/loader/PrerendererClient.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#ifndef PrerendererClient_h
33
#define PrerendererClient_h
34
35
#if ENABLE(LINK_PRERENDER)
36
37
#include "Supplementable.h"
38
#include <wtf/PassRefPtr.h>
39
40
namespace WebCore {
41
42
class Document;
43
class Page;
44
class PrerenderHandle;
45
46
class PrerendererClient : public Supplement<Page> {
47
public:
48
    virtual ~PrerendererClient() { }
49
50
    virtual void willAddPrerender(PrerenderHandle*) = 0;
51
52
    static const AtomicString& supplementName();
53
    static PrerendererClient* from(Page*);
54
55
protected:
56
    PrerendererClient() { }
57
};
58
59
void providePrerendererClientTo(Page*, PrerendererClient*);
60
61
} // namespace WebCore
62
63
#endif // ENABLED(LINK_PRERENDER)
64
65
#endif // PrerendererClient_h
- a/Source/WebCore/loader/cache/CachedResource.cpp -5 / +1 lines
Lines 73-80 static ResourceLoadPriority defaultPriorityForResourceType(CachedResource::Type a/Source/WebCore/loader/cache/CachedResource.cpp_sec1
73
#if ENABLE(LINK_PREFETCH)
73
#if ENABLE(LINK_PREFETCH)
74
        case CachedResource::LinkPrefetch:
74
        case CachedResource::LinkPrefetch:
75
            return ResourceLoadPriorityVeryLow;
75
            return ResourceLoadPriorityVeryLow;
76
        case CachedResource::LinkPrerender:
77
            return ResourceLoadPriorityVeryLow;
78
        case CachedResource::LinkSubresource:
76
        case CachedResource::LinkSubresource:
79
            return ResourceLoadPriorityVeryLow;
77
            return ResourceLoadPriorityVeryLow;
80
#endif
78
#endif
Lines 114-121 static ResourceRequest::TargetType cachedResourceTypeToTargetType(CachedResource a/Source/WebCore/loader/cache/CachedResource.cpp_sec2
114
#if ENABLE(LINK_PREFETCH)
112
#if ENABLE(LINK_PREFETCH)
115
    case CachedResource::LinkPrefetch:
113
    case CachedResource::LinkPrefetch:
116
        return ResourceRequest::TargetIsPrefetch;
114
        return ResourceRequest::TargetIsPrefetch;
117
    case CachedResource::LinkPrerender:
118
        return ResourceRequest::TargetIsPrerender;
119
    case CachedResource::LinkSubresource:
115
    case CachedResource::LinkSubresource:
120
        return ResourceRequest::TargetIsSubresource;
116
        return ResourceRequest::TargetIsSubresource;
121
#endif
117
#endif
Lines 220-226 void CachedResource::load(CachedResourceLoader* cachedResourceLoader, const Reso a/Source/WebCore/loader/cache/CachedResource.cpp_sec3
220
    }
216
    }
221
217
222
#if ENABLE(LINK_PREFETCH)
218
#if ENABLE(LINK_PREFETCH)
223
    if (type() == CachedResource::LinkPrefetch || type() == CachedResource::LinkPrerender || type() == CachedResource::LinkSubresource)
219
    if (type() == CachedResource::LinkPrefetch || type() == CachedResource::LinkSubresource)
224
        m_resourceRequest.setHTTPHeaderField("Purpose", "prefetch");
220
        m_resourceRequest.setHTTPHeaderField("Purpose", "prefetch");
225
#endif
221
#endif
226
    m_resourceRequest.setPriority(loadPriority());
222
    m_resourceRequest.setPriority(loadPriority());
- a/Source/WebCore/loader/cache/CachedResource.h -2 lines
Lines 74-80 public: a/Source/WebCore/loader/cache/CachedResource.h_sec1
74
#endif
74
#endif
75
#if ENABLE(LINK_PREFETCH)
75
#if ENABLE(LINK_PREFETCH)
76
        , LinkPrefetch
76
        , LinkPrefetch
77
        , LinkPrerender
78
        , LinkSubresource
77
        , LinkSubresource
79
#endif
78
#endif
80
#if ENABLE(VIDEO_TRACK)
79
#if ENABLE(VIDEO_TRACK)
Lines 150-156 public: a/Source/WebCore/loader/cache/CachedResource.h_sec2
150
        return false
149
        return false
151
#if ENABLE(LINK_PREFETCH)
150
#if ENABLE(LINK_PREFETCH)
152
            || type() == LinkPrefetch
151
            || type() == LinkPrefetch
153
            || type() == LinkPrerender
154
            || type() == LinkSubresource
152
            || type() == LinkSubresource
155
#endif
153
#endif
156
            || type() == RawResource;
154
            || type() == RawResource;
- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp -6 / +1 lines
Lines 88-95 static CachedResource* createResource(CachedResource::Type type, ResourceRequest a/Source/WebCore/loader/cache/CachedResourceLoader.cpp_sec1
88
#if ENABLE(LINK_PREFETCH)
88
#if ENABLE(LINK_PREFETCH)
89
    case CachedResource::LinkPrefetch:
89
    case CachedResource::LinkPrefetch:
90
        return new CachedResource(request, CachedResource::LinkPrefetch);
90
        return new CachedResource(request, CachedResource::LinkPrefetch);
91
    case CachedResource::LinkPrerender:
92
        return new CachedResource(request, CachedResource::LinkPrerender);
93
    case CachedResource::LinkSubresource:
91
    case CachedResource::LinkSubresource:
94
        return new CachedResource(request, CachedResource::LinkSubresource);
92
        return new CachedResource(request, CachedResource::LinkSubresource);
95
#endif
93
#endif
Lines 240-246 CachedSVGDocument* CachedResourceLoader::requestSVGDocument(ResourceRequest& req a/Source/WebCore/loader/cache/CachedResourceLoader.cpp_sec2
240
CachedResource* CachedResourceLoader::requestLinkResource(CachedResource::Type type, ResourceRequest& request, ResourceLoadPriority priority)
238
CachedResource* CachedResourceLoader::requestLinkResource(CachedResource::Type type, ResourceRequest& request, ResourceLoadPriority priority)
241
{
239
{
242
    ASSERT(frame());
240
    ASSERT(frame());
243
    ASSERT(type == CachedResource::LinkPrefetch || type == CachedResource::LinkPrerender || type == CachedResource::LinkSubresource);
241
    ASSERT(type == CachedResource::LinkPrefetch || type == CachedResource::LinkSubresource);
244
    return requestResource(type, request, String(), defaultCachedResourceOptions(), priority);
242
    return requestResource(type, request, String(), defaultCachedResourceOptions(), priority);
245
}
243
}
246
#endif
244
#endif
Lines 286-292 bool CachedResourceLoader::checkInsecureContent(CachedResource::Type type, const a/Source/WebCore/loader/cache/CachedResourceLoader.cpp_sec3
286
    case CachedResource::RawResource:
284
    case CachedResource::RawResource:
287
#if ENABLE(LINK_PREFETCH)
285
#if ENABLE(LINK_PREFETCH)
288
    case CachedResource::LinkPrefetch:
286
    case CachedResource::LinkPrefetch:
289
    case CachedResource::LinkPrerender:
290
    case CachedResource::LinkSubresource:
287
    case CachedResource::LinkSubresource:
291
        // Prefetch cannot affect the current document.
288
        // Prefetch cannot affect the current document.
292
#endif
289
#endif
Lines 315-321 bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url a/Source/WebCore/loader/cache/CachedResourceLoader.cpp_sec4
315
    case CachedResource::RawResource:
312
    case CachedResource::RawResource:
316
#if ENABLE(LINK_PREFETCH)
313
#if ENABLE(LINK_PREFETCH)
317
    case CachedResource::LinkPrefetch:
314
    case CachedResource::LinkPrefetch:
318
    case CachedResource::LinkPrerender:
319
    case CachedResource::LinkSubresource:
315
    case CachedResource::LinkSubresource:
320
#endif
316
#endif
321
#if ENABLE(VIDEO_TRACK)
317
#if ENABLE(VIDEO_TRACK)
Lines 385-391 bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url a/Source/WebCore/loader/cache/CachedResourceLoader.cpp_sec5
385
    case CachedResource::RawResource:
381
    case CachedResource::RawResource:
386
#if ENABLE(LINK_PREFETCH)
382
#if ENABLE(LINK_PREFETCH)
387
    case CachedResource::LinkPrefetch:
383
    case CachedResource::LinkPrefetch:
388
    case CachedResource::LinkPrerender:
389
    case CachedResource::LinkSubresource:
384
    case CachedResource::LinkSubresource:
390
#endif
385
#endif
391
        break;
386
        break;
- a/Source/WebCore/platform/PrerenderHandle.h +86 lines
Line 0 a/Source/WebCore/platform/PrerenderHandle.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#ifndef PrerenderHandle_h
33
#define PrerenderHandle_h
34
35
#if ENABLE(LINK_PRERENDER)
36
37
#include "ReferrerPolicy.h"
38
#include <wtf/PassRefPtr.h>
39
#include <wtf/RefCounted.h>
40
#include <wtf/RefPtr.h>
41
#include <wtf/text/WTFString.h>
42
43
namespace WebCore {
44
45
class KURL;
46
class Prerender;
47
48
class PrerenderHandle : public RefCounted<PrerenderHandle> {
49
    WTF_MAKE_NONCOPYABLE(PrerenderHandle);
50
public:
51
    static PassRefPtr<PrerenderHandle> create(const KURL&, const String& referrer, ReferrerPolicy);
52
    ~PrerenderHandle();
53
54
    Prerender* prerender();
55
56
    // FIXME: one day there will be events here, and we will be a PrerenderClient.
57
58
    // A prerender link element is added when it is inserted into a document.
59
    void add();
60
61
    // A prerender is abandoned when it's navigated away from. This is is a weaker signal
62
    // than cancel(), since the launcher hasn't indicated that the prerender isn't wanted,
63
    // and we may end up using it after, for instance, a short redirect chain.
64
    void abandon();
65
66
    // A prerender is canceled when it is removed from a document.
67
    void cancel();
68
69
    // A prerender is suspended along with the DOM containing its linkloader & prerenderer.
70
    void suspend();
71
    void resume();
72
73
    const KURL& url() const;
74
    const String& referrer() const;
75
    ReferrerPolicy referrerPolicy() const;
76
77
private:
78
    PrerenderHandle(const KURL&, const String& referrer, ReferrerPolicy);
79
    RefPtr<Prerender> m_prerender;
80
};
81
82
} // namespace WebCore
83
84
#endif // ENABLE(LINK_PRERENDER)
85
86
#endif // PrerenderHandle_h
- a/Source/WebCore/platform/chromium/Prerender.cpp +116 lines
Line 0 a/Source/WebCore/platform/chromium/Prerender.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#include "config.h"
33
#include "Prerender.h"
34
35
#include <public/Platform.h>
36
#include <public/WebPrerender.h>
37
#include <public/WebPrerenderingPlatform.h>
38
#include <public/WebReferrerPolicy.h>
39
#include <public/WebString.h>
40
#include <public/WebURL.h>
41
42
#if ENABLE(LINK_PRERENDER)
43
44
namespace WebCore {
45
46
Prerender::Prerender(const KURL& url, const String& referrer, ReferrerPolicy policy)
47
    : m_url(url)
48
    , m_referrer(referrer)
49
    , m_referrerPolicy(policy)
50
    , m_platform(0)
51
#ifndef NDEBUG
52
    , m_state(Inactive)
53
#endif
54
{
55
}
56
57
Prerender::~Prerender()
58
{
59
}
60
61
void Prerender::setState(State state)
62
{
63
#ifdef NDEBUG
64
    UNUSED_PARAM(state);
65
#else
66
    m_state = state;
67
#endif
68
}
69
70
void Prerender::add()
71
{
72
    ASSERT(m_state == Inactive);
73
    if (!m_platform)
74
        m_platform = WebKit::WebPrerenderingPlatform::getPlatform();
75
    if (!m_platform)
76
        return;
77
    WebKit::WebPrerender webPrerender(this);
78
    m_platform->add(webPrerender);
79
    setState(Active);
80
}
81
82
void Prerender::cancel()
83
{
84
    if (!m_platform)
85
        return;
86
    ASSERT(m_state == Active);
87
    WebKit::WebPrerender webPrerender(this);
88
    m_platform->cancel(webPrerender);
89
    setState(Inactive);
90
}
91
92
void Prerender::abandon()
93
{
94
    if (!m_platform)
95
        return;
96
    // FIXME: Assert on the state as Inactive here. It is currently common to call abandon() on an Inactive
97
    // prerender, as the Prerenderer doesn't keep track of which prerenders are active, and so any page that
98
    // ever had a now-canceled Prerender will get this bogus stop() call.
99
    WebKit::WebPrerender webPrerender(this);
100
    m_platform->abandon(webPrerender);
101
    setState(Inactive);
102
}
103
104
void Prerender::suspend()
105
{
106
    abandon();
107
}
108
109
void Prerender::resume()
110
{
111
    add();
112
}
113
114
}
115
116
#endif // ENABLE(LINK_PRERENDER)
- a/Source/WebCore/platform/chromium/Prerender.h +102 lines
Line 0 a/Source/WebCore/platform/chromium/Prerender.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#ifndef Prerender_h
33
#define Prerender_h
34
35
#include "KURL.h"
36
#include "ReferrerPolicy.h"
37
#include <public/WebSize.h>
38
#include <wtf/OwnPtr.h>
39
#include <wtf/PassOwnPtr.h>
40
#include <wtf/PassRefPtr.h>
41
#include <wtf/RefCounted.h>
42
#include <wtf/RefPtr.h>
43
#include <wtf/text/WTFString.h>
44
45
#if ENABLE(LINK_PRERENDER)
46
47
namespace WebKit {
48
class WebPrerenderingPlatform;
49
}
50
51
namespace WebCore {
52
53
class Prerender : public RefCounted<Prerender> {
54
    WTF_MAKE_NONCOPYABLE(Prerender);
55
public:
56
    class ExtraData : public RefCounted<ExtraData> {
57
    public:
58
        virtual ~ExtraData() { }
59
    };
60
61
    Prerender(const KURL&, const String& referrer, ReferrerPolicy);
62
    ~Prerender();
63
64
    void add();
65
    void cancel();
66
    void abandon();
67
    void suspend();
68
    void resume();
69
70
    const KURL& url() const { return m_url; }
71
    const String& referrer() const { return m_referrer; }
72
    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
73
74
    void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData; }
75
    ExtraData* extraData() { return m_extraData.get(); }
76
77
private:
78
    enum State {
79
        Inactive,
80
        Active,
81
    };
82
83
    void setState(State);
84
85
    const KURL m_url;
86
    const String m_referrer;
87
    const ReferrerPolicy m_referrerPolicy;
88
89
    RefPtr<ExtraData> m_extraData;
90
91
    WebKit::WebPrerenderingPlatform* m_platform;
92
93
#ifndef NDEBUG
94
    State m_state;
95
#endif
96
};
97
98
}
99
100
#endif // ENABLE(LINK_PRERENDER)
101
102
#endif // Prerender_h
- a/Source/WebCore/platform/chromium/PrerenderHandle.cpp +106 lines
Line 0 a/Source/WebCore/platform/chromium/PrerenderHandle.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#include "config.h"
33
#include "PrerenderHandle.h"
34
35
#if ENABLE(LINK_PRERENDER)
36
37
#include "KURL.h"
38
#include "Prerender.h"
39
#include "ReferrerPolicy.h"
40
#include <wtf/PassRefPtr.h>
41
#include <wtf/text/WTFString.h>
42
43
namespace WebCore {
44
45
PassRefPtr<PrerenderHandle> PrerenderHandle::create(const KURL& url, const String& referrer, ReferrerPolicy policy)
46
{
47
    return adoptRef(new PrerenderHandle(url, referrer, policy));
48
}
49
50
PrerenderHandle::PrerenderHandle(const KURL& url, const String& referrer, ReferrerPolicy policy)
51
        : m_prerender(adoptRef(new Prerender(url, referrer, policy)))
52
{
53
}
54
55
PrerenderHandle::~PrerenderHandle()
56
{
57
}
58
59
Prerender* PrerenderHandle::prerender()
60
{
61
    return m_prerender.get();
62
}
63
64
void PrerenderHandle::add()
65
{
66
    prerender()->add();
67
}
68
69
void PrerenderHandle::cancel()
70
{
71
    prerender()->cancel();
72
}
73
74
void PrerenderHandle::abandon()
75
{
76
    prerender()->abandon();
77
}
78
79
void PrerenderHandle::suspend()
80
{
81
    prerender()->suspend();
82
}
83
84
void PrerenderHandle::resume()
85
{
86
    prerender()->resume();
87
}
88
89
const KURL& PrerenderHandle::url() const
90
{
91
    return m_prerender->url();
92
}
93
94
const String& PrerenderHandle::referrer() const
95
{
96
    return m_prerender->url();
97
}
98
99
ReferrerPolicy PrerenderHandle::referrerPolicy() const
100
{
101
    return m_prerender->referrerPolicy();
102
}
103
104
}
105
106
#endif // ENABLE(LINK_PRERENDER)
- a/Source/WebCore/platform/chromium/support/WebPrerender.cpp +102 lines
Line 0 a/Source/WebCore/platform/chromium/support/WebPrerender.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
#include <public/WebPrerender.h>
33
#include <wtf/PassRefPtr.h>
34
35
#if ENABLE(LINK_PRERENDER)
36
37
#include "Prerender.h"
38
39
namespace WebKit {
40
41
namespace {
42
43
class ExtraDataContainer : public WebCore::Prerender::ExtraData {
44
public:
45
    static PassRefPtr<ExtraDataContainer> create(WebPrerender::ExtraData* extraData) { return adoptRef(new ExtraDataContainer(extraData)); }
46
47
    virtual ~ExtraDataContainer() { }
48
49
    WebPrerender::ExtraData* extraData() const { return m_extraData.get(); }
50
51
private:
52
    explicit ExtraDataContainer(WebPrerender::ExtraData* extraData)
53
            : m_extraData(adoptPtr(extraData))
54
    {
55
    }
56
57
    OwnPtr<WebPrerender::ExtraData> m_extraData;
58
};
59
60
} // anon namespace
61
62
WebPrerender::WebPrerender(PassRefPtr<WebCore::Prerender> prerender)
63
    : m_private(prerender)
64
{
65
}
66
67
WebPrerender::~WebPrerender()
68
{
69
    m_private.reset();
70
}
71
72
WebURL WebPrerender::url() const
73
{
74
    return WebURL(m_private->url());
75
}
76
77
WebString WebPrerender::referrer() const
78
{
79
    return m_private->referrer();
80
}
81
82
WebReferrerPolicy WebPrerender::referrerPolicy() const
83
{
84
    return static_cast<WebReferrerPolicy>(m_private->referrerPolicy());
85
}
86
87
void WebPrerender::setExtraData(WebPrerender::ExtraData* extraData)
88
{
89
    m_private->setExtraData(ExtraDataContainer::create(extraData));
90
}
91
92
const WebPrerender::ExtraData* WebPrerender::extraData() const
93
{
94
    RefPtr<WebCore::Prerender::ExtraData> webcoreExtraData = m_private->extraData();
95
    if (!webcoreExtraData)
96
        return 0;
97
    return static_cast<ExtraDataContainer*>(webcoreExtraData.get())->extraData();
98
}
99
100
} // namespace WebKit
101
102
#endif // ENABLED(LINK_PRERENDER)
- a/Source/WebCore/platform/network/blackberry/ResourceRequest.h -1 lines
Lines 45-51 public: a/Source/WebCore/platform/network/blackberry/ResourceRequest.h_sec1
45
        TargetIsWorker,
45
        TargetIsWorker,
46
        TargetIsSharedWorker,
46
        TargetIsSharedWorker,
47
        TargetIsPrefetch,
47
        TargetIsPrefetch,
48
        TargetIsPrerender,
49
        TargetIsFavicon,
48
        TargetIsFavicon,
50
        TargetIsXHR,
49
        TargetIsXHR,
51
        TargetIsTextTrack,
50
        TargetIsTextTrack,
- a/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp -2 lines
Lines 86-93 static inline NetworkRequest::TargetType platformTargetTypeForRequest(const Reso a/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp_sec1
86
        return NetworkRequest::TargetIsImage;
86
        return NetworkRequest::TargetIsImage;
87
    case ResourceRequest::TargetIsPrefetch:
87
    case ResourceRequest::TargetIsPrefetch:
88
        return NetworkRequest::TargetIsSubresource;
88
        return NetworkRequest::TargetIsSubresource;
89
    case ResourceRequest::TargetIsPrerender:
90
        return NetworkRequest::TargetIsSubresource;
91
    case ResourceRequest::TargetIsXHR:
89
    case ResourceRequest::TargetIsXHR:
92
        return NetworkRequest::TargetIsSubresource;
90
        return NetworkRequest::TargetIsSubresource;
93
    case ResourceRequest::TargetIsTextTrack:
91
    case ResourceRequest::TargetIsTextTrack:
- a/Source/WebCore/platform/network/chromium/ResourceRequest.h -1 lines
Lines 53-59 namespace WebCore { a/Source/WebCore/platform/network/chromium/ResourceRequest.h_sec1
53
            TargetIsWorker,
53
            TargetIsWorker,
54
            TargetIsSharedWorker,
54
            TargetIsSharedWorker,
55
            TargetIsPrefetch,
55
            TargetIsPrefetch,
56
            TargetIsPrerender,
57
            TargetIsFavicon,
56
            TargetIsFavicon,
58
            TargetIsXHR,
57
            TargetIsXHR,
59
            TargetIsTextTrack,
58
            TargetIsTextTrack,
- a/Source/WebKit/chromium/DEPS +1 lines
Lines 32-37 a/Source/WebKit/chromium/DEPS_sec1
32
32
33
vars = {
33
vars = {
34
  'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
34
  'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
35
  # To land, this patch must garden past the commited rev of http://codereview.chromium.org/10198040/
35
  'chromium_rev': '133673'
36
  'chromium_rev': '133673'
36
}
37
}
37
38
- a/Source/WebKit/chromium/WebKit.gyp +3 lines
Lines 225-230 a/Source/WebKit/chromium/WebKit.gyp_sec1
225
                'public/WebPopupMenu.h',
225
                'public/WebPopupMenu.h',
226
                'public/WebPopupMenuInfo.h',
226
                'public/WebPopupMenuInfo.h',
227
                'public/WebPopupType.h',
227
                'public/WebPopupType.h',
228
                'public/WebPrerendererClient.h',
228
                'public/WebRange.h',
229
                'public/WebRange.h',
229
                'public/WebRegularExpression.h',
230
                'public/WebRegularExpression.h',
230
                'public/WebRuntimeFeatures.h',
231
                'public/WebRuntimeFeatures.h',
Lines 436-441 a/Source/WebKit/chromium/WebKit.gyp_sec2
436
                'src/InspectorFrontendClientImpl.h',
437
                'src/InspectorFrontendClientImpl.h',
437
                'src/NonCompositedContentHost.cpp',
438
                'src/NonCompositedContentHost.cpp',
438
                'src/NonCompositedContentHost.h',
439
                'src/NonCompositedContentHost.h',
440
                'src/PrerendererClientImpl.h',
441
                'src/PrerendererClientImpl.cpp',
439
                'src/android/WebInputEventFactory.cpp',
442
                'src/android/WebInputEventFactory.cpp',
440
                'src/linux/WebFontInfo.cpp',
443
                'src/linux/WebFontInfo.cpp',
441
                'src/linux/WebFontRendering.cpp',
444
                'src/linux/WebFontRendering.cpp',
- a/Source/WebKit/chromium/public/WebPrerendererClient.h +48 lines
Line 0 a/Source/WebKit/chromium/public/WebPrerendererClient.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#ifndef WebPrerendererClient_h
33
#define WebPrerendererClient_h
34
35
#include "platform/WebCommon.h"
36
37
namespace WebKit {
38
39
class WebPrerender;
40
41
class WebPrerendererClient {
42
public:
43
    virtual void willAddPrerender(WebPrerender*) = 0;
44
};
45
46
} // namespace WebPrerendererClient_h
47
48
#endif // WebPrerendererClient_h
- a/Source/WebKit/chromium/public/WebView.h +2 lines
Lines 51-56 class WebGraphicsContext3D; a/Source/WebKit/chromium/public/WebView.h_sec1
51
class WebNode;
51
class WebNode;
52
class WebPageOverlay;
52
class WebPageOverlay;
53
class WebPermissionClient;
53
class WebPermissionClient;
54
class WebPrerendererClient;
54
class WebSettings;
55
class WebSettings;
55
class WebSpellCheckClient;
56
class WebSpellCheckClient;
56
class WebString;
57
class WebString;
Lines 105-110 public: a/Source/WebKit/chromium/public/WebView.h_sec2
105
    virtual void setAutofillClient(WebAutofillClient*) = 0;
106
    virtual void setAutofillClient(WebAutofillClient*) = 0;
106
    virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0;
107
    virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0;
107
    virtual void setPermissionClient(WebPermissionClient*) = 0;
108
    virtual void setPermissionClient(WebPermissionClient*) = 0;
109
    virtual void setPrerendererClient(WebPrerendererClient*) = 0;
108
    virtual void setSpellCheckClient(WebSpellCheckClient*) = 0;
110
    virtual void setSpellCheckClient(WebSpellCheckClient*) = 0;
109
    virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) = 0;
111
    virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) = 0;
110
112
- a/Source/WebKit/chromium/src/PrerendererClientImpl.cpp +59 lines
Line 0 a/Source/WebKit/chromium/src/PrerendererClientImpl.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#include "config.h"
33
#include "PrerendererClientImpl.h"
34
35
#include "Document.h"
36
#include "Frame.h"
37
#include "Prerender.h"
38
#include "PrerenderHandle.h"
39
#include "WebPrerendererClient.h"
40
#include "WebViewImpl.h"
41
#include <public/WebPrerender.h>
42
#include <wtf/PassRefPtr.h>
43
44
namespace WebKit {
45
46
PrerendererClientImpl::PrerendererClientImpl(WebPrerendererClient* client)
47
    : m_client(client)
48
{
49
}
50
51
void PrerendererClientImpl::willAddPrerender(WebCore::PrerenderHandle* prerenderHandle)
52
{
53
    if (!m_client)
54
        return;
55
    WebPrerender webPrerender(prerenderHandle->prerender());
56
    m_client->willAddPrerender(&webPrerender);
57
}
58
59
}
- a/Source/WebKit/chromium/src/PrerendererClientImpl.h +60 lines
Line 0 a/Source/WebKit/chromium/src/PrerendererClientImpl.h_sec1
1
/*
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 *
30
 */
31
32
#ifndef PrerendererClientImpl_h
33
#define PrerendererClientImpl_h
34
35
#include "PrerendererClient.h"
36
#include <wtf/Noncopyable.h>
37
#include <wtf/PassRefPtr.h>
38
39
namespace WebCore {
40
class PrerenderHandle;
41
}
42
43
namespace WebKit {
44
45
class WebPrerendererClient;
46
47
class PrerendererClientImpl : public WebCore::PrerendererClient {
48
    WTF_MAKE_NONCOPYABLE(PrerendererClientImpl);
49
public:
50
    explicit PrerendererClientImpl(WebPrerendererClient*);
51
52
    void willAddPrerender(WebCore::PrerenderHandle*) OVERRIDE;
53
54
private:
55
    WebPrerendererClient* m_client;
56
};
57
58
}
59
60
#endif // PrerendererClientImpl_h
- a/Source/WebKit/chromium/src/WebViewImpl.cpp +6 lines
Lines 99-104 a/Source/WebKit/chromium/src/WebViewImpl.cpp_sec1
99
#include "PointerLockController.h"
99
#include "PointerLockController.h"
100
#include "PopupContainer.h"
100
#include "PopupContainer.h"
101
#include "PopupMenuClient.h"
101
#include "PopupMenuClient.h"
102
#include "PrerendererClientImpl.h"
102
#include "ProgressTracker.h"
103
#include "ProgressTracker.h"
103
#include "RenderLayerCompositor.h"
104
#include "RenderLayerCompositor.h"
104
#include "RenderView.h"
105
#include "RenderView.h"
Lines 322-327 void WebViewImpl::setPermissionClient(WebPermissionClient* permissionClient) a/Source/WebKit/chromium/src/WebViewImpl.cpp_sec2
322
    m_permissionClient = permissionClient;
323
    m_permissionClient = permissionClient;
323
}
324
}
324
325
326
void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient)
327
{
328
    providePrerendererClientTo(m_page.get(), new PrerendererClientImpl(prerendererClient));
329
}
330
325
void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient)
331
void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient)
326
{
332
{
327
    m_spellCheckClient = spellCheckClient;
333
    m_spellCheckClient = spellCheckClient;
- a/Source/WebKit/chromium/src/WebViewImpl.h +3 lines
Lines 90-95 class DeviceOrientationClientProxy; a/Source/WebKit/chromium/src/WebViewImpl.h_sec1
90
class DragScrollTimer;
90
class DragScrollTimer;
91
class GeolocationClientProxy;
91
class GeolocationClientProxy;
92
class NonCompositedContentHost;
92
class NonCompositedContentHost;
93
class PrerendererClientImpl;
93
class SpeechInputClientImpl;
94
class SpeechInputClientImpl;
94
class SpeechRecognitionClientProxy;
95
class SpeechRecognitionClientProxy;
95
class UserMediaClientImpl;
96
class UserMediaClientImpl;
Lines 100-105 class WebDevToolsAgentPrivate; a/Source/WebKit/chromium/src/WebViewImpl.h_sec2
100
class WebFrameImpl;
101
class WebFrameImpl;
101
class WebGestureEvent;
102
class WebGestureEvent;
102
class WebPagePopupImpl;
103
class WebPagePopupImpl;
104
class WebPrerendererClient;
103
class WebImage;
105
class WebImage;
104
class WebKeyboardEvent;
106
class WebKeyboardEvent;
105
class WebMouseEvent;
107
class WebMouseEvent;
Lines 160-165 public: a/Source/WebKit/chromium/src/WebViewImpl.h_sec3
160
    virtual void setAutofillClient(WebAutofillClient*);
162
    virtual void setAutofillClient(WebAutofillClient*);
161
    virtual void setDevToolsAgentClient(WebDevToolsAgentClient*);
163
    virtual void setDevToolsAgentClient(WebDevToolsAgentClient*);
162
    virtual void setPermissionClient(WebPermissionClient*);
164
    virtual void setPermissionClient(WebPermissionClient*);
165
    virtual void setPrerendererClient(WebPrerendererClient*) OVERRIDE;
163
    virtual void setSpellCheckClient(WebSpellCheckClient*);
166
    virtual void setSpellCheckClient(WebSpellCheckClient*);
164
    virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) OVERRIDE;
167
    virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) OVERRIDE;
165
    virtual WebSettings* settings();
168
    virtual WebSettings* settings();
- a/LayoutTests/ChangeLog +25 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-04-27  Gavin Peters  <gavinp@chromium.org>
2
3
        Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering.
4
        https://bugs.webkit.org/show_bug.cgi?id=85005
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The prerender case isn't quite a resource load, and using resource loading to
9
        retrieve them has constrained the API, and unnecessarily complicated the loader.
10
11
        The new Prerenderer and PrerenderHandle let <link rel=prerender...> elements signal
12
        removal and unload to their platform.
13
14
        These tests are being removed, and expectations updated, because the old phantom-load
15
        prerendering interface was susceptible to layout testing, and the new interface requires
16
        a full platform to test, so it can't really be a layout test.
17
18
        * fast/dom/HTMLLinkElement/prerender-expected.txt: Removed.
19
        * fast/dom/HTMLLinkElement/prerender.html: Removed.
20
        * platform/gtk/test_expectations.txt:
21
        * platform/mac/Skipped:
22
        * platform/qt/Skipped:
23
        * platform/win/Skipped:
24
        * platform/wincairo/Skipped:
25
1
2012-04-27  Marcus Bulach  <bulach@chromium.org>
26
2012-04-27  Marcus Bulach  <bulach@chromium.org>
2
27
3
        [chromium] Update test expectation.
28
        [chromium] Update test expectation.
- a/LayoutTests/fast/dom/HTMLLinkElement/prerender-expected.txt -3 lines
Lines 1-3 a/LayoutTests/fast/dom/HTMLLinkElement/prerender-expected.txt_sec1
1
prefetch.link has MIME type application/octet-stream
2
PASS onload called!
3
This test will only print "PASS" or "FAIL" if link prefetches are enabled, otherwise it will show nothing below.
- a/LayoutTests/fast/dom/HTMLLinkElement/prerender.html -20 lines
Lines 1-20 a/LayoutTests/fast/dom/HTMLLinkElement/prerender.html_sec1
1
<body>
2
<div id="console"></div>
3
<script src="../../js/resources/js-test-pre.js"></script>
4
<script>
5
function prefetch_onload() {
6
    testPassed('onload called!');
7
    layoutTestController.notifyDone();
8
}
9
if (window.layoutTestController) {
10
    layoutTestController.waitUntilDone();
11
    layoutTestController.dumpAsText();
12
    layoutTestController.dumpResourceResponseMIMETypes();
13
}
14
</script>
15
<html>
16
<p>This test will only print "PASS" or "FAIL" if link prefetches are
17
enabled, otherwise it will show nothing below.</p>
18
<link href="prefetch.link" rel="prerender" onload="prefetch_onload()" onerror="testFailed('onerror')" />
19
</html>
20
- a/LayoutTests/platform/gtk/test_expectations.txt -1 lines
Lines 901-907 BUGWKGTK : fast/dom/HTMLLinkElement/prefetch.html = FAIL a/LayoutTests/platform/gtk/test_expectations.txt_sec1
901
BUGWKGTK : fast/dom/HTMLLinkElement/prefetch-beforeload.html = FAIL
901
BUGWKGTK : fast/dom/HTMLLinkElement/prefetch-beforeload.html = FAIL
902
BUGWKGTK : fast/dom/HTMLLinkElement/prefetch-onerror.html = FAIL
902
BUGWKGTK : fast/dom/HTMLLinkElement/prefetch-onerror.html = FAIL
903
BUGWKGTK : fast/dom/HTMLLinkElement/prefetch-onload.html = FAIL
903
BUGWKGTK : fast/dom/HTMLLinkElement/prefetch-onload.html = FAIL
904
BUGWKGTK : fast/dom/HTMLLinkElement/prerender.html = FAIL
905
BUGWKGTK : fast/dom/HTMLLinkElement/subresource.html = FAIL
904
BUGWKGTK : fast/dom/HTMLLinkElement/subresource.html = FAIL
906
905
907
// Tests failing because the context menu is grabbing mouse events.
906
// Tests failing because the context menu is grabbing mouse events.
- a/LayoutTests/platform/mac/Skipped -1 lines
Lines 193-199 fast/dom/HTMLLinkElement/prefetch-beforeload.html a/LayoutTests/platform/mac/Skipped_sec1
193
fast/dom/HTMLLinkElement/prefetch-onerror.html
193
fast/dom/HTMLLinkElement/prefetch-onerror.html
194
fast/dom/HTMLLinkElement/prefetch-onload.html
194
fast/dom/HTMLLinkElement/prefetch-onload.html
195
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
195
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
196
fast/dom/HTMLLinkElement/prerender.html
197
fast/dom/HTMLLinkElement/subresource.html
196
fast/dom/HTMLLinkElement/subresource.html
198
http/tests/misc/link-rel-prefetch-and-subresource.html
197
http/tests/misc/link-rel-prefetch-and-subresource.html
199
http/tests/misc/prefetch-purpose.html
198
http/tests/misc/prefetch-purpose.html
- a/LayoutTests/platform/qt/Skipped -1 lines
Lines 144-150 fast/dom/HTMLLinkElement/prefetch-beforeload.html a/LayoutTests/platform/qt/Skipped_sec1
144
fast/dom/HTMLLinkElement/prefetch-onerror.html
144
fast/dom/HTMLLinkElement/prefetch-onerror.html
145
fast/dom/HTMLLinkElement/prefetch-onload.html
145
fast/dom/HTMLLinkElement/prefetch-onload.html
146
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
146
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
147
fast/dom/HTMLLinkElement/prerender.html
148
fast/dom/HTMLLinkElement/subresource.html
147
fast/dom/HTMLLinkElement/subresource.html
149
http/tests/misc/link-rel-prefetch-and-subresource.html
148
http/tests/misc/link-rel-prefetch-and-subresource.html
150
http/tests/misc/prefetch-purpose.html
149
http/tests/misc/prefetch-purpose.html
- a/LayoutTests/platform/win/Skipped -1 lines
Lines 1098-1104 fast/dom/HTMLLinkElement/prefetch-onerror.html a/LayoutTests/platform/win/Skipped_sec1
1098
fast/dom/HTMLLinkElement/prefetch-onload.html
1098
fast/dom/HTMLLinkElement/prefetch-onload.html
1099
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
1099
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
1100
http/tests/misc/link-rel-prefetch-and-subresource.html
1100
http/tests/misc/link-rel-prefetch-and-subresource.html
1101
fast/dom/HTMLLinkElement/prerender.html
1102
fast/dom/HTMLLinkElement/subresource.html
1101
fast/dom/HTMLLinkElement/subresource.html
1103
http/tests/misc/prefetch-purpose.html
1102
http/tests/misc/prefetch-purpose.html
1104
1103
- a/LayoutTests/platform/wincairo/Skipped -1 lines
Lines 1613-1619 fast/dom/HTMLLinkElement/prefetch-onerror.html a/LayoutTests/platform/wincairo/Skipped_sec1
1613
fast/dom/HTMLLinkElement/prefetch-onload.html
1613
fast/dom/HTMLLinkElement/prefetch-onload.html
1614
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
1614
fast/dom/HTMLLinkElement/prefetch-too-many-clients.html
1615
http/tests/misc/link-rel-prefetch-and-subresource.html
1615
http/tests/misc/link-rel-prefetch-and-subresource.html
1616
fast/dom/HTMLLinkElement/prerender.html
1617
fast/dom/HTMLLinkElement/subresource.html
1616
fast/dom/HTMLLinkElement/subresource.html
1618
http/tests/misc/prefetch-purpose.html
1617
http/tests/misc/prefetch-purpose.html
1619
1618

Return to Bug 85005