OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/service/service_process_control.h" | 5 #include "chrome/browser/service/service_process_control.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/thread.h" | 10 #include "base/thread.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Saves the task. | 96 // Saves the task. |
97 connect_done_task_.reset(task); | 97 connect_done_task_.reset(task); |
98 ConnectInternal(); | 98 ConnectInternal(); |
99 } | 99 } |
100 | 100 |
101 void ServiceProcessControl::ConnectInternal() { | 101 void ServiceProcessControl::ConnectInternal() { |
102 LOG(INFO) << "Connecting to Service Process IPC Server"; | 102 LOG(INFO) << "Connecting to Service Process IPC Server"; |
103 // Run the IPC channel on the shared IO thread. | 103 // Run the IPC channel on the shared IO thread. |
104 base::Thread* io_thread = g_browser_process->io_thread(); | 104 base::Thread* io_thread = g_browser_process->io_thread(); |
105 | 105 |
106 // TODO(hclam): Determine the the channel id from profile and type. | |
107 // TODO(hclam): Handle error connecting to channel. | 106 // TODO(hclam): Handle error connecting to channel. |
108 const std::string channel_id = GetServiceProcessChannelName(type_); | 107 const std::string channel_id = GetServiceProcessChannelName(); |
109 channel_.reset( | 108 channel_.reset( |
110 new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this, NULL, | 109 new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this, NULL, |
111 io_thread->message_loop(), true, | 110 io_thread->message_loop(), true, |
112 g_browser_process->shutdown_event())); | 111 g_browser_process->shutdown_event())); |
113 channel_->set_sync_messages_with_no_timeout_allowed(false); | 112 channel_->set_sync_messages_with_no_timeout_allowed(false); |
114 } | 113 } |
115 | 114 |
116 void ServiceProcessControl::Launch(Task* task) { | 115 void ServiceProcessControl::Launch(Task* task) { |
117 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 116 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
118 if (channel_.get()) { | 117 if (channel_.get()) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 bool ServiceProcessControl::EnableRemotingWithTokens( | 219 bool ServiceProcessControl::EnableRemotingWithTokens( |
221 const std::string& user, | 220 const std::string& user, |
222 const std::string& remoting_token, | 221 const std::string& remoting_token, |
223 const std::string& talk_token) { | 222 const std::string& talk_token) { |
224 return Send( | 223 return Send( |
225 new ServiceMsg_EnableRemotingWithTokens(user, remoting_token, | 224 new ServiceMsg_EnableRemotingWithTokens(user, remoting_token, |
226 talk_token)); | 225 talk_token)); |
227 } | 226 } |
228 | 227 |
229 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); | 228 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); |
OLD | NEW |