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

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

Issue 16023019: Only clear script objects during PPAPI WebPluginImpl teardown if it was initialized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | 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) 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 "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/debug/crash_logging.h" 9 #include "base/debug/crash_logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return true; 113 return true;
114 } 114 }
115 115
116 init_data_.reset(); 116 init_data_.reset();
117 container_ = container; 117 container_ = container;
118 return true; 118 return true;
119 } 119 }
120 120
121 void WebPluginImpl::destroy() { 121 void WebPluginImpl::destroy() {
122 // Tell |container_| to clear references to this plugin's script objects. 122 // Tell |container_| to clear references to this plugin's script objects.
123 container_->clearScriptObjects(); 123 if (container_)
124 container_->clearScriptObjects();
124 125
125 if (instance_) { 126 if (instance_) {
126 ::ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); 127 ::ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_);
127 instance_object_ = PP_MakeUndefined(); 128 instance_object_ = PP_MakeUndefined();
128 instance_->Delete(); 129 instance_->Delete();
129 instance_ = NULL; 130 instance_ = NULL;
130 } 131 }
131 132
132 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 133 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
133 } 134 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 void WebPluginImpl::rotateView(RotationType type) { 296 void WebPluginImpl::rotateView(RotationType type) {
296 instance_->RotateView(type); 297 instance_->RotateView(type);
297 } 298 }
298 299
299 bool WebPluginImpl::isPlaceholder() { 300 bool WebPluginImpl::isPlaceholder() {
300 return false; 301 return false;
301 } 302 }
302 303
303 } // namespace ppapi 304 } // namespace ppapi
304 } // namespace webkit 305 } // namespace webkit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698