runtimes/google/ipc: client side RPC improvements:

- implement 'ordering' of multiple endpoints.
- implement parallel connection setup

Change-Id: I9e2ba5441b681cd1bd0ef81d0718b61d5d237e35
diff --git a/profiles/chrome/chrome.go b/profiles/chrome/chrome.go
new file mode 100644
index 0000000..22b5beb
--- /dev/null
+++ b/profiles/chrome/chrome.go
@@ -0,0 +1,49 @@
+// Package chrome implements a profile for use within Chrome, in particular
+// for use by Chrome extensions.
+package chrome
+
+import (
+	"veyron.io/veyron/veyron2"
+	"veyron.io/veyron/veyron2/config"
+	"veyron.io/veyron/veyron2/ipc"
+	"veyron.io/veyron/veyron2/options"
+	"veyron.io/veyron/veyron2/rt"
+
+	"veyron.io/veyron/veyron/profiles"
+)
+
+var ListenSpec = ipc.ListenSpec{}
+
+type chrome struct{}
+
+func init() {
+	rt.RegisterProfile(New())
+}
+
+// New returns a new instance of a Profile for use within chrome, in particular
+// chrome extensions etc should use.
+func New() veyron2.Profile {
+	return &chrome{}
+}
+
+func (*chrome) Name() string {
+	return "chrome"
+}
+
+func (*chrome) Runtime() (string, []veyron2.ROpt) {
+	return veyron2.GoogleRuntimeName, []veyron2.ROpt{options.PreferredProtocols{"ws"}}
+}
+
+func (*chrome) Platform() *veyron2.Platform {
+	p, _ := profiles.Platform()
+	return p
+}
+
+func (g *chrome) Init(rt veyron2.Runtime, _ *config.Publisher) error {
+	rt.Logger().VI(1).Infof("%s", g)
+	return nil
+}
+
+func (g *chrome) String() string {
+	return "chrome profile on " + g.Platform().String()
+}
diff --git a/profiles/gce/init.go b/profiles/gce/init.go
index 4102b78..b5afa26 100644
--- a/profiles/gce/init.go
+++ b/profiles/gce/init.go
@@ -41,8 +41,8 @@
 	return "GCE"
 }
 
-func (p *profile) Runtime() string {
-	return ""
+func (p *profile) Runtime() (string, []veyron2.ROpt) {
+	return "", nil
 }
 
 func (p *profile) Platform() *veyron2.Platform {
diff --git a/profiles/generic.go b/profiles/generic.go
index 0d9dda2..9aadc25 100644
--- a/profiles/generic.go
+++ b/profiles/generic.go
@@ -35,8 +35,8 @@
 	return "generic"
 }
 
-func (*generic) Runtime() string {
-	return veyron2.GoogleRuntimeName
+func (*generic) Runtime() (string, []veyron2.ROpt) {
+	return veyron2.GoogleRuntimeName, nil
 }
 
 func (*generic) Platform() *veyron2.Platform {
diff --git a/profiles/roaming/roaming.go b/profiles/roaming/roaming.go
index 33a1c20..d4c0262 100644
--- a/profiles/roaming/roaming.go
+++ b/profiles/roaming/roaming.go
@@ -61,8 +61,8 @@
 	return "roaming" + p.gce
 }
 
-func (p *profile) Runtime() string {
-	return veyron2.GoogleRuntimeName
+func (p *profile) Runtime() (string, []veyron2.ROpt) {
+	return veyron2.GoogleRuntimeName, nil
 }
 
 func (p *profile) String() string {
diff --git a/profiles/static/static.go b/profiles/static/static.go
index 7ff75b1..377874a 100644
--- a/profiles/static/static.go
+++ b/profiles/static/static.go
@@ -46,8 +46,8 @@
 	return "static" + p.gce
 }
 
-func (p *static) Runtime() string {
-	return "google"
+func (p *static) Runtime() (string, []veyron2.ROpt) {
+	return "google", nil
 }
 
 func (*static) Platform() *veyron2.Platform {