OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // deleted from under us. | 161 // deleted from under us. |
162 scoped_refptr<PluginChannelHost> channel_ref(channel_); | 162 scoped_refptr<PluginChannelHost> channel_ref(channel_); |
163 channel_->Send(new PluginMsg_DidReceiveData(instance_id_, resource_id_, | 163 channel_->Send(new PluginMsg_DidReceiveData(instance_id_, resource_id_, |
164 data, data_offset)); | 164 data, data_offset)); |
165 } | 165 } |
166 | 166 |
167 virtual void DidFinishLoading() OVERRIDE { | 167 virtual void DidFinishLoading() OVERRIDE { |
168 DCHECK(channel_ != NULL); | 168 DCHECK(channel_ != NULL); |
169 channel_->Send(new PluginMsg_DidFinishLoading(instance_id_, resource_id_)); | 169 channel_->Send(new PluginMsg_DidFinishLoading(instance_id_, resource_id_)); |
170 channel_ = NULL; | 170 channel_ = NULL; |
171 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 171 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
172 } | 172 } |
173 | 173 |
174 virtual void DidFail() OVERRIDE { | 174 virtual void DidFail() OVERRIDE { |
175 DCHECK(channel_ != NULL); | 175 DCHECK(channel_ != NULL); |
176 channel_->Send(new PluginMsg_DidFail(instance_id_, resource_id_)); | 176 channel_->Send(new PluginMsg_DidFail(instance_id_, resource_id_)); |
177 channel_ = NULL; | 177 channel_ = NULL; |
178 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 178 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
179 } | 179 } |
180 | 180 |
181 virtual bool IsMultiByteResponseExpected() OVERRIDE { | 181 virtual bool IsMultiByteResponseExpected() OVERRIDE { |
182 return multibyte_response_expected_; | 182 return multibyte_response_expected_; |
183 } | 183 } |
184 | 184 |
185 virtual int ResourceId() OVERRIDE { | 185 virtual int ResourceId() OVERRIDE { |
186 return resource_id_; | 186 return resource_id_; |
187 } | 187 } |
188 | 188 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // If we don't do this then it will linger until the last plugin instance is | 272 // If we don't do this then it will linger until the last plugin instance is |
273 // destroyed. In the meantime, though, the frame that it refers to may have | 273 // destroyed. In the meantime, though, the frame that it refers to may have |
274 // been destroyed by WebKit, at which point WebKit will forcibly deallocate | 274 // been destroyed by WebKit, at which point WebKit will forcibly deallocate |
275 // the window script object. The window script object stub is unique to the | 275 // the window script object. The window script object stub is unique to the |
276 // plugin instance, so this won't affect other instances. | 276 // plugin instance, so this won't affect other instances. |
277 window_script_object_->DeleteSoon(); | 277 window_script_object_->DeleteSoon(); |
278 } | 278 } |
279 | 279 |
280 plugin_ = NULL; | 280 plugin_ = NULL; |
281 | 281 |
282 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 282 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
283 } | 283 } |
284 | 284 |
285 bool WebPluginDelegateProxy::Initialize( | 285 bool WebPluginDelegateProxy::Initialize( |
286 const GURL& url, | 286 const GURL& url, |
287 const std::vector<std::string>& arg_names, | 287 const std::vector<std::string>& arg_names, |
288 const std::vector<std::string>& arg_values, | 288 const std::vector<std::string>& arg_values, |
289 webkit::npapi::WebPlugin* plugin, | 289 webkit::npapi::WebPlugin* plugin, |
290 bool load_manually) { | 290 bool load_manually) { |
291 // TODO(shess): Attempt to work around http://crbug.com/97285 and | 291 // TODO(shess): Attempt to work around http://crbug.com/97285 and |
292 // http://crbug.com/141055 by retrying the connection. Reports seem | 292 // http://crbug.com/141055 by retrying the connection. Reports seem |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 | 1201 |
1202 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1202 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1203 int resource_id) { | 1203 int resource_id) { |
1204 if (!plugin_) | 1204 if (!plugin_) |
1205 return; | 1205 return; |
1206 | 1206 |
1207 plugin_->URLRedirectResponse(allow, resource_id); | 1207 plugin_->URLRedirectResponse(allow, resource_id); |
1208 } | 1208 } |
1209 | 1209 |
1210 } // namespace content | 1210 } // namespace content |
OLD | NEW |