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 "content/common/np_channel_base.h" | 7 #include "content/common/np_channel_base.h" |
8 #include "content/common/npobject_util.h" | 8 #include "content/common/npobject_util.h" |
9 #include "content/common/plugin_messages.h" | 9 #include "content/common/plugin_messages.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 channel_->RemoveMappingForNPObjectStub(route_id_, npobject_); | 51 channel_->RemoveMappingForNPObjectStub(route_id_, npobject_); |
52 | 52 |
53 // We need to NULL npobject_ prior to calling releaseObject() to avoid | 53 // We need to NULL npobject_ prior to calling releaseObject() to avoid |
54 // problems with re-entrancy. See http://crbug.com/94179#c17 for more | 54 // problems with re-entrancy. See http://crbug.com/94179#c17 for more |
55 // details on how this can happen. | 55 // details on how this can happen. |
56 NPObject* npobject = npobject_; | 56 NPObject* npobject = npobject_; |
57 npobject_ = NULL; | 57 npobject_ = NULL; |
58 | 58 |
59 WebBindings::releaseObject(npobject); | 59 WebBindings::releaseObject(npobject); |
60 | 60 |
61 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 61 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 bool NPObjectStub::Send(IPC::Message* msg) { | 65 bool NPObjectStub::Send(IPC::Message* msg) { |
66 return channel_->Send(msg); | 66 return channel_->Send(msg); |
67 } | 67 } |
68 | 68 |
69 NPObject* NPObjectStub::GetUnderlyingNPObject() { | 69 NPObject* NPObjectStub::GetUnderlyingNPObject() { |
70 return npobject_; | 70 return npobject_; |
71 } | 71 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 &script_string, &result_var); | 394 &script_string, &result_var); |
395 | 395 |
396 NPVariant_Param result_param; | 396 NPVariant_Param result_param; |
397 CreateNPVariantParam( | 397 CreateNPVariantParam( |
398 result_var, channel_, &result_param, true, render_view_id_, page_url_); | 398 result_var, channel_, &result_param, true, render_view_id_, page_url_); |
399 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); | 399 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); |
400 channel_->Send(reply_msg); | 400 channel_->Send(reply_msg); |
401 } | 401 } |
402 | 402 |
403 } // namespace content | 403 } // namespace content |
OLD | NEW |