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

Unified Diff: remoting/client/plugin/pepper_view.cc

Issue 9567033: Cleanup error handling in the client plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/pepper_view.h ('k') | remoting/host/client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_view.cc
diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc
index 27ce1bc9762493097b2dbe9fbd83976da5b6dce6..6e1315e30682d4ffee9e1da357cf932137b806e9 100644
--- a/remoting/client/plugin/pepper_view.cc
+++ b/remoting/client/plugin/pepper_view.cc
@@ -31,18 +31,30 @@ namespace {
// The maximum number of image buffers to be allocated at any point of time.
const size_t kMaxPendingBuffersCount = 2;
+// TODO(sergeyu): Ideally we should just pass ErrorCode to the webapp
+// and let it handle it, but it would be hard to fix it now because
+// client plugin and webapp versions may not be in sync. It should be
+// easy to do after we are finished moving the client plugin to NaCl.
ChromotingInstance::ConnectionError ConvertConnectionError(
- protocol::ConnectionToHost::Error error) {
+ protocol::ErrorCode error) {
switch (error) {
- case protocol::ConnectionToHost::OK:
+ case protocol::OK:
return ChromotingInstance::ERROR_NONE;
- case protocol::ConnectionToHost::HOST_IS_OFFLINE:
+
+ case protocol::PEER_IS_OFFLINE:
return ChromotingInstance::ERROR_HOST_IS_OFFLINE;
- case protocol::ConnectionToHost::SESSION_REJECTED:
+
+ case protocol::SESSION_REJECTED:
+ case protocol::AUTHENTICATION_FAILED:
return ChromotingInstance::ERROR_SESSION_REJECTED;
- case protocol::ConnectionToHost::INCOMPATIBLE_PROTOCOL:
+
+ case protocol::INCOMPATIBLE_PROTOCOL:
return ChromotingInstance::ERROR_INCOMPATIBLE_PROTOCOL;
- case protocol::ConnectionToHost::NETWORK_FAILURE:
+
+ case protocol::CHANNEL_CONNECTION_ERROR:
+ case protocol::SIGNALING_ERROR:
+ case protocol::SIGNALING_TIMEOUT:
+ case protocol::UNKNOWN_ERROR:
return ChromotingInstance::ERROR_NETWORK_FAILURE;
}
DLOG(FATAL) << "Unknown error code" << error;
@@ -97,7 +109,7 @@ void PepperView::TearDown() {
}
void PepperView::SetConnectionState(protocol::ConnectionToHost::State state,
- protocol::ConnectionToHost::Error error) {
+ protocol::ErrorCode error) {
DCHECK(context_->main_message_loop()->BelongsToCurrentThread());
switch (state) {
« no previous file with comments | « remoting/client/plugin/pepper_view.h ('k') | remoting/host/client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698