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 "ppapi/proxy/raw_var_data.h" | 5 #include "ppapi/proxy/raw_var_data.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 | 8 |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 if (!resource_var) | 683 if (!resource_var) |
684 return false; | 684 return false; |
685 pp_resource_ = resource_var->GetPPResource(); | 685 pp_resource_ = resource_var->GetPPResource(); |
686 const IPC::Message* message = resource_var->GetCreationMessage(); | 686 const IPC::Message* message = resource_var->GetCreationMessage(); |
687 if (message) | 687 if (message) |
688 creation_message_.reset(new IPC::Message(*message)); | 688 creation_message_.reset(new IPC::Message(*message)); |
689 else | 689 else |
690 creation_message_.reset(); | 690 creation_message_.reset(); |
691 pending_renderer_host_id_ = resource_var->GetPendingRendererHostId(); | 691 pending_renderer_host_id_ = resource_var->GetPendingRendererHostId(); |
692 pending_browser_host_id_ = resource_var->GetPendingBrowserHostId(); | 692 pending_browser_host_id_ = resource_var->GetPendingBrowserHostId(); |
| 693 |
693 initialized_ = true; | 694 initialized_ = true; |
694 return true; | 695 return true; |
695 } | 696 } |
696 | 697 |
697 PP_Var ResourceRawVarData::CreatePPVar(PP_Instance instance) { | 698 PP_Var ResourceRawVarData::CreatePPVar(PP_Instance instance) { |
698 // If this is not a pending resource host, just create the var. | 699 // If this is not a pending resource host, just create the var. |
699 if (pp_resource_ || !creation_message_) { | 700 if (pp_resource_ || !creation_message_) { |
700 return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar( | 701 return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar( |
701 pp_resource_); | 702 pp_resource_); |
702 } | 703 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 if (!IPC::ParamTraits<IPC::Message>::Read(m, iter, creation_message_.get())) | 743 if (!IPC::ParamTraits<IPC::Message>::Read(m, iter, creation_message_.get())) |
743 return false; | 744 return false; |
744 } else { | 745 } else { |
745 creation_message_.reset(); | 746 creation_message_.reset(); |
746 } | 747 } |
747 return true; | 748 return true; |
748 } | 749 } |
749 | 750 |
750 } // namespace proxy | 751 } // namespace proxy |
751 } // namespace ppapi | 752 } // namespace ppapi |
OLD | NEW |