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

Side by Side Diff: chrome/test/data/native_messaging/empty_app.py

Issue 12285015: Require manifests for native messaging hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 # This native client will read full messages, but do nothing with them and 6 # This native client will read full messages, but do nothing with them and
7 # send no responses. 7 # send no responses.
8 8
9 import sys 9 import sys
10 import struct 10 import struct
11 11
12 while 1: 12 while 1:
13 # Read the message type (first 4 bytes). 13 # Read the message type (first 4 bytes).
14 typeBytes = sys.stdin.read(4) 14 typeBytes = sys.stdin.read(4)
15 15
16 if len(typeBytes) == 0: 16 if len(typeBytes) == 0:
17 break 17 break
18 18
19 # Read the message length (4 bytes). 19 # Read the message length (4 bytes).
20 textLength = struct.unpack('i', sys.stdin.read(4))[0] 20 textLength = struct.unpack('i', sys.stdin.read(4))[0]
21 21
22 # Read the text (JSON object) of the message. 22 # Read the text (JSON object) of the message.
23 text = sys.stdin.read(textLength) 23 text = sys.stdin.read(textLength)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698