| 258 | } |
| 259 | |
| 260 | void |
| 261 | APIServer::Client::SendEvent( |
| 262 | unsigned int target, |
| 263 | const std::string type, |
| 264 | scoped_ptr<base::DictionaryValue> event) |
| 265 | { |
| 266 | /* Runs on IO Thread. */ |
| 267 | base::DictionaryValue action; |
| 268 | action.SetString("_action", "event"); |
| 269 | action.SetInteger("_id", ++action_id_); |
| 270 | action.SetInteger("_target", target); |
| 271 | action.SetString("_type", type); |
| 272 | action.Set("_event", event->DeepCopy()); |
| 273 | |
| 274 | std::string payload; |
| 275 | base::JSONWriter::Write(&action, &payload); |
| 276 | payload += "\n" + std::string(kSocketBoundary) + "\n"; |
| 277 | |
| 278 | std::cout << payload; |
| 279 | std::cout.flush(); |
| 280 | } |
| 281 | |
| 282 | void |
| 283 | APIServer::Client::SendInvoke( |
nothing calls this directly
no outgoing calls
no test coverage detected