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

Side by Side Diff: apps/app_shim/chrome_main_app_mode_mac.mm

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // On Mac, one can't make shortcuts with command-line arguments. Instead, we 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we
6 // produce small app bundles which locate the Chromium framework and load it, 6 // produce small app bundles which locate the Chromium framework and load it,
7 // passing the appropriate data. This is the entry point into the framework for 7 // passing the appropriate data. This is the entry point into the framework for
8 // those app bundles. 8 // those app bundles.
9 9
10 #import <Cocoa/Cocoa.h> 10 #import <Cocoa/Cocoa.h>
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 app_mode::VerifySocketPermissions(socket_path); 209 app_mode::VerifySocketPermissions(socket_path);
210 210
211 CreateChannelAndSendLaunchApp(socket_path); 211 CreateChannelAndSendLaunchApp(socket_path);
212 } 212 }
213 213
214 void AppShimController::CreateChannelAndSendLaunchApp( 214 void AppShimController::CreateChannelAndSendLaunchApp(
215 const base::FilePath& socket_path) { 215 const base::FilePath& socket_path) {
216 IPC::ChannelHandle handle(socket_path.value()); 216 IPC::ChannelHandle handle(socket_path.value());
217 channel_.reset( 217 channel_ = IPC::ChannelProxy::Create(handle,
218 new IPC::ChannelProxy(handle, 218 IPC::Channel::MODE_NAMED_CLIENT,
219 IPC::Channel::MODE_NAMED_CLIENT, 219 this,
220 this, 220 g_io_thread->message_loop_proxy().get());
221 g_io_thread->message_loop_proxy().get()));
222 221
223 bool launched_by_chrome = 222 bool launched_by_chrome =
224 CommandLine::ForCurrentProcess()->HasSwitch( 223 CommandLine::ForCurrentProcess()->HasSwitch(
225 app_mode::kLaunchedByChromeProcessId); 224 app_mode::kLaunchedByChromeProcessId);
226 apps::AppShimLaunchType launch_type = launched_by_chrome ? 225 apps::AppShimLaunchType launch_type = launched_by_chrome ?
227 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; 226 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL;
228 227
229 [delegate_ setController:this]; 228 [delegate_ setController:this];
230 229
231 std::vector<base::FilePath> files; 230 std::vector<base::FilePath> files;
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // minute. 665 // minute.
667 main_message_loop.PostTask( 666 main_message_loop.PostTask(
668 FROM_HERE, 667 FROM_HERE,
669 base::Bind(&AppShimController::Init, 668 base::Bind(&AppShimController::Init,
670 base::Unretained(&controller))); 669 base::Unretained(&controller)));
671 } 670 }
672 671
673 main_message_loop.Run(); 672 main_message_loop.Run();
674 return 0; 673 return 0;
675 } 674 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698