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

Side by Side Diff: sky/tools/skydb

Issue 743603004: Make skydb chromoting aware (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import logging 7 import logging
8 import os 8 import os
9 from skypy.paths import Paths 9 from skypy.paths import Paths
10 import socket; 10 import socket;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 else: 51 else:
52 server_command = [ 52 server_command = [
53 os.path.join(self.paths.sky_tools_directory, 'sky_server'), 53 os.path.join(self.paths.sky_tools_directory, 'sky_server'),
54 '--debug', 54 '--debug',
55 server_root, 55 server_root,
56 str(HTTP_PORT), 56 str(HTTP_PORT),
57 ] 57 ]
58 self._sky_server = subprocess.Popen(server_command) 58 self._sky_server = subprocess.Popen(server_command)
59 return 'http://localhost:%s/%s' % (HTTP_PORT, relative_path) 59 return 'http://localhost:%s/%s' % (HTTP_PORT, relative_path)
60 60
61 def _in_chromoting(self):
62 return os.environ.get('CHROME_REMOTE_DESKTOP_SESSION', False)
63
61 def main(self): 64 def main(self):
62 logging.basicConfig(level=logging.INFO) 65 logging.basicConfig(level=logging.INFO)
63 66
64 parser = argparse.ArgumentParser(description='Sky launcher/debugger') 67 parser = argparse.ArgumentParser(description='Sky launcher/debugger')
65 parser.add_argument('--gdb', action='store_true') 68 parser.add_argument('--gdb', action='store_true')
66 parser.add_argument('--use-osmesa', action='store_true') 69 parser.add_argument('--use-osmesa', action='store_true',
70 default=self._in_chromoting())
67 parser.add_argument('url', nargs='?', type=str) 71 parser.add_argument('url', nargs='?', type=str)
68 args = parser.parse_args() 72 args = parser.parse_args()
69 73
70 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') 74 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer')
71 for mime_type in SUPPORTED_MIME_TYPES] 75 for mime_type in SUPPORTED_MIME_TYPES]
72 shell_command = [ 76 shell_command = [
73 self.paths.mojo_shell_path, 77 self.paths.mojo_shell_path,
74 '--v=1', 78 '--v=1',
75 '--content-handlers=%s' % ','.join(content_handlers), 79 '--content-handlers=%s' % ','.join(content_handlers),
76 '--url-mappings=mojo:window_manager=mojo:sky_debugger', 80 '--url-mappings=mojo:window_manager=mojo:sky_debugger',
(...skipping 20 matching lines...) Expand all
97 101
98 102
99 if __name__ == '__main__': 103 if __name__ == '__main__':
100 skydb = SkyDebugger() 104 skydb = SkyDebugger()
101 try: 105 try:
102 skydb.main() 106 skydb.main()
103 except (KeyboardInterrupt, SystemExit): 107 except (KeyboardInterrupt, SystemExit):
104 pass 108 pass
105 finally: 109 finally:
106 skydb.shutdown() 110 skydb.shutdown()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698