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

Side by Side Diff: Source/Platform/chromium/public/WebPrerenderingSupport.h

Issue 14746002: Add WebPrescientNetworking to trigger preconnect from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix coding style Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebPrerenderingSupport_h 31 #ifndef WebPrerenderingSupport_h
32 #define WebPrerenderingSupport_h 32 #define WebPrerenderingSupport_h
33 33
34 #include "WebCommon.h" 34 #include "WebCommon.h"
35 #include "WebPreconnectMotivation.h"
35 36
36 namespace WebKit { 37 namespace WebKit {
37 38
38 class WebPrerender; 39 class WebPrerender;
40 class WebURL;
39 41
40 class WebPrerenderingSupport { 42 class WebPrerenderingSupport {
41 public: 43 public:
42 WEBKIT_EXPORT static void initialize(WebPrerenderingSupport*); 44 WEBKIT_EXPORT static void initialize(WebPrerenderingSupport*);
43 WEBKIT_EXPORT static void shutdown(); 45 WEBKIT_EXPORT static void shutdown();
44 WEBKIT_EXPORT static WebPrerenderingSupport* current(); 46 WEBKIT_EXPORT static WebPrerenderingSupport* current();
45 47
48 // When a page navigation is speculated, preconnect is triggered to hide
49 // session initialization latency to the server providing the page resource.
kouhei (in TOK) 2013/05/09 01:08:34 Changed comment. Does it make sense now?
tkent 2013/05/09 02:33:55 Yeah, it makes sense.
50 virtual void preconnect(const WebURL& url,
51 WebPreconnectMotivation motivation) = 0;
52
46 // A prerender link element is added when it is inserted into a document. 53 // A prerender link element is added when it is inserted into a document.
47 virtual void add(const WebPrerender&) = 0; 54 virtual void add(const WebPrerender&) = 0;
48 55
49 // A prerender is canceled when it is removed from a document. 56 // A prerender is canceled when it is removed from a document.
50 virtual void cancel(const WebPrerender&) = 0; 57 virtual void cancel(const WebPrerender&) = 0;
51 58
52 // A prerender is abandoned when it's navigated away from or suspended in th e page cache. This 59 // A prerender is abandoned when it's navigated away from or suspended in th e page cache. This
53 // is a weaker signal than cancel(), since the launcher hasn't indicated tha t the prerender isn't 60 // is a weaker signal than cancel(), since the launcher hasn't indicated tha t the prerender isn't
54 // wanted, and we may end up using it after, for instance, a short redirect chain. 61 // wanted, and we may end up using it after, for instance, a short redirect chain.
55 virtual void abandon(const WebPrerender&) = 0; 62 virtual void abandon(const WebPrerender&) = 0;
56 63
57 protected: 64 protected:
58 WebPrerenderingSupport() { } 65 WebPrerenderingSupport() { }
59 virtual ~WebPrerenderingSupport() { } 66 virtual ~WebPrerenderingSupport() { }
60 67
61 private: 68 private:
62 static WebPrerenderingSupport* s_platform; 69 static WebPrerenderingSupport* s_platform;
63 }; 70 };
64 71
65 } // namespace WebKit 72 } // namespace WebKit
66 73
67 #endif // WebPrerenderingSupport_h 74 #endif // WebPrerenderingSupport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698