| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "public/platform/WebPrerender.h" | 32 #include "public/platform/WebPrerender.h" |
| 33 | 33 |
| 34 #include "platform/Prerender.h" | 34 #include "platform/Prerender.h" |
| 35 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 class ExtraDataContainer : public blink::Prerender::ExtraData { | 41 class ExtraDataContainer : public Prerender::ExtraData { |
| 42 public: | 42 public: |
| 43 static PassRefPtr<ExtraDataContainer> create(WebPrerender::ExtraData* extraD
ata) { return adoptRef(new ExtraDataContainer(extraData)); } | 43 static PassRefPtr<ExtraDataContainer> create(WebPrerender::ExtraData* extraD
ata) { return adoptRef(new ExtraDataContainer(extraData)); } |
| 44 | 44 |
| 45 virtual ~ExtraDataContainer() { } | 45 virtual ~ExtraDataContainer() { } |
| 46 | 46 |
| 47 WebPrerender::ExtraData* extraData() const { return m_extraData.get(); } | 47 WebPrerender::ExtraData* extraData() const { return m_extraData.get(); } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 explicit ExtraDataContainer(WebPrerender::ExtraData* extraData) | 50 explicit ExtraDataContainer(WebPrerender::ExtraData* extraData) |
| 51 : m_extraData(adoptPtr(extraData)) | 51 : m_extraData(adoptPtr(extraData)) |
| 52 { | 52 { |
| 53 } | 53 } |
| 54 | 54 |
| 55 OwnPtr<WebPrerender::ExtraData> m_extraData; | 55 OwnPtr<WebPrerender::ExtraData> m_extraData; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // anon namespace | 58 } // anon namespace |
| 59 | 59 |
| 60 WebPrerender::WebPrerender(PassRefPtr<blink::Prerender> prerender) | 60 WebPrerender::WebPrerender(PassRefPtr<Prerender> prerender) |
| 61 : m_private(prerender) | 61 : m_private(prerender) |
| 62 { | 62 { |
| 63 } | 63 } |
| 64 | 64 |
| 65 const blink::Prerender* WebPrerender::toPrerender() const | 65 const Prerender* WebPrerender::toPrerender() const |
| 66 { | 66 { |
| 67 return m_private.get(); | 67 return m_private.get(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void WebPrerender::reset() | 70 void WebPrerender::reset() |
| 71 { | 71 { |
| 72 m_private.reset(); | 72 m_private.reset(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void WebPrerender::assign(const WebPrerender& other) | 75 void WebPrerender::assign(const WebPrerender& other) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 102 return static_cast<WebReferrerPolicy>(m_private->referrerPolicy()); | 102 return static_cast<WebReferrerPolicy>(m_private->referrerPolicy()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WebPrerender::setExtraData(WebPrerender::ExtraData* extraData) | 105 void WebPrerender::setExtraData(WebPrerender::ExtraData* extraData) |
| 106 { | 106 { |
| 107 m_private->setExtraData(ExtraDataContainer::create(extraData)); | 107 m_private->setExtraData(ExtraDataContainer::create(extraData)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 const WebPrerender::ExtraData* WebPrerender::extraData() const | 110 const WebPrerender::ExtraData* WebPrerender::extraData() const |
| 111 { | 111 { |
| 112 RefPtr<blink::Prerender::ExtraData> webcoreExtraData = m_private->extraData(
); | 112 RefPtr<Prerender::ExtraData> webcoreExtraData = m_private->extraData(); |
| 113 if (!webcoreExtraData) | 113 if (!webcoreExtraData) |
| 114 return 0; | 114 return 0; |
| 115 return static_cast<ExtraDataContainer*>(webcoreExtraData.get())->extraData()
; | 115 return static_cast<ExtraDataContainer*>(webcoreExtraData.get())->extraData()
; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void WebPrerender::didStartPrerender() | 118 void WebPrerender::didStartPrerender() |
| 119 { | 119 { |
| 120 m_private->didStartPrerender(); | 120 m_private->didStartPrerender(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void WebPrerender::didStopPrerender() | 123 void WebPrerender::didStopPrerender() |
| 124 { | 124 { |
| 125 m_private->didStopPrerender(); | 125 m_private->didStopPrerender(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void WebPrerender::didSendLoadForPrerender() | 128 void WebPrerender::didSendLoadForPrerender() |
| 129 { | 129 { |
| 130 m_private->didSendLoadForPrerender(); | 130 m_private->didSendLoadForPrerender(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void WebPrerender::didSendDOMContentLoadedForPrerender() | 133 void WebPrerender::didSendDOMContentLoadedForPrerender() |
| 134 { | 134 { |
| 135 m_private->didSendDOMContentLoadedForPrerender(); | 135 m_private->didSendDOMContentLoadedForPrerender(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace blink | 138 } // namespace blink |
| OLD | NEW |