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> | |
6 | |
7 #include "chrome/plugin/plugin_channel_base.h" | 5 #include "chrome/plugin/plugin_channel_base.h" |
8 | 6 |
9 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
10 #include "chrome/common/child_process.h" | 8 #include "chrome/common/child_process.h" |
11 #include "chrome/common/ipc_sync_message.h" | 9 #include "chrome/common/ipc_sync_message.h" |
12 | 10 |
13 typedef base::hash_map<std::wstring, scoped_refptr<PluginChannelBase> > | 11 typedef base::hash_map<std::wstring, scoped_refptr<PluginChannelBase> > |
14 PluginChannelMap; | 12 PluginChannelMap; |
15 | 13 |
16 static PluginChannelMap g_plugin_channels_; | 14 static PluginChannelMap g_plugin_channels_; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 in_dispatch_(0), | 50 in_dispatch_(0), |
53 send_unblocking_only_during_dispatch_(false) { | 51 send_unblocking_only_during_dispatch_(false) { |
54 } | 52 } |
55 | 53 |
56 PluginChannelBase::~PluginChannelBase() { | 54 PluginChannelBase::~PluginChannelBase() { |
57 } | 55 } |
58 | 56 |
59 void PluginChannelBase::CleanupChannels() { | 57 void PluginChannelBase::CleanupChannels() { |
60 // Make a copy of the references as we can't iterate the map since items will | 58 // Make a copy of the references as we can't iterate the map since items will |
61 // be removed from it as we clean them up. | 59 // be removed from it as we clean them up. |
62 std::vector<scoped_refptr<PluginChannelBase>> channels; | 60 std::vector<scoped_refptr<PluginChannelBase> > channels; |
63 for (PluginChannelMap::const_iterator iter = g_plugin_channels_.begin(); | 61 for (PluginChannelMap::const_iterator iter = g_plugin_channels_.begin(); |
64 iter != g_plugin_channels_.end(); | 62 iter != g_plugin_channels_.end(); |
65 ++iter) { | 63 ++iter) { |
66 channels.push_back(iter->second); | 64 channels.push_back(iter->second); |
67 } | 65 } |
68 | 66 |
69 for (size_t i = 0; i < channels.size(); ++i) | 67 for (size_t i = 0; i < channels.size(); ++i) |
70 channels[i]->CleanUp(); | 68 channels[i]->CleanUp(); |
71 | 69 |
72 // This will clean up channels added to the map for which subsequent | 70 // This will clean up channels added to the map for which subsequent |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 "should override in subclass if you care about control messages"; | 183 "should override in subclass if you care about control messages"; |
186 } | 184 } |
187 | 185 |
188 void PluginChannelBase::OnChannelError() { | 186 void PluginChannelBase::OnChannelError() { |
189 channel_valid_ = false; | 187 channel_valid_ = false; |
190 } | 188 } |
191 | 189 |
192 void PluginChannelBase::SendUnblockingOnlyDuringDispatch() { | 190 void PluginChannelBase::SendUnblockingOnlyDuringDispatch() { |
193 send_unblocking_only_during_dispatch_ = true; | 191 send_unblocking_only_during_dispatch_ = true; |
194 } | 192 } |
OLD | NEW |