OLD | NEW |
---|---|
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 Loading... | |
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. | |
50 virtual void preconnect(const WebURL& url, | |
51 WebPreconnectMotivation motivation) {} | |
kouhei (in TOK)
2013/05/09 03:19:29
This is to enable Chromium to be compiled before t
tkent
2013/05/09 03:31:16
It's a common way.
However you should put "{ }" (s
kouhei (in TOK)
2013/05/09 03:42:55
Done.
| |
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 |
OLD | NEW |