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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |