Chromium Code Reviews| Index: ppapi/shared_impl/var.cc |
| diff --git a/ppapi/shared_impl/var.cc b/ppapi/shared_impl/var.cc |
| index e311b3c4bce7a645185d5e381eeaa18e80085fcc..f173701861ad6a10b92c0943575eb2ea742d6c64 100644 |
| --- a/ppapi/shared_impl/var.cc |
| +++ b/ppapi/shared_impl/var.cc |
| @@ -9,8 +9,10 @@ |
| #include "base/logging.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "base/strings/string_util.h" |
| +#include "base/strings/stringprintf.h" |
| #include "ppapi/c/pp_var.h" |
| #include "ppapi/shared_impl/ppapi_globals.h" |
| +#include "ppapi/shared_impl/resource_var.h" |
| #include "ppapi/shared_impl/var_tracker.h" |
| namespace ppapi { |
| @@ -62,6 +64,19 @@ std::string Var::PPVarToLogString(PP_Var var) { |
| return "[Dictionary]"; |
| case PP_VARTYPE_ARRAY_BUFFER: |
| return "[Array buffer]"; |
| + case PP_VARTYPE_RESOURCE: { |
| + ResourceVar* resource(ResourceVar::FromPPVar(var)); |
| + if (!resource) |
| + return "[Invalid resource]"; |
| + |
| + if (resource->pp_resource()) { |
| + return base::StringPrintf("[Resource %d]", resource->pp_resource()); |
| + } else if (resource->creation_message().type() != 0) { |
|
raymes
2013/09/11 22:52:29
This makes me wonder whether maybe we should have
yzshen1
2013/09/11 22:57:11
Or maybe we could have some boolean method such as
Matt Giuca
2013/09/12 07:08:24
Yeah OK. I think I'll add IsPending (it doesn't se
|
| + return base::StringPrintf("[Pending resource]"); |
| + } else { |
| + return "[Null resource]"; |
| + } |
| + } |
| default: |
| return "[Invalid var]"; |
| } |