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 "chrome/plugin/npobject_stub.h" | 5 #include "chrome/plugin/npobject_stub.h" |
6 | 6 |
7 #include "chrome/common/plugin_messages.h" | 7 #include "chrome/common/plugin_messages.h" |
8 #include "chrome/plugin/npobject_util.h" | 8 #include "chrome/plugin/npobject_util.h" |
9 #include "chrome/plugin/plugin_channel_base.h" | 9 #include "chrome/plugin/plugin_channel_base.h" |
10 #include "chrome/renderer/webplugin_delegate_proxy.h" | 10 #include "chrome/renderer/webplugin_delegate_proxy.h" |
11 #include "third_party/npapi/bindings/npapi.h" | 11 #include "third_party/npapi/bindings/npapi.h" |
12 #include "third_party/npapi/bindings/npruntime.h" | 12 #include "third_party/npapi/bindings/npruntime.h" |
13 | 13 |
14 NPObjectStub::NPObjectStub( | 14 NPObjectStub::NPObjectStub( |
15 NPObject* npobject, | 15 NPObject* npobject, |
16 PluginChannelBase* channel, | 16 PluginChannelBase* channel, |
17 int route_id, | 17 int route_id, |
18 base::WaitableEvent* modal_dialog_event) | 18 base::WaitableEvent* modal_dialog_event) |
19 : channel_(channel), | 19 : npobject_(npobject), |
20 npobject_(npobject), | 20 channel_(channel), |
21 route_id_(route_id), | 21 route_id_(route_id), |
22 valid_(true), | 22 valid_(true), |
23 web_plugin_delegate_proxy_(NULL), | 23 web_plugin_delegate_proxy_(NULL), |
24 modal_dialog_event_(modal_dialog_event) { | 24 modal_dialog_event_(modal_dialog_event) { |
25 channel_->AddRoute(route_id, this, true); | 25 channel_->AddRoute(route_id, this, true); |
26 | 26 |
27 // We retain the object just as PluginHost does if everything was in-process. | 27 // We retain the object just as PluginHost does if everything was in-process. |
28 NPN_RetainObject(npobject_); | 28 NPN_RetainObject(npobject_); |
29 } | 29 } |
30 | 30 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 | 298 |
299 void NPObjectStub::OnSetException(const std::string& message) { | 299 void NPObjectStub::OnSetException(const std::string& message) { |
300 if (IsPluginProcess()) { | 300 if (IsPluginProcess()) { |
301 NOTREACHED() << "Should only be called on NPObjects in the renderer"; | 301 NOTREACHED() << "Should only be called on NPObjects in the renderer"; |
302 return; | 302 return; |
303 } | 303 } |
304 | 304 |
305 NPN_SetException(npobject_, message.c_str()); | 305 NPN_SetException(npobject_, message.c_str()); |
306 } | 306 } |
OLD | NEW |