OLD | NEW |
---|---|
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 "content/renderer/pepper/ppb_var_deprecated_impl.h" | 5 #include "content/renderer/pepper/ppb_var_deprecated_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "content/renderer/pepper/host_globals.h" | 9 #include "content/renderer/pepper/host_globals.h" |
10 #include "content/renderer/pepper/message_channel.h" | 10 #include "content/renderer/pepper/message_channel.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 const char kInvalidIdentifierException[] = "Error: Invalid identifier."; | 36 const char kInvalidIdentifierException[] = "Error: Invalid identifier."; |
37 const char kInvalidObjectException[] = "Error: Invalid object"; | 37 const char kInvalidObjectException[] = "Error: Invalid object"; |
38 const char kUnableToCallMethodException[] = "Error: Unable to call method"; | 38 const char kUnableToCallMethodException[] = "Error: Unable to call method"; |
39 | 39 |
40 class ObjectAccessor { | 40 class ObjectAccessor { |
41 public: | 41 public: |
42 ObjectAccessor(PP_Var var) | 42 ObjectAccessor(PP_Var var) |
43 : object_var_(V8ObjectVar::FromPPVar(var)), | 43 : object_var_(V8ObjectVar::FromPPVar(var).get()), |
dcheng
2014/09/02 23:53:41
Note: I'm not sure if this is safe or not. I've cc
raymes
2014/09/03 00:02:25
This is safe. You might hit a conflict because thi
dcheng
2014/09/03 00:04:20
Ha. OK, thanks. I'll pre-emptively revert this cha
| |
44 instance_(object_var_ ? object_var_->instance() : NULL) { | 44 instance_(object_var_ ? object_var_->instance() : NULL) { |
45 } | 45 } |
46 | 46 |
47 // Check if the object is valid. If it isn't, set an exception and return | 47 // Check if the object is valid. If it isn't, set an exception and return |
48 // false. | 48 // false. |
49 bool IsValid(PP_Var* exception) { | 49 bool IsValid(PP_Var* exception) { |
50 // If we already have an exception, then the call is invalid according to | 50 // If we already have an exception, then the call is invalid according to |
51 // the unittests. | 51 // the unittests. |
52 if (exception && exception->type != PP_VARTYPE_UNDEFINED) | 52 if (exception && exception->type != PP_VARTYPE_UNDEFINED) |
53 return false; | 53 return false; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 &CallDeprecated, | 342 &CallDeprecated, |
343 &Construct, | 343 &Construct, |
344 &IsInstanceOfDeprecated, | 344 &IsInstanceOfDeprecated, |
345 &CreateObjectDeprecated, | 345 &CreateObjectDeprecated, |
346 &CreateObjectWithModuleDeprecated, }; | 346 &CreateObjectWithModuleDeprecated, }; |
347 | 347 |
348 return &var_deprecated_interface; | 348 return &var_deprecated_interface; |
349 } | 349 } |
350 | 350 |
351 } // namespace content | 351 } // namespace content |
OLD | NEW |