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

Unified Diff: chrome/test/data/native_messaging/native_hosts/echo.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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/native_messaging/native_hosts/echo.py
diff --git a/chrome/test/data/native_messaging/native_hosts/echo.py b/chrome/test/data/native_messaging/native_hosts/echo.py
deleted file mode 100755
index d0be74bdfe9cb84b8767afe5f63676a2412c89f4..0000000000000000000000000000000000000000
--- a/chrome/test/data/native_messaging/native_hosts/echo.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# A simple native client in python.
-# All this client does is echo the text it receives back at the extension.
-
-import sys
-import struct
-
-def Main():
- message_number = 0
-
- while 1:
- # Read the message type (first 4 bytes).
- text_length_bytes = sys.stdin.read(4)
-
- if len(text_length_bytes) == 0:
- break
-
- # Read the message length (4 bytes).
- text_length = struct.unpack('i', text_length_bytes)[0]
-
- # Read the text (JSON object) of the message.
- text = sys.stdin.read(text_length).decode('utf-8')
-
- message_number += 1
-
- response = '{{"id": {0}, "echo": {1}}}'.format(message_number,
- text).encode('utf-8')
-
- try:
- sys.stdout.write(struct.pack("I", len(response)))
- sys.stdout.write(response)
- sys.stdout.flush()
- except IOError:
- break
-
-if __name__ == '__main__':
- Main()

Powered by Google App Engine
This is Rietveld 408576698