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

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

Issue 2052723002: Adding an interface to allow extention of the audio player for CRD and iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor updates based on CL feedback. Thanks! Created 4 years, 6 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
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 <nacl_io/nacl_io.h> 7 #include <nacl_io/nacl_io.h>
8 #include <sys/mount.h> 8 #include <sys/mount.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 base::Bind(&ChromotingInstance::UpdateUmaCustomHistogram, 651 base::Bind(&ChromotingInstance::UpdateUmaCustomHistogram,
652 weak_factory_.GetWeakPtr(), true), 652 weak_factory_.GetWeakPtr(), true),
653 base::Bind(&ChromotingInstance::UpdateUmaCustomHistogram, 653 base::Bind(&ChromotingInstance::UpdateUmaCustomHistogram,
654 weak_factory_.GetWeakPtr(), false), 654 weak_factory_.GetWeakPtr(), false),
655 base::Bind(&ChromotingInstance::UpdateUmaEnumHistogram, 655 base::Bind(&ChromotingInstance::UpdateUmaEnumHistogram,
656 weak_factory_.GetWeakPtr())); 656 weak_factory_.GetWeakPtr()));
657 657
658 if (!plugin_view_.is_null()) 658 if (!plugin_view_.is_null())
659 video_renderer_->OnViewChanged(plugin_view_); 659 video_renderer_->OnViewChanged(plugin_view_);
660 660
661 if (!audio_player_) {
662 audio_player_.reset(new PepperAudioPlayer(this));
663 }
664
661 client_.reset( 665 client_.reset(
662 new ChromotingClient(&context_, this, video_renderer_.get(), 666 new ChromotingClient(&context_,
663 base::WrapUnique(new PepperAudioPlayer(this)))); 667 this,
Sergey Ulanov 2016/06/09 20:23:45 this fits on the previous line. git-cl-format plea
668 video_renderer_.get(),
669 audio_player_.get());
664 670
665 // Setup the signal strategy. 671 // Setup the signal strategy.
666 signal_strategy_.reset(new DelegatingSignalStrategy( 672 signal_strategy_.reset(new DelegatingSignalStrategy(
667 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, 673 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq,
668 weak_factory_.GetWeakPtr()))); 674 weak_factory_.GetWeakPtr())));
669 675
670 // Create TransportContext. 676 // Create TransportContext.
671 scoped_refptr<protocol::TransportContext> transport_context( 677 scoped_refptr<protocol::TransportContext> transport_context(
672 new protocol::TransportContext( 678 new protocol::TransportContext(
673 signal_strategy_.get(), 679 signal_strategy_.get(),
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 972
967 void ChromotingInstance::Disconnect() { 973 void ChromotingInstance::Disconnect() {
968 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); 974 DCHECK(plugin_task_runner_->BelongsToCurrentThread());
969 975
970 VLOG(0) << "Disconnecting from host."; 976 VLOG(0) << "Disconnecting from host.";
971 977
972 // Disconnect the input pipeline and teardown the connection. 978 // Disconnect the input pipeline and teardown the connection.
973 mouse_input_filter_.set_input_stub(nullptr); 979 mouse_input_filter_.set_input_stub(nullptr);
974 client_.reset(); 980 client_.reset();
975 video_renderer_.reset(); 981 video_renderer_.reset();
982 audio_player_.reset();
976 stats_update_timer_.Stop(); 983 stats_update_timer_.Stop();
977 } 984 }
978 985
979 void ChromotingInstance::PostChromotingMessage(const std::string& method, 986 void ChromotingInstance::PostChromotingMessage(const std::string& method,
980 const pp::VarDictionary& data) { 987 const pp::VarDictionary& data) {
981 pp::VarDictionary message; 988 pp::VarDictionary message;
982 message.Set(pp::Var("method"), pp::Var(method)); 989 message.Set(pp::Var("method"), pp::Var(method));
983 message.Set(pp::Var("data"), data); 990 message.Set(pp::Var("data"), data);
984 PostMessage(message); 991 PostMessage(message);
985 } 992 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 1058
1052 // Unregister this instance for logging. 1059 // Unregister this instance for logging.
1053 g_logging_instance = 0; 1060 g_logging_instance = 0;
1054 } 1061 }
1055 1062
1056 // static 1063 // static
1057 bool ChromotingInstance::LogToUI(int severity, const char* file, int line, 1064 bool ChromotingInstance::LogToUI(int severity, const char* file, int line,
1058 size_t message_start, 1065 size_t message_start,
1059 const std::string& str) { 1066 const std::string& str) {
1060 PP_LogLevel log_level = PP_LOGLEVEL_ERROR; 1067 PP_LogLevel log_level = PP_LOGLEVEL_ERROR;
1061 switch(severity) { 1068 switch (severity) {
1062 case logging::LOG_INFO: 1069 case logging::LOG_INFO:
1063 log_level = PP_LOGLEVEL_TIP; 1070 log_level = PP_LOGLEVEL_TIP;
1064 break; 1071 break;
1065 case logging::LOG_WARNING: 1072 case logging::LOG_WARNING:
1066 log_level = PP_LOGLEVEL_WARNING; 1073 log_level = PP_LOGLEVEL_WARNING;
1067 break; 1074 break;
1068 case logging::LOG_ERROR: 1075 case logging::LOG_ERROR:
1069 case logging::LOG_FATAL: 1076 case logging::LOG_FATAL:
1070 log_level = PP_LOGLEVEL_ERROR; 1077 log_level = PP_LOGLEVEL_ERROR;
1071 break; 1078 break;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 if (is_custom_counts_histogram) { 1125 if (is_custom_counts_histogram) {
1119 uma.HistogramCustomCounts(histogram_name, value, histogram_min, 1126 uma.HistogramCustomCounts(histogram_name, value, histogram_min,
1120 histogram_max, histogram_buckets); 1127 histogram_max, histogram_buckets);
1121 } else { 1128 } else {
1122 uma.HistogramCustomTimes(histogram_name, value, histogram_min, 1129 uma.HistogramCustomTimes(histogram_name, value, histogram_min,
1123 histogram_max, histogram_buckets); 1130 histogram_max, histogram_buckets);
1124 } 1131 }
1125 } 1132 }
1126 1133
1127 } // namespace remoting 1134 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698