Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 8198013: Fix the bug that closing a tab which owns a fullscreen Flash widget causes crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes in response to Antoine's comments. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget_fullscreen_pepper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
253 pp_instance_ = ResourceTracker::Get()->AddInstance(this); 253 pp_instance_ = ResourceTracker::Get()->AddInstance(this);
254 254
255 memset(&current_print_settings_, 0, sizeof(current_print_settings_)); 255 memset(&current_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
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
OLDNEW
« no previous file with comments | « content/renderer/render_widget_fullscreen_pepper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698