summaryrefslogtreecommitdiffstats
path: root/content/common/android/gin_java_bridge_errors.cc
blob: b2458cd0354f50a93e4310414cde59621005c661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/common/android/gin_java_bridge_errors.h"

#include "base/logging.h"

namespace content {

const char* GinJavaBridgeErrorToString(GinJavaBridgeError error) {
  switch (error) {
    case kGinJavaBridgeNoError:
      return "No error";
    case kGinJavaBridgeUnknownObjectId:
      return "Unknown Java object ID";
    case kGinJavaBridgeObjectIsGone:
      return "Java object is gone";
    case kGinJavaBridgeMethodNotFound:
      return "Method not found";
    case kGinJavaBridgeAccessToObjectGetClassIsBlocked:
      return "Access to java.lang.Object.getClass is blocked";
    case kGinJavaBridgeJavaExceptionRaised:
      return "Java exception was raised during method invocation";
    case kGinJavaBridgeNonAssignableTypes:
      return "The type of the object passed to the method is incompatible "
          "with the type of method's argument";
    case kGinJavaBridgeRenderFrameDeleted:
      return "RenderFrame has been deleted";
  }
  NOTREACHED();
  return "Unknown error";
}

}  // namespace content