Chromium Code Reviews

Side by Side Diff: chrome/service/service_process.cc

Issue 4971003: Inject MessageLoop into Capturer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/capturer.h » ('j') | remoting/host/capturer.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/service/service_process.h" 5 #include "chrome/service/service_process.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 271 matching lines...)
282 // Start the chromoting context first. 282 // Start the chromoting context first.
283 chromoting_context_.reset(new remoting::ChromotingHostContext()); 283 chromoting_context_.reset(new remoting::ChromotingHostContext());
284 chromoting_context_->Start(); 284 chromoting_context_->Start();
285 285
286 // Create capturer and executor. The ownership will be transfered 286 // Create capturer and executor. The ownership will be transfered
287 // to the chromoting host. 287 // to the chromoting host.
288 scoped_ptr<remoting::Capturer> capturer; 288 scoped_ptr<remoting::Capturer> capturer;
289 scoped_ptr<remoting::protocol::InputStub> input_stub; 289 scoped_ptr<remoting::protocol::InputStub> input_stub;
290 290
291 #if defined(OS_WIN) 291 #if defined(OS_WIN)
292 capturer.reset(new remoting::CapturerGdi()); 292 capturer.reset(new remoting::CapturerGdi(
293 chromoting_context_->capture_message_loop()));
293 input_stub.reset(new remoting::EventExecutorWin( 294 input_stub.reset(new remoting::EventExecutorWin(
294 chromoting_context_->capture_message_loop(), capturer.get())); 295 chromoting_context_->capture_message_loop(), capturer.get()));
295 #elif defined(OS_LINUX) 296 #elif defined(OS_LINUX)
296 capturer.reset(new remoting::CapturerLinux()); 297 capturer.reset(new remoting::CapturerLinux(
298 chromoting_context_->capture_message_loop()));
297 input_stub.reset(new remoting::EventExecutorLinux( 299 input_stub.reset(new remoting::EventExecutorLinux(
298 chromoting_context_->capture_message_loop(), capturer.get())); 300 chromoting_context_->capture_message_loop(), capturer.get()));
299 #elif defined(OS_MACOSX) 301 #elif defined(OS_MACOSX)
300 capturer.reset(new remoting::CapturerMac()); 302 capturer.reset(new remoting::CapturerMac(
303 chromoting_context_->capture_message_loop()));
301 input_stub.reset(new remoting::EventExecutorMac( 304 input_stub.reset(new remoting::EventExecutorMac(
302 chromoting_context_->capture_message_loop(), capturer.get())); 305 chromoting_context_->capture_message_loop(), capturer.get()));
303 #endif 306 #endif
304 307
305 // Create a chromoting host object. 308 // Create a chromoting host object.
306 chromoting_host_ = new remoting::ChromotingHost(chromoting_context_.get(), 309 chromoting_host_ = new remoting::ChromotingHost(chromoting_context_.get(),
307 chromoting_config_, 310 chromoting_config_,
308 capturer.release(), 311 capturer.release(),
309 input_stub.release()); 312 input_stub.release());
310 313
(...skipping 109 matching lines...)
420 #endif 423 #endif
421 424
422 ServiceProcess::~ServiceProcess() { 425 ServiceProcess::~ServiceProcess() {
423 Teardown(); 426 Teardown();
424 g_service_process = NULL; 427 g_service_process = NULL;
425 } 428 }
426 429
427 // Disable refcounting for runnable method because it is really not needed 430 // Disable refcounting for runnable method because it is really not needed
428 // when we post tasks on the main message loop. 431 // when we post tasks on the main message loop.
429 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); 432 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess);
OLDNEW
« no previous file with comments | « no previous file | remoting/host/capturer.h » ('j') | remoting/host/capturer.h » ('J')

Powered by Google App Engine