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

Unified Diff: chrome/test/data/native_messaging/native_hosts/echo.py

Issue 2271143002: Ensure/document that the first parameter to the native messaging host is the origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure that the origin is really the first arg Created 4 years, 3 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
index 28e02f735555f8af58de220e97df68ce4fc72018..a611051dd183c833cba5493e5dc30bdcbe41a60c 100755
--- a/chrome/test/data/native_messaging/native_hosts/echo.py
+++ b/chrome/test/data/native_messaging/native_hosts/echo.py
@@ -23,20 +23,19 @@ def WriteMessage(message):
def Main():
message_number = 0
- caller_url = None
parent_window = None
if len(sys.argv) < 2:
sys.stderr.write("URL of the calling application is not specified.\n")
return 1
+ caller_url = sys.argv[1]
+
# TODO(sergeyu): Use argparse module to parse the arguments (not available in
# Python 2.6).
- for arg in sys.argv[1:]:
+ for arg in sys.argv[2:]:
if arg.startswith('--'):
if arg.startswith('--parent-window='):
parent_window = long(arg[len('--parent-window='):])
- elif caller_url == None:
- caller_url = arg
# Verify that the process was started in the correct directory.
cwd = os.getcwd()

Powered by Google App Engine
This is Rietveld 408576698