Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / native_messaging / native_hosts / empty_app.py
blobabdd261674926548839da037c62c644fe796de84
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
6 # This native client will read full messages, but do nothing with them and
7 # send no responses.
9 import sys
10 import struct
12 while 1:
13 # Read the message type (first 4 bytes).
14 typeBytes = sys.stdin.read(4)
16 if len(typeBytes) == 0:
17 break
19 # Read the message length (4 bytes).
20 textLength = struct.unpack('i', sys.stdin.read(4))[0]
22 # Read the text (JSON object) of the message.
23 text = sys.stdin.read(textLength)