| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/v8_var_converter.h" | 5 #include "content/renderer/pepper/v8_var_converter.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 break; | 105 break; |
| 106 case PP_VARTYPE_NULL: | 106 case PP_VARTYPE_NULL: |
| 107 *result = v8::Null(isolate); | 107 *result = v8::Null(isolate); |
| 108 break; | 108 break; |
| 109 case PP_VARTYPE_BOOL: | 109 case PP_VARTYPE_BOOL: |
| 110 *result = (var.value.as_bool == PP_TRUE) | 110 *result = (var.value.as_bool == PP_TRUE) |
| 111 ? v8::True(isolate) | 111 ? v8::True(isolate) |
| 112 : v8::False(isolate); | 112 : v8::False(isolate); |
| 113 break; | 113 break; |
| 114 case PP_VARTYPE_INT32: | 114 case PP_VARTYPE_INT32: |
| 115 *result = v8::Integer::New(var.value.as_int); | 115 *result = v8::Integer::New(isolate, var.value.as_int); |
| 116 break; | 116 break; |
| 117 case PP_VARTYPE_DOUBLE: | 117 case PP_VARTYPE_DOUBLE: |
| 118 *result = v8::Number::New(var.value.as_double); | 118 *result = v8::Number::New(isolate, var.value.as_double); |
| 119 break; | 119 break; |
| 120 case PP_VARTYPE_STRING: { | 120 case PP_VARTYPE_STRING: { |
| 121 StringVar* string = StringVar::FromPPVar(var); | 121 StringVar* string = StringVar::FromPPVar(var); |
| 122 if (!string) { | 122 if (!string) { |
| 123 NOTREACHED(); | 123 NOTREACHED(); |
| 124 result->Clear(); | 124 result->Clear(); |
| 125 return false; | 125 return false; |
| 126 } | 126 } |
| 127 const std::string& value = string->value(); | 127 const std::string& value = string->value(); |
| 128 // Create a string object rather than a string primitive. This allows us | 128 // Create a string object rather than a string primitive. This allows us |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 bool success = dict_var->SetWithStringKey( | 518 bool success = dict_var->SetWithStringKey( |
| 519 std::string(*name_utf8, name_utf8.length()), child_var); | 519 std::string(*name_utf8, name_utf8.length()), child_var); |
| 520 DCHECK(success); | 520 DCHECK(success); |
| 521 } | 521 } |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 resource_converter_->Flush(base::Bind(callback, root)); | 524 resource_converter_->Flush(base::Bind(callback, root)); |
| 525 } | 525 } |
| 526 | 526 |
| 527 } // namespace content | 527 } // namespace content |
| OLD | NEW |