Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "web/WebDataSourceImpl.h" | 32 #include "web/WebDataSourceImpl.h" |
| 33 | 33 |
| 34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 35 #include "public/platform/WebURL.h" | 35 #include "public/platform/WebURL.h" |
| 36 #include "public/platform/WebURLError.h" | 36 #include "public/platform/WebURLError.h" |
| 37 #include "public/platform/WebVector.h" | 37 #include "public/platform/WebVector.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 static OwnPtr<WebPluginLoadObserver>& nextPluginLoadObserver() | 41 static OwnPtrWillBePersistent<WebPluginLoadObserver>& nextPluginLoadObserver() |
| 42 { | 42 { |
| 43 DEFINE_STATIC_LOCAL(OwnPtr<WebPluginLoadObserver>, nextPluginLoadObserver, ( )); | 43 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WebPluginLoadObserver>, nextPlugi nLoadObserver, ()); |
| 44 return nextPluginLoadObserver; | 44 return nextPluginLoadObserver; |
|
haraken
2015/11/12 15:51:00
Nit: I remember we discussed before that the nextP
sof
2015/11/12 18:15:35
The code using it in WebPluginContainerImpl::loadF
| |
| 45 } | 45 } |
| 46 | 46 |
| 47 PassRefPtrWillBeRawPtr<WebDataSourceImpl> WebDataSourceImpl::create(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data) | 47 PassRefPtrWillBeRawPtr<WebDataSourceImpl> WebDataSourceImpl::create(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data) |
| 48 { | 48 { |
| 49 return adoptRefWillBeNoop(new WebDataSourceImpl(frame, request, data)); | 49 return adoptRefWillBeNoop(new WebDataSourceImpl(frame, request, data)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 const WebURLRequest& WebDataSourceImpl::originalRequest() const | 52 const WebURLRequest& WebDataSourceImpl::originalRequest() const |
| 53 { | 53 { |
| 54 m_originalRequestWrapper.bind(DocumentLoader::originalRequest()); | 54 m_originalRequestWrapper.bind(DocumentLoader::originalRequest()); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 case NavigationTypeReload: | 130 case NavigationTypeReload: |
| 131 return WebNavigationTypeReload; | 131 return WebNavigationTypeReload; |
| 132 case NavigationTypeFormResubmitted: | 132 case NavigationTypeFormResubmitted: |
| 133 return WebNavigationTypeFormResubmitted; | 133 return WebNavigationTypeFormResubmitted; |
| 134 case NavigationTypeOther: | 134 case NavigationTypeOther: |
| 135 default: | 135 default: |
| 136 return WebNavigationTypeOther; | 136 return WebNavigationTypeOther; |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 void WebDataSourceImpl::setNextPluginLoadObserver(PassOwnPtr<WebPluginLoadObserv er> observer) | 140 void WebDataSourceImpl::setNextPluginLoadObserver(PassOwnPtrWillBeRawPtr<WebPlug inLoadObserver> observer) |
| 141 { | 141 { |
| 142 nextPluginLoadObserver() = observer; | 142 nextPluginLoadObserver() = observer; |
| 143 } | 143 } |
| 144 | 144 |
| 145 WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame, const ResourceRequest& r equest, const SubstituteData& data) | 145 WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame, const ResourceRequest& r equest, const SubstituteData& data) |
| 146 : DocumentLoader(frame, request, data) | 146 : DocumentLoader(frame, request, data) |
| 147 { | 147 { |
| 148 if (!nextPluginLoadObserver()) | 148 if (!nextPluginLoadObserver()) |
| 149 return; | 149 return; |
| 150 // When a new frame is created, it initially gets a data source for an | 150 // When a new frame is created, it initially gets a data source for an |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 168 { | 168 { |
| 169 RefPtrWillBeRawPtr<DocumentLoader> protect(this); | 169 RefPtrWillBeRawPtr<DocumentLoader> protect(this); |
| 170 | 170 |
| 171 DocumentLoader::detachFromFrame(); | 171 DocumentLoader::detachFromFrame(); |
| 172 m_extraData.clear(); | 172 m_extraData.clear(); |
| 173 m_pluginLoadObserver.clear(); | 173 m_pluginLoadObserver.clear(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 DEFINE_TRACE(WebDataSourceImpl) | 176 DEFINE_TRACE(WebDataSourceImpl) |
| 177 { | 177 { |
| 178 visitor->trace(m_pluginLoadObserver); | |
| 178 DocumentLoader::trace(visitor); | 179 DocumentLoader::trace(visitor); |
| 179 } | 180 } |
| 180 | 181 |
| 181 } // namespace blink | 182 } // namespace blink |
| OLD | NEW |