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 19 matching lines...) Expand all Loading... |
30 */ | 30 */ |
31 | 31 |
32 #include "platform/Prerender.h" | 32 #include "platform/Prerender.h" |
33 | 33 |
34 #include "platform/PrerenderClient.h" | 34 #include "platform/PrerenderClient.h" |
35 #include "public/platform/WebPrerender.h" | 35 #include "public/platform/WebPrerender.h" |
36 #include "public/platform/WebPrerenderingSupport.h" | 36 #include "public/platform/WebPrerenderingSupport.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 PassRefPtr<Prerender> Prerender::create(PrerenderClient* client, const KURL& url
, unsigned relTypes, const Referrer& referrer) | |
41 { | |
42 return adoptRef(new Prerender(client, url, relTypes, referrer)); | |
43 } | |
44 | |
45 Prerender::Prerender(PrerenderClient* client, const KURL& url, const unsigned re
lTypes, const Referrer& referrer) | 40 Prerender::Prerender(PrerenderClient* client, const KURL& url, const unsigned re
lTypes, const Referrer& referrer) |
46 : m_client(client) | 41 : m_client(client) |
47 , m_url(url) | 42 , m_url(url) |
48 , m_relTypes(relTypes) | 43 , m_relTypes(relTypes) |
49 , m_referrer(referrer) | 44 , m_referrer(referrer) |
50 { | 45 { |
51 } | 46 } |
52 | 47 |
53 Prerender::~Prerender() | 48 Prerender::~Prerender() |
54 { | 49 { |
55 } | 50 } |
56 | 51 |
57 void Prerender::removeClient() | 52 DEFINE_TRACE(Prerender) |
58 { | 53 { |
59 m_client = 0; | 54 visitor->trace(m_client); |
| 55 } |
| 56 |
| 57 void Prerender::dispose() |
| 58 { |
| 59 m_client = nullptr; |
| 60 m_extraData.clear(); |
60 } | 61 } |
61 | 62 |
62 void Prerender::add() | 63 void Prerender::add() |
63 { | 64 { |
64 if (WebPrerenderingSupport* platform = WebPrerenderingSupport::current()) | 65 if (WebPrerenderingSupport* platform = WebPrerenderingSupport::current()) |
65 platform->add(WebPrerender(this)); | 66 platform->add(WebPrerender(this)); |
66 } | 67 } |
67 | 68 |
68 void Prerender::cancel() | 69 void Prerender::cancel() |
69 { | 70 { |
(...skipping 25 matching lines...) Expand all Loading... |
95 m_client->didSendLoadForPrerender(); | 96 m_client->didSendLoadForPrerender(); |
96 } | 97 } |
97 | 98 |
98 void Prerender::didSendDOMContentLoadedForPrerender() | 99 void Prerender::didSendDOMContentLoadedForPrerender() |
99 { | 100 { |
100 if (m_client) | 101 if (m_client) |
101 m_client->didSendDOMContentLoadedForPrerender(); | 102 m_client->didSendDOMContentLoadedForPrerender(); |
102 } | 103 } |
103 | 104 |
104 } // namespace blink | 105 } // namespace blink |
OLD | NEW |