| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 ScopedPPVar result_var; | 403 ScopedPPVar result_var; |
| 404 if (FromV8ValueInternal(val, context, &result_var)) { | 404 if (FromV8ValueInternal(val, context, &result_var)) { |
| 405 resource_converter_->Flush(base::Bind(callback, result_var)); | 405 resource_converter_->Flush(base::Bind(callback, result_var)); |
| 406 } else { | 406 } else { |
| 407 message_loop_proxy_->PostTask( | 407 message_loop_proxy_->PostTask( |
| 408 FROM_HERE, | 408 FROM_HERE, |
| 409 base::Bind(callback, result_var, false)); | 409 base::Bind(callback, result_var, false)); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 bool V8VarConverter::FromV8ValueSync( |
| 414 v8::Handle<v8::Value> val, |
| 415 v8::Handle<v8::Context> context, |
| 416 ppapi::ScopedPPVar* result_var) { |
| 417 if (!FromV8ValueInternal(val, context, result_var)) |
| 418 return false; |
| 419 return resource_converter_->FlushSync(); |
| 420 } |
| 421 |
| 413 bool V8VarConverter::FromV8ValueInternal( | 422 bool V8VarConverter::FromV8ValueInternal( |
| 414 v8::Handle<v8::Value> val, | 423 v8::Handle<v8::Value> val, |
| 415 v8::Handle<v8::Context> context, | 424 v8::Handle<v8::Context> context, |
| 416 ppapi::ScopedPPVar* result_var) { | 425 ppapi::ScopedPPVar* result_var) { |
| 417 v8::Context::Scope context_scope(context); | 426 v8::Context::Scope context_scope(context); |
| 418 v8::HandleScope handle_scope(context->GetIsolate()); | 427 v8::HandleScope handle_scope(context->GetIsolate()); |
| 419 | 428 |
| 420 HandleVarMap visited_handles; | 429 HandleVarMap visited_handles; |
| 421 ParentHandleSet parent_handles; | 430 ParentHandleSet parent_handles; |
| 422 | 431 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 std::string(*name_utf8, name_utf8.length()), child_var); | 551 std::string(*name_utf8, name_utf8.length()), child_var); |
| 543 DCHECK(success); | 552 DCHECK(success); |
| 544 } | 553 } |
| 545 } | 554 } |
| 546 } | 555 } |
| 547 *result_var = root; | 556 *result_var = root; |
| 548 return true; | 557 return true; |
| 549 } | 558 } |
| 550 | 559 |
| 551 } // namespace content | 560 } // namespace content |
| OLD | NEW |