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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "chrome/plugin/plugin_channel.h" | 7 #include "chrome/plugin/plugin_channel.h" |
8 | 8 |
9 #include "chrome/common/plugin_messages.h" | 9 #include "chrome/common/plugin_messages.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 if (log_messages_) { | 59 if (log_messages_) { |
60 LOG(INFO) << "received message @" << &msg << " on channel @" << this | 60 LOG(INFO) << "received message @" << &msg << " on channel @" << this |
61 << " with type " << msg.type(); | 61 << " with type " << msg.type(); |
62 } | 62 } |
63 PluginChannelBase::OnMessageReceived(msg); | 63 PluginChannelBase::OnMessageReceived(msg); |
64 } | 64 } |
65 | 65 |
66 void PluginChannel::OnControlMessageReceived(const IPC::Message& msg) { | 66 void PluginChannel::OnControlMessageReceived(const IPC::Message& msg) { |
67 IPC_BEGIN_MESSAGE_MAP(PluginChannel, msg) | 67 IPC_BEGIN_MESSAGE_MAP(PluginChannel, msg) |
68 IPC_MESSAGE_HANDLER(PluginMsg_CreateInstance, OnCreateInstance) | 68 IPC_MESSAGE_HANDLER(PluginMsg_CreateInstance, OnCreateInstance) |
69 IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginMsg_DestroyInstance, OnDestroyInstance
) | 69 IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginMsg_DestroyInstance, |
| 70 OnDestroyInstance) |
70 IPC_MESSAGE_HANDLER(PluginMsg_GenerateRouteID, OnGenerateRouteID) | 71 IPC_MESSAGE_HANDLER(PluginMsg_GenerateRouteID, OnGenerateRouteID) |
71 IPC_MESSAGE_UNHANDLED_ERROR() | 72 IPC_MESSAGE_UNHANDLED_ERROR() |
72 IPC_END_MESSAGE_MAP() | 73 IPC_END_MESSAGE_MAP() |
73 } | 74 } |
74 | 75 |
75 void PluginChannel::OnCreateInstance(const std::string& mime_type, | 76 void PluginChannel::OnCreateInstance(const std::string& mime_type, |
76 int* instance_id) { | 77 int* instance_id) { |
77 *instance_id = GenerateRouteID(); | 78 *instance_id = GenerateRouteID(); |
78 scoped_refptr<WebPluginDelegateStub> stub = new WebPluginDelegateStub( | 79 scoped_refptr<WebPluginDelegateStub> stub = new WebPluginDelegateStub( |
79 mime_type, *instance_id, this); | 80 mime_type, *instance_id, this); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 RemoveRoute(plugin_stubs_[i]->instance_id()); | 119 RemoveRoute(plugin_stubs_[i]->instance_id()); |
119 | 120 |
120 // Need to addref this object temporarily because otherwise removing the last | 121 // Need to addref this object temporarily because otherwise removing the last |
121 // stub will cause the destructor of this object to be called, however at | 122 // stub will cause the destructor of this object to be called, however at |
122 // that point plugin_stubs_ will have one element and its destructor will be | 123 // that point plugin_stubs_ will have one element and its destructor will be |
123 // called twice. | 124 // called twice. |
124 scoped_refptr<PluginChannel> me(this); | 125 scoped_refptr<PluginChannel> me(this); |
125 | 126 |
126 plugin_stubs_.clear(); | 127 plugin_stubs_.clear(); |
127 } | 128 } |
OLD | NEW |