| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/shared_impl/ppb_file_ref_shared.h" | 5 #include "ppapi/shared_impl/ppb_file_ref_shared.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/shared_impl/var.h" | 8 #include "ppapi/shared_impl/var.h" |
| 9 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| 11 | 11 |
| 12 PPB_FileRef_Shared::PPB_FileRef_Shared(const InitAsImpl&, | 12 PPB_FileRef_Shared::PPB_FileRef_Shared(ResourceObjectType type, |
| 13 const PPB_FileRef_CreateInfo& info) | 13 const PPB_FileRef_CreateInfo& info) |
| 14 : Resource(info.resource.instance()), | 14 : Resource(type, info.resource), |
| 15 create_info_(info) { | 15 create_info_(info) { |
| 16 // Should not have been passed a host resource for the trusted constructor. | 16 if (type == OBJECT_IS_IMPL) { |
| 17 DCHECK(info.resource.is_null()); | 17 // Resource's constructor assigned a PP_Resource, so we can fill out our |
| 18 | 18 // host resource now. |
| 19 // Resource's constructor assigned a PP_Resource, so we can fill out our | 19 create_info_.resource = host_resource(); |
| 20 // host resource now. | 20 DCHECK(!create_info_.resource.is_null()); |
| 21 create_info_.resource = host_resource(); | 21 } |
| 22 DCHECK(!create_info_.resource.is_null()); | |
| 23 } | |
| 24 | |
| 25 PPB_FileRef_Shared::PPB_FileRef_Shared(const InitAsProxy&, | |
| 26 const PPB_FileRef_CreateInfo& info) | |
| 27 : Resource(info.resource), | |
| 28 create_info_(info) { | |
| 29 } | 22 } |
| 30 | 23 |
| 31 PPB_FileRef_Shared::~PPB_FileRef_Shared() { | 24 PPB_FileRef_Shared::~PPB_FileRef_Shared() { |
| 32 } | 25 } |
| 33 | 26 |
| 34 thunk::PPB_FileRef_API* PPB_FileRef_Shared::AsPPB_FileRef_API() { | 27 thunk::PPB_FileRef_API* PPB_FileRef_Shared::AsPPB_FileRef_API() { |
| 35 return this; | 28 return this; |
| 36 } | 29 } |
| 37 | 30 |
| 38 PP_FileSystemType PPB_FileRef_Shared::GetFileSystemType() const { | 31 PP_FileSystemType PPB_FileRef_Shared::GetFileSystemType() const { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 53 path_var_ = new StringVar(create_info_.path); | 46 path_var_ = new StringVar(create_info_.path); |
| 54 } | 47 } |
| 55 return path_var_->GetPPVar(); | 48 return path_var_->GetPPVar(); |
| 56 } | 49 } |
| 57 | 50 |
| 58 const PPB_FileRef_CreateInfo& PPB_FileRef_Shared::GetCreateInfo() const { | 51 const PPB_FileRef_CreateInfo& PPB_FileRef_Shared::GetCreateInfo() const { |
| 59 return create_info_; | 52 return create_info_; |
| 60 } | 53 } |
| 61 | 54 |
| 62 } // namespace ppapi | 55 } // namespace ppapi |
| OLD | NEW |