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 "content/common/npobject_stub.h" | 5 #include "content/common/npobject_stub.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/common/np_channel_base.h" | 8 #include "content/common/np_channel_base.h" |
9 #include "content/common/npobject_util.h" | 9 #include "content/common/npobject_util.h" |
10 #include "content/common/plugin_messages.h" | 10 #include "content/common/plugin_messages.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 bool NPObjectStub::Send(IPC::Message* msg) { | 60 bool NPObjectStub::Send(IPC::Message* msg) { |
61 return channel_->Send(msg); | 61 return channel_->Send(msg); |
62 } | 62 } |
63 | 63 |
64 NPObject* NPObjectStub::GetUnderlyingNPObject() { | 64 NPObject* NPObjectStub::GetUnderlyingNPObject() { |
65 return npobject_; | 65 return npobject_; |
66 } | 66 } |
67 | 67 |
68 IPC::Channel::Listener* NPObjectStub::GetChannelListener() { | 68 IPC::Listener* NPObjectStub::GetChannelListener() { |
69 return static_cast<IPC::Channel::Listener*>(this); | 69 return static_cast<IPC::Listener*>(this); |
70 } | 70 } |
71 | 71 |
72 bool NPObjectStub::OnMessageReceived(const IPC::Message& msg) { | 72 bool NPObjectStub::OnMessageReceived(const IPC::Message& msg) { |
73 content::GetContentClient()->SetActiveURL(page_url_); | 73 content::GetContentClient()->SetActiveURL(page_url_); |
74 if (!npobject_) { | 74 if (!npobject_) { |
75 if (msg.is_sync()) { | 75 if (msg.is_sync()) { |
76 // The object could be garbage because the frame has gone away, so | 76 // The object could be garbage because the frame has gone away, so |
77 // just send an error reply to the caller. | 77 // just send an error reply to the caller. |
78 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); | 78 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); |
79 reply->set_reply_error(); | 79 reply->set_reply_error(); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 391 |
392 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_, | 392 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_, |
393 &script_string, &result_var); | 393 &script_string, &result_var); |
394 | 394 |
395 NPVariant_Param result_param; | 395 NPVariant_Param result_param; |
396 CreateNPVariantParam( | 396 CreateNPVariantParam( |
397 result_var, channel_, &result_param, true, containing_window_, page_url_); | 397 result_var, channel_, &result_param, true, containing_window_, page_url_); |
398 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); | 398 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); |
399 channel_->Send(reply_msg); | 399 channel_->Send(reply_msg); |
400 } | 400 } |
OLD | NEW |