Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1392)

Side by Side Diff: chrome/plugin/plugin_channel_base.cc

Issue 6334061: Clean up channel modes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up agl's comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ipc/ipc_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698