| 237 | |
| 238 | |
| 239 | void |
| 240 | APIServer::Client::SendReply( |
| 241 | const unsigned int id, |
| 242 | const std::string& error, |
| 243 | scoped_ptr<base::DictionaryValue> result) |
| 244 | { |
| 245 | /* Runs on IO Thread. */ |
| 246 | base::DictionaryValue action; |
| 247 | action.SetString("_action", "reply"); |
| 248 | action.SetInteger("_id", id); |
| 249 | action.SetString("_error", error); |
| 250 | action.Set("_result", result->DeepCopy()); |
| 251 | |
| 252 | std::string payload; |
| 253 | base::JSONWriter::Write(&action, &payload); |
| 254 | payload += "\n" + std::string(kSocketBoundary) + "\n"; |
| 255 | |
| 256 | std::cout << payload; |
| 257 | std::cout.flush(); |
| 258 | } |
| 259 | |
| 260 | void |
| 261 | APIServer::Client::SendEvent( |
nothing calls this directly
no outgoing calls
no test coverage detected