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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/test/remote_test_server.cc ('k') | remoting/host/json_host_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 405 }
406 406
407 void ChromotingInstance::PostChromotingMessage( 407 void ChromotingInstance::PostChromotingMessage(
408 const std::string& method, 408 const std::string& method,
409 scoped_ptr<base::DictionaryValue> data) { 409 scoped_ptr<base::DictionaryValue> data) {
410 scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue()); 410 scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue());
411 message->SetString("method", method); 411 message->SetString("method", method);
412 message->Set("data", data.release()); 412 message->Set("data", data.release());
413 413
414 std::string message_json; 414 std::string message_json;
415 base::JSONWriter::Write(message.get(), false, &message_json); 415 base::JSONWriter::Write(message.get(), &message_json);
416 PostMessage(pp::Var(message_json)); 416 PostMessage(pp::Var(message_json));
417 } 417 }
418 418
419 void ChromotingInstance::SendOutgoingIq(const std::string& iq) { 419 void ChromotingInstance::SendOutgoingIq(const std::string& iq) {
420 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 420 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
421 data->SetString("iq", iq); 421 data->SetString("iq", iq);
422 PostChromotingMessage("sendOutgoingIq", data.Pass()); 422 PostChromotingMessage("sendOutgoingIq", data.Pass());
423 423
424 GetScriptableObject()->SendIq(iq); 424 GetScriptableObject()->SendIq(iq);
425 } 425 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 539 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
540 data->SetString("message", message); 540 data->SetString("message", message);
541 PostChromotingMessage("logDebugMessage", data.Pass()); 541 PostChromotingMessage("logDebugMessage", data.Pass());
542 542
543 scriptable_object->LogDebugInfo(message); 543 scriptable_object->LogDebugInfo(message);
544 } 544 }
545 g_logging_to_plugin = false; 545 g_logging_to_plugin = false;
546 } 546 }
547 547
548 } // namespace remoting 548 } // namespace remoting
OLDNEW
« no previous file with comments | « net/test/remote_test_server.cc ('k') | remoting/host/json_host_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698