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 "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(ResourceObjectType type, | 12 PPB_FileRef_Shared::PPB_FileRef_Shared(ResourceObjectType type, |
13 const PPB_FileRef_CreateInfo& info) | 13 const PPB_FileRef_CreateInfo& info) |
14 : Resource(type, info.resource), | 14 : Resource(type, info.resource), |
15 create_info_(info) { | 15 create_info_(info) { |
16 if (type == OBJECT_IS_IMPL) { | 16 if (type == OBJECT_IS_IMPL) { |
17 // Resource's constructor assigned a PP_Resource, so we can fill out our | 17 // Resource's constructor assigned a PP_Resource, so we can fill out our |
18 // host resource now. | 18 // host resource now. |
19 create_info_.resource = host_resource(); | 19 create_info_.resource = host_resource(); |
20 DCHECK(!create_info_.resource.is_null()); | |
21 } | 20 } |
22 } | 21 } |
23 | 22 |
24 PPB_FileRef_Shared::~PPB_FileRef_Shared() { | 23 PPB_FileRef_Shared::~PPB_FileRef_Shared() { |
25 } | 24 } |
26 | 25 |
27 thunk::PPB_FileRef_API* PPB_FileRef_Shared::AsPPB_FileRef_API() { | 26 thunk::PPB_FileRef_API* PPB_FileRef_Shared::AsPPB_FileRef_API() { |
28 return this; | 27 return this; |
29 } | 28 } |
30 | 29 |
(...skipping 15 matching lines...) Expand all Loading... |
46 path_var_ = new StringVar(create_info_.path); | 45 path_var_ = new StringVar(create_info_.path); |
47 } | 46 } |
48 return path_var_->GetPPVar(); | 47 return path_var_->GetPPVar(); |
49 } | 48 } |
50 | 49 |
51 const PPB_FileRef_CreateInfo& PPB_FileRef_Shared::GetCreateInfo() const { | 50 const PPB_FileRef_CreateInfo& PPB_FileRef_Shared::GetCreateInfo() const { |
52 return create_info_; | 51 return create_info_; |
53 } | 52 } |
54 | 53 |
55 } // namespace ppapi | 54 } // namespace ppapi |
OLD | NEW |