OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/plugin_channel_base.h" | 5 #include "chrome/plugin/plugin_channel_base.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (iter == g_plugin_channels_.end()) { | 37 if (iter == g_plugin_channels_.end()) { |
38 channel = factory(); | 38 channel = factory(); |
39 } else { | 39 } else { |
40 channel = iter->second; | 40 channel = iter->second; |
41 } | 41 } |
42 | 42 |
43 DCHECK(channel != NULL); | 43 DCHECK(channel != NULL); |
44 | 44 |
45 if (!channel->channel_valid()) { | 45 if (!channel->channel_valid()) { |
46 channel->channel_handle_ = channel_handle; | 46 channel->channel_handle_ = channel_handle; |
47 if (mode == IPC::Channel::MODE_SERVER) { | 47 if (mode & IPC::Channel::MODE_SERVER_FLAG) { |
48 channel->channel_handle_.name.append("."); | 48 channel->channel_handle_.name.append("."); |
49 channel->channel_handle_.name.append(base::IntToString(next_pipe_id++)); | 49 channel->channel_handle_.name.append(base::IntToString(next_pipe_id++)); |
50 } | 50 } |
51 channel->mode_ = mode; | 51 channel->mode_ = mode; |
52 if (channel->Init(ipc_message_loop, create_pipe_now)) { | 52 if (channel->Init(ipc_message_loop, create_pipe_now)) { |
53 g_plugin_channels_[channel_key] = channel; | 53 g_plugin_channels_[channel_key] = channel; |
54 } else { | 54 } else { |
55 channel = NULL; | 55 channel = NULL; |
56 } | 56 } |
57 } | 57 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 bool PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) { | 233 bool PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) { |
234 NOTREACHED() << | 234 NOTREACHED() << |
235 "should override in subclass if you care about control messages"; | 235 "should override in subclass if you care about control messages"; |
236 return false; | 236 return false; |
237 } | 237 } |
238 | 238 |
239 void PluginChannelBase::OnChannelError() { | 239 void PluginChannelBase::OnChannelError() { |
240 channel_valid_ = false; | 240 channel_valid_ = false; |
241 } | 241 } |
OLD | NEW |