| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 pp_instance_ = ResourceTracker::Get()->AddInstance(this); | 253 pp_instance_ = ResourceTracker::Get()->AddInstance(this); |
| 254 | 254 |
| 255 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 255 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
| 256 DCHECK(delegate); | 256 DCHECK(delegate); |
| 257 module_->InstanceCreated(this); | 257 module_->InstanceCreated(this); |
| 258 delegate_->InstanceCreated(this); | 258 delegate_->InstanceCreated(this); |
| 259 message_channel_.reset(new MessageChannel(this)); | 259 message_channel_.reset(new MessageChannel(this)); |
| 260 } | 260 } |
| 261 | 261 |
| 262 PluginInstance::~PluginInstance() { | 262 PluginInstance::~PluginInstance() { |
| 263 DCHECK(!fullscreen_container_); |
| 264 |
| 263 // Free all the plugin objects. This will automatically clear the back- | 265 // Free all the plugin objects. This will automatically clear the back- |
| 264 // pointer from the NPObject so WebKit can't call into the plugin any more. | 266 // pointer from the NPObject so WebKit can't call into the plugin any more. |
| 265 // | 267 // |
| 266 // Swap out the set so we can delete from it (the objects will try to | 268 // Swap out the set so we can delete from it (the objects will try to |
| 267 // unregister themselves inside the delete call). | 269 // unregister themselves inside the delete call). |
| 268 PluginObjectSet plugin_object_copy; | 270 PluginObjectSet plugin_object_copy; |
| 269 live_plugin_objects_.swap(plugin_object_copy); | 271 live_plugin_objects_.swap(plugin_object_copy); |
| 270 for (PluginObjectSet::iterator i = plugin_object_copy.begin(); | 272 for (PluginObjectSet::iterator i = plugin_object_copy.begin(); |
| 271 i != plugin_object_copy.end(); ++i) | 273 i != plugin_object_copy.end(); ++i) |
| 272 delete *i; | 274 delete *i; |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 } | 1718 } |
| 1717 WebKit::WebDocument main_document = | 1719 WebKit::WebDocument main_document = |
| 1718 containing_document.frame()->view()->mainFrame()->document(); | 1720 containing_document.frame()->view()->mainFrame()->document(); |
| 1719 | 1721 |
| 1720 return containing_document.securityOrigin().canAccess( | 1722 return containing_document.securityOrigin().canAccess( |
| 1721 main_document.securityOrigin()); | 1723 main_document.securityOrigin()); |
| 1722 } | 1724 } |
| 1723 | 1725 |
| 1724 } // namespace ppapi | 1726 } // namespace ppapi |
| 1725 } // namespace webkit | 1727 } // namespace webkit |
| OLD | NEW |