Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: ppapi/shared_impl/ppb_file_ref_shared.cc

Issue 8824015: Revert 113290 - Rename the shared_impl resource files to give them more regular names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/shared_impl/ppb_file_ref_shared.h ('k') | ppapi/shared_impl/ppb_font_shared.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/shared_impl/ppb_file_ref_shared.h"
6
7 #include "base/logging.h"
8 #include "ppapi/shared_impl/ppapi_globals.h"
9 #include "ppapi/shared_impl/var.h"
10
11 namespace ppapi {
12
13 PPB_FileRef_Shared::PPB_FileRef_Shared(const InitAsImpl&,
14 const PPB_FileRef_CreateInfo& info)
15 : Resource(info.resource.instance()),
16 create_info_(info) {
17 // Should not have been passed a host resource for the trusted constructor.
18 DCHECK(info.resource.is_null());
19
20 // Resource's constructor assigned a PP_Resource, so we can fill out our
21 // host resource now.
22 create_info_.resource = host_resource();
23 DCHECK(!create_info_.resource.is_null());
24 }
25
26 PPB_FileRef_Shared::PPB_FileRef_Shared(const InitAsProxy&,
27 const PPB_FileRef_CreateInfo& info)
28 : Resource(info.resource),
29 create_info_(info) {
30 }
31
32 PPB_FileRef_Shared::~PPB_FileRef_Shared() {
33 }
34
35 thunk::PPB_FileRef_API* PPB_FileRef_Shared::AsPPB_FileRef_API() {
36 return this;
37 }
38
39 PP_FileSystemType PPB_FileRef_Shared::GetFileSystemType() const {
40 return static_cast<PP_FileSystemType>(create_info_.file_system_type);
41 }
42
43 PP_Var PPB_FileRef_Shared::GetName() const {
44 if (!name_var_.get()) {
45 name_var_ = new StringVar(
46 PpapiGlobals::Get()->GetModuleForInstance(pp_instance()),
47 create_info_.name);
48 }
49 return name_var_->GetPPVar();
50 }
51
52 PP_Var PPB_FileRef_Shared::GetPath() const {
53 if (create_info_.file_system_type == PP_FILESYSTEMTYPE_EXTERNAL)
54 return PP_MakeUndefined();
55 if (!path_var_.get()) {
56 path_var_ = new StringVar(
57 PpapiGlobals::Get()->GetModuleForInstance(pp_instance()),
58 create_info_.path);
59 }
60 return path_var_->GetPPVar();
61 }
62
63 const PPB_FileRef_CreateInfo& PPB_FileRef_Shared::GetCreateInfo() const {
64 return create_info_;
65 }
66
67 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_file_ref_shared.h ('k') | ppapi/shared_impl/ppb_font_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698