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 26 matching lines...) Expand all Loading... |
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 OwnPtr<WebPluginLoadObserver>& nextPluginLoadObserver() |
42 { | 42 { |
43 DEFINE_STATIC_LOCAL(OwnPtr<WebPluginLoadObserver>, nextPluginLoadObserver, (
)); | 43 DEFINE_STATIC_LOCAL(OwnPtr<WebPluginLoadObserver>, nextPluginLoadObserver, (
)); |
44 return nextPluginLoadObserver; | 44 return nextPluginLoadObserver; |
45 } | 45 } |
46 | 46 |
47 PassRefPtr<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 adoptRef(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()); |
55 return m_originalRequestWrapper; | 55 return m_originalRequestWrapper; |
56 } | 56 } |
57 | 57 |
58 const WebURLRequest& WebDataSourceImpl::request() const | 58 const WebURLRequest& WebDataSourceImpl::request() const |
59 { | 59 { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // to wait to attach the WebPluginLoadObserver to that data source. | 153 // to wait to attach the WebPluginLoadObserver to that data source. |
154 if (request.url().isEmpty()) | 154 if (request.url().isEmpty()) |
155 return; | 155 return; |
156 | 156 |
157 ASSERT(nextPluginLoadObserver()->url() == WebURL(request.url())); | 157 ASSERT(nextPluginLoadObserver()->url() == WebURL(request.url())); |
158 m_pluginLoadObserver = nextPluginLoadObserver().release(); | 158 m_pluginLoadObserver = nextPluginLoadObserver().release(); |
159 } | 159 } |
160 | 160 |
161 WebDataSourceImpl::~WebDataSourceImpl() | 161 WebDataSourceImpl::~WebDataSourceImpl() |
162 { | 162 { |
| 163 // Verify that detachFromFrame() has been called. |
| 164 ASSERT(!m_extraData); |
| 165 } |
| 166 |
| 167 void WebDataSourceImpl::detachFromFrame() |
| 168 { |
| 169 RefPtrWillBeRawPtr<DocumentLoader> protect(this); |
| 170 |
| 171 DocumentLoader::detachFromFrame(); |
| 172 m_extraData.clear(); |
| 173 m_pluginLoadObserver.clear(); |
| 174 } |
| 175 |
| 176 DEFINE_TRACE(WebDataSourceImpl) |
| 177 { |
| 178 DocumentLoader::trace(visitor); |
163 } | 179 } |
164 | 180 |
165 } // namespace blink | 181 } // namespace blink |
OLD | NEW |