OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_var.h" | 5 #include "webkit/glue/plugins/pepper_var.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "third_party/ppapi/c/pp_var.h" | 10 #include "third_party/ppapi/c/pp_var.h" |
(...skipping 821 matching lines...) Loading... |
832 WebBindings::retainObject(object); | 832 WebBindings::retainObject(object); |
833 return ret; | 833 return ret; |
834 } | 834 } |
835 | 835 |
836 NPObject* GetNPObject(PP_Var var) { | 836 NPObject* GetNPObject(PP_Var var) { |
837 if (var.type != PP_VarType_Object) | 837 if (var.type != PP_VarType_Object) |
838 return NULL; | 838 return NULL; |
839 return GetNPObjectUnchecked(var); | 839 return GetNPObjectUnchecked(var); |
840 } | 840 } |
841 | 841 |
| 842 PP_Var StringToPPVar(const std::string& str) { |
| 843 DCHECK(IsStringUTF8(str)); |
| 844 return VarFromUtf8(str.data(), str.size()); |
| 845 } |
| 846 |
842 String* GetString(PP_Var var) { | 847 String* GetString(PP_Var var) { |
843 if (var.type != PP_VarType_String) | 848 if (var.type != PP_VarType_String) |
844 return NULL; | 849 return NULL; |
845 return GetStringUnchecked(var); | 850 return GetStringUnchecked(var); |
846 } | 851 } |
847 | 852 |
848 } // namespace pepper | 853 } // namespace pepper |
OLD | NEW |