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

Side by Side Diff: remoting/host/desktop_environment.cc

Issue 9829006: [chromoting] Fix crash when generating access code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 8 years, 9 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 | « remoting/host/desktop_environment.h ('k') | remoting/host/remoting_me2me_host.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/desktop_environment.h" 5 #include "remoting/host/desktop_environment.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "remoting/host/capturer.h" 9 #include "remoting/host/capturer.h"
10 #include "remoting/host/chromoting_host.h" 10 #include "remoting/host/chromoting_host.h"
(...skipping 12 matching lines...) Expand all
23 scoped_ptr<Capturer> capturer(Capturer::Create()); 23 scoped_ptr<Capturer> capturer(Capturer::Create());
24 scoped_ptr<protocol::HostEventStub> event_executor = 24 scoped_ptr<protocol::HostEventStub> event_executor =
25 EventExecutor::Create(context->desktop_message_loop(), 25 EventExecutor::Create(context->desktop_message_loop(),
26 capturer.get()); 26 capturer.get());
27 27
28 if (capturer.get() == NULL || event_executor.get() == NULL) { 28 if (capturer.get() == NULL || event_executor.get() == NULL) {
29 LOG(ERROR) << "Unable to create DesktopEnvironment"; 29 LOG(ERROR) << "Unable to create DesktopEnvironment";
30 return scoped_ptr<DesktopEnvironment>(); 30 return scoped_ptr<DesktopEnvironment>();
31 } 31 }
32 32
33 return scoped_ptr<DesktopEnvironment>(
34 new DesktopEnvironment(context,
35 capturer.Pass(),
36 event_executor.Pass()));
37 }
38
39 // static
40 scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService(
41 ChromotingHostContext* context) {
42 scoped_ptr<Capturer> capturer(Capturer::Create());
43 scoped_ptr<protocol::HostEventStub> event_executor =
44 EventExecutor::Create(context->desktop_message_loop(),
45 capturer.get());
46
47 if (capturer.get() == NULL || event_executor.get() == NULL) {
48 LOG(ERROR) << "Unable to create DesktopEnvironment";
49 return scoped_ptr<DesktopEnvironment>();
50 }
51
33 #if defined(OS_WIN) 52 #if defined(OS_WIN)
34 event_executor.reset(new SessionEventExecutorWin( 53 event_executor.reset(new SessionEventExecutorWin(
35 context->desktop_message_loop(), 54 context->desktop_message_loop(),
36 context->io_message_loop(), 55 context->io_message_loop(),
37 event_executor.Pass())); 56 event_executor.Pass()));
38 #endif 57 #endif
39 58
40 return scoped_ptr<DesktopEnvironment>( 59 return scoped_ptr<DesktopEnvironment>(
41 new DesktopEnvironment(context, 60 new DesktopEnvironment(context,
42 capturer.Pass(), 61 capturer.Pass(),
(...skipping 18 matching lines...) Expand all
61 : host_(NULL), 80 : host_(NULL),
62 context_(context), 81 context_(context),
63 capturer_(capturer.Pass()), 82 capturer_(capturer.Pass()),
64 event_executor_(event_executor.Pass()) { 83 event_executor_(event_executor.Pass()) {
65 } 84 }
66 85
67 DesktopEnvironment::~DesktopEnvironment() { 86 DesktopEnvironment::~DesktopEnvironment() {
68 } 87 }
69 88
70 } // namespace remoting 89 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_environment.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698