| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const { | 93 void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const { |
| 94 result.assign(m_redirectChain); | 94 result.assign(m_redirectChain); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool WebDataSourceImpl::isClientRedirect() const { | 97 bool WebDataSourceImpl::isClientRedirect() const { |
| 98 return DocumentLoader::isClientRedirect(); | 98 return DocumentLoader::isClientRedirect(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool WebDataSourceImpl::replacesCurrentHistoryItem() const { | |
| 102 return DocumentLoader::replacesCurrentHistoryItem(); | |
| 103 } | |
| 104 | |
| 105 WebNavigationType WebDataSourceImpl::navigationType() const { | |
| 106 return toWebNavigationType(DocumentLoader::getNavigationType()); | |
| 107 } | |
| 108 | |
| 109 WebDataSource::ExtraData* WebDataSourceImpl::getExtraData() const { | 101 WebDataSource::ExtraData* WebDataSourceImpl::getExtraData() const { |
| 110 return m_extraData.get(); | 102 return m_extraData.get(); |
| 111 } | 103 } |
| 112 | 104 |
| 113 void WebDataSourceImpl::setExtraData(ExtraData* extraData) { | 105 void WebDataSourceImpl::setExtraData(ExtraData* extraData) { |
| 114 // extraData can't be a std::unique_ptr because setExtraData is a WebKit API | 106 // extraData can't be a std::unique_ptr because setExtraData is a WebKit API |
| 115 // function. | 107 // function. |
| 116 m_extraData = WTF::wrapUnique(extraData); | 108 m_extraData = WTF::wrapUnique(extraData); |
| 117 } | 109 } |
| 118 | 110 |
| 119 void WebDataSourceImpl::setNavigationStartTime(double navigationStart) { | 111 void WebDataSourceImpl::setNavigationStartTime(double navigationStart) { |
| 120 timing().setNavigationStart(navigationStart); | 112 timing().setNavigationStart(navigationStart); |
| 121 } | 113 } |
| 122 | 114 |
| 123 WebNavigationType WebDataSourceImpl::toWebNavigationType(NavigationType type) { | |
| 124 switch (type) { | |
| 125 case NavigationTypeLinkClicked: | |
| 126 return WebNavigationTypeLinkClicked; | |
| 127 case NavigationTypeFormSubmitted: | |
| 128 return WebNavigationTypeFormSubmitted; | |
| 129 case NavigationTypeBackForward: | |
| 130 return WebNavigationTypeBackForward; | |
| 131 case NavigationTypeReload: | |
| 132 return WebNavigationTypeReload; | |
| 133 case NavigationTypeFormResubmitted: | |
| 134 return WebNavigationTypeFormResubmitted; | |
| 135 case NavigationTypeOther: | |
| 136 default: | |
| 137 return WebNavigationTypeOther; | |
| 138 } | |
| 139 } | |
| 140 | |
| 141 WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame, | 115 WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame, |
| 142 const ResourceRequest& request, | 116 const ResourceRequest& request, |
| 143 const SubstituteData& data, | 117 const SubstituteData& data, |
| 144 ClientRedirectPolicy clientRedirectPolicy) | 118 ClientRedirectPolicy clientRedirectPolicy) |
| 145 : DocumentLoader(frame, request, data, clientRedirectPolicy), | 119 : DocumentLoader(frame, request, data, clientRedirectPolicy), |
| 146 m_originalRequestWrapper(DocumentLoader::originalRequest()), | 120 m_originalRequestWrapper(DocumentLoader::originalRequest()), |
| 147 m_requestWrapper(DocumentLoader::getRequest()), | 121 m_requestWrapper(DocumentLoader::getRequest()), |
| 148 m_responseWrapper(DocumentLoader::response()) {} | 122 m_responseWrapper(DocumentLoader::response()) {} |
| 149 | 123 |
| 150 WebDataSourceImpl::~WebDataSourceImpl() { | 124 WebDataSourceImpl::~WebDataSourceImpl() { |
| 151 // Verify that detachFromFrame() has been called. | 125 // Verify that detachFromFrame() has been called. |
| 152 DCHECK(!m_extraData); | 126 DCHECK(!m_extraData); |
| 153 } | 127 } |
| 154 | 128 |
| 155 void WebDataSourceImpl::detachFromFrame() { | 129 void WebDataSourceImpl::detachFromFrame() { |
| 156 DocumentLoader::detachFromFrame(); | 130 DocumentLoader::detachFromFrame(); |
| 157 m_extraData.reset(); | 131 m_extraData.reset(); |
| 158 } | 132 } |
| 159 | 133 |
| 160 void WebDataSourceImpl::setSubresourceFilter( | 134 void WebDataSourceImpl::setSubresourceFilter( |
| 161 WebDocumentSubresourceFilter* subresourceFilter) { | 135 WebDocumentSubresourceFilter* subresourceFilter) { |
| 162 DocumentLoader::setSubresourceFilter(WTF::wrapUnique(subresourceFilter)); | 136 DocumentLoader::setSubresourceFilter(WTF::wrapUnique(subresourceFilter)); |
| 163 } | 137 } |
| 164 | 138 |
| 165 DEFINE_TRACE(WebDataSourceImpl) { | 139 DEFINE_TRACE(WebDataSourceImpl) { |
| 166 DocumentLoader::trace(visitor); | 140 DocumentLoader::trace(visitor); |
| 167 } | 141 } |
| 168 | 142 |
| 169 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |