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

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

Issue 7655006: Revert 97050 - Add PluginMessageLoopProxy and use it for Host plugin UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/plugin/host_script_object.cc ('k') | remoting/remoting.gyp » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This is an application of a minimal host process in a Chromoting 5 // This is an application of a minimal host process in a Chromoting
6 // system. It serves the purpose of gluing different pieces together 6 // system. It serves the purpose of gluing different pieces together
7 // to make a functional host process for testing. 7 // to make a functional host process for testing.
8 // 8 //
9 // It peforms the following functionality: 9 // It peforms the following functionality:
10 // 1. Connect to the GTalk network and register the machine as a host. 10 // 1. Connect to the GTalk network and register the machine as a host.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 : fake_(false), 97 : fake_(false),
98 is_it2me_(false) { 98 is_it2me_(false) {
99 } 99 }
100 100
101 int Run() { 101 int Run() {
102 // |message_loop| is declared early so that any code we call into which 102 // |message_loop| is declared early so that any code we call into which
103 // requires a current message-loop won't complain. 103 // requires a current message-loop won't complain.
104 // It needs to be a UI message loop to keep runloops spinning on the Mac. 104 // It needs to be a UI message loop to keep runloops spinning on the Mac.
105 MessageLoop message_loop(MessageLoop::TYPE_UI); 105 MessageLoop message_loop(MessageLoop::TYPE_UI);
106 106
107 remoting::ChromotingHostContext context( 107 remoting::ChromotingHostContext context;
108 base::MessageLoopProxy::current()); 108 // static_cast needed to resolve overloaded PostTask member-function.
109 context.SetUITaskPostFunction(base::Bind(
110 static_cast<void(MessageLoop::*)(
111 const tracked_objects::Location&,
112 const base::Closure&)>(&MessageLoop::PostTask),
113 base::Unretained(&message_loop)));
109 context.Start(); 114 context.Start();
110 115
111 base::Thread file_io_thread("FileIO"); 116 base::Thread file_io_thread("FileIO");
112 file_io_thread.Start(); 117 file_io_thread.Start();
113 118
114 FilePath config_path = GetConfigPath(); 119 FilePath config_path = GetConfigPath();
115 scoped_refptr<remoting::JsonHostConfig> config = 120 scoped_refptr<remoting::JsonHostConfig> config =
116 new remoting::JsonHostConfig( 121 new remoting::JsonHostConfig(
117 config_path, file_io_thread.message_loop_proxy()); 122 config_path, file_io_thread.message_loop_proxy());
118 if (!config->Read()) { 123 if (!config->Read()) {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 LOG(ERROR) << "Unknown video codec: " << video_codec; 320 LOG(ERROR) << "Unknown video codec: " << video_codec;
316 return 1; 321 return 1;
317 } 322 }
318 config->mutable_video_configs()->push_back(ChannelConfig( 323 config->mutable_video_configs()->push_back(ChannelConfig(
319 transport, remoting::protocol::kDefaultStreamVersion, codec)); 324 transport, remoting::protocol::kDefaultStreamVersion, codec));
320 simple_host.set_protocol_config(config.release()); 325 simple_host.set_protocol_config(config.release());
321 } 326 }
322 327
323 return simple_host.Run(); 328 return simple_host.Run();
324 } 329 }
OLDNEW
« no previous file with comments | « remoting/host/plugin/host_script_object.cc ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698