OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "Document.h" | 7 #include "Document.h" |
8 #include "DocumentLoader.h" | 8 #include "DocumentLoader.h" |
9 #include "FormState.h" | 9 #include "FormState.h" |
10 #include "Frame.h" | 10 #include "Frame.h" |
11 #include "FrameLoader.h" | 11 #include "FrameLoader.h" |
12 #include "FrameLoadRequest.h" | 12 #include "FrameLoadRequest.h" |
13 #include "HTMLFormElement.h" | 13 #include "HTMLFormElement.h" |
14 #include "HTMLPlugInElement.h" | 14 #include "HTMLPlugInElement.h" |
15 #include "KURL.h" | 15 #include "KURL.h" |
16 #include "PlatformString.h" | 16 #include "PlatformString.h" |
17 #include "ResourceResponse.h" | 17 #include "ResourceResponse.h" |
18 #include "ScriptController.h" | 18 #include "ScriptController.h" |
19 #include "ScriptValue.h" | 19 #include "ScriptValue.h" |
20 #include "Widget.h" | 20 #include "Widget.h" |
21 | 21 |
22 #undef LOG | 22 #undef LOG |
23 #include "base/gfx/rect.h" | 23 #include "base/gfx/rect.h" |
24 #include "base/logging.h" | 24 #include "base/logging.h" |
25 #include "base/message_loop.h" | 25 #include "base/message_loop.h" |
26 #include "base/string_util.h" | 26 #include "base/string_util.h" |
27 //#include "base/sys_string_conversions.h" | |
28 #include "net/base/escape.h" | 27 #include "net/base/escape.h" |
29 #include "webkit/api/public/WebCursorInfo.h" | 28 #include "webkit/api/public/WebCursorInfo.h" |
30 #include "webkit/api/public/WebData.h" | 29 #include "webkit/api/public/WebData.h" |
31 #include "webkit/api/public/WebHTTPBody.h" | 30 #include "webkit/api/public/WebHTTPBody.h" |
32 #include "webkit/api/public/WebHTTPHeaderVisitor.h" | 31 #include "webkit/api/public/WebHTTPHeaderVisitor.h" |
33 #include "webkit/api/public/WebInputEvent.h" | 32 #include "webkit/api/public/WebInputEvent.h" |
34 #include "webkit/api/public/WebKit.h" | 33 #include "webkit/api/public/WebKit.h" |
35 #include "webkit/api/public/WebKitClient.h" | 34 #include "webkit/api/public/WebKitClient.h" |
36 #include "webkit/api/public/WebRect.h" | 35 #include "webkit/api/public/WebRect.h" |
37 #include "webkit/api/public/WebString.h" | 36 #include "webkit/api/public/WebString.h" |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 } | 1134 } |
1136 } | 1135 } |
1137 | 1136 |
1138 void WebPluginImpl::TearDownPluginInstance( | 1137 void WebPluginImpl::TearDownPluginInstance( |
1139 WebURLLoader* loader_to_ignore) { | 1138 WebURLLoader* loader_to_ignore) { |
1140 // The frame maintains a list of JSObjects which are related to this | 1139 // The frame maintains a list of JSObjects which are related to this |
1141 // plugin. Tell the frame we're gone so that it can invalidate all | 1140 // plugin. Tell the frame we're gone so that it can invalidate all |
1142 // of those sub JSObjects. | 1141 // of those sub JSObjects. |
1143 if (frame()) { | 1142 if (frame()) { |
1144 ASSERT(widget_); | 1143 ASSERT(widget_); |
1145 frame()->script()->cleanupScriptObjectsForPlugin(widget_); | 1144 // TODO(darin): Avoid these casts! |
| 1145 frame()->script()->cleanupScriptObjectsForPlugin( |
| 1146 static_cast<WebCore::Widget*>( |
| 1147 static_cast<WebKit::WebPluginContainerImpl*>(widget_))); |
1146 } | 1148 } |
1147 | 1149 |
1148 if (delegate_) { | 1150 if (delegate_) { |
1149 // Call PluginDestroyed() first to prevent the plugin from calling us back | 1151 // Call PluginDestroyed() first to prevent the plugin from calling us back |
1150 // in the middle of tearing down the render tree. | 1152 // in the middle of tearing down the render tree. |
1151 delegate_->PluginDestroyed(); | 1153 delegate_->PluginDestroyed(); |
1152 delegate_ = NULL; | 1154 delegate_ = NULL; |
1153 } | 1155 } |
1154 | 1156 |
1155 // Cancel any pending requests because otherwise this deleted object will | 1157 // Cancel any pending requests because otherwise this deleted object will |
(...skipping 15 matching lines...) Expand all Loading... |
1171 if (resource_client) | 1173 if (resource_client) |
1172 resource_client->DidFail(); | 1174 resource_client->DidFail(); |
1173 } | 1175 } |
1174 | 1176 |
1175 // This needs to be called now and not in the destructor since the | 1177 // This needs to be called now and not in the destructor since the |
1176 // webframe_ might not be valid anymore. | 1178 // webframe_ might not be valid anymore. |
1177 webframe_->set_plugin_delegate(NULL); | 1179 webframe_->set_plugin_delegate(NULL); |
1178 webframe_ = NULL; | 1180 webframe_ = NULL; |
1179 method_factory_.RevokeAll(); | 1181 method_factory_.RevokeAll(); |
1180 } | 1182 } |
OLD | NEW |