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

Side by Side Diff: webkit/glue/plugins/pepper_file_ref.cc

Issue 2900003: Chrome side of converting enums to uppercase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months 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 | « webkit/glue/plugins/pepper_file_io.cc ('k') | webkit/glue/plugins/pepper_file_system.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_file_ref.h" 5 #include "webkit/glue/plugins/pepper_file_ref.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "webkit/glue/plugins/pepper_plugin_instance.h" 8 #include "webkit/glue/plugins/pepper_plugin_instance.h"
9 #include "webkit/glue/plugins/pepper_var.h" 9 #include "webkit/glue/plugins/pepper_var.h"
10 #include "webkit/glue/plugins/pepper_resource_tracker.h" 10 #include "webkit/glue/plugins/pepper_resource_tracker.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 FileRef* file_ref = new FileRef(instance->module(), 49 FileRef* file_ref = new FileRef(instance->module(),
50 fs_type, 50 fs_type,
51 validated_path, 51 validated_path,
52 origin); 52 origin);
53 file_ref->AddRef(); // AddRef for the caller. 53 file_ref->AddRef(); // AddRef for the caller.
54 return file_ref->GetResource(); 54 return file_ref->GetResource();
55 } 55 }
56 56
57 PP_Resource CreatePersistentFileRef(PP_Instance instance_id, const char* path) { 57 PP_Resource CreatePersistentFileRef(PP_Instance instance_id, const char* path) {
58 return CreateFileRef(instance_id, PP_FileSystemType_LocalPersistent, path); 58 return CreateFileRef(instance_id, PP_FILESYSTEMTYPE_LOCALPERSISTENT, path);
59 } 59 }
60 60
61 PP_Resource CreateTemporaryFileRef(PP_Instance instance_id, const char* path) { 61 PP_Resource CreateTemporaryFileRef(PP_Instance instance_id, const char* path) {
62 return CreateFileRef(instance_id, PP_FileSystemType_LocalTemporary, path); 62 return CreateFileRef(instance_id, PP_FILESYSTEMTYPE_LOCALTEMPORARY, path);
63 } 63 }
64 64
65 bool IsFileRef(PP_Resource resource) { 65 bool IsFileRef(PP_Resource resource) {
66 return !!Resource::GetAs<FileRef>(resource).get(); 66 return !!Resource::GetAs<FileRef>(resource).get();
67 } 67 }
68 68
69 PP_FileSystemType GetFileSystemType(PP_Resource file_ref_id) { 69 PP_FileSystemType GetFileSystemType(PP_Resource file_ref_id) {
70 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id)); 70 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
71 if (!file_ref.get()) 71 if (!file_ref.get())
72 return PP_FileSystemType_External; 72 return PP_FILESYSTEMTYPE_EXTERNAL;
73 73
74 return file_ref->file_system_type(); 74 return file_ref->file_system_type();
75 } 75 }
76 76
77 PP_Var GetName(PP_Resource file_ref_id) { 77 PP_Var GetName(PP_Resource file_ref_id) {
78 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id)); 78 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
79 if (!file_ref.get()) 79 if (!file_ref.get())
80 return PP_MakeVoid(); 80 return PP_MakeVoid();
81 81
82 return StringToPPVar(file_ref->GetName()); 82 return StringToPPVar(file_ref->GetName());
83 } 83 }
84 84
85 PP_Var GetPath(PP_Resource file_ref_id) { 85 PP_Var GetPath(PP_Resource file_ref_id) {
86 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id)); 86 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
87 if (!file_ref.get()) 87 if (!file_ref.get())
88 return PP_MakeVoid(); 88 return PP_MakeVoid();
89 89
90 if (file_ref->file_system_type() == PP_FileSystemType_External) 90 if (file_ref->file_system_type() == PP_FILESYSTEMTYPE_EXTERNAL)
91 return PP_MakeVoid(); 91 return PP_MakeVoid();
92 92
93 return StringToPPVar(file_ref->path()); 93 return StringToPPVar(file_ref->path());
94 } 94 }
95 95
96 PP_Resource GetParent(PP_Resource file_ref_id) { 96 PP_Resource GetParent(PP_Resource file_ref_id) {
97 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id)); 97 scoped_refptr<FileRef> file_ref(Resource::GetAs<FileRef>(file_ref_id));
98 if (!file_ref.get()) 98 if (!file_ref.get())
99 return 0; 99 return 0;
100 100
101 if (file_ref->file_system_type() == PP_FileSystemType_External) 101 if (file_ref->file_system_type() == PP_FILESYSTEMTYPE_EXTERNAL)
102 return 0; 102 return 0;
103 103
104 scoped_refptr<FileRef> parent_ref(file_ref->GetParent()); 104 scoped_refptr<FileRef> parent_ref(file_ref->GetParent());
105 if (!parent_ref.get()) 105 if (!parent_ref.get())
106 return 0; 106 return 0;
107 parent_ref->AddRef(); // AddRef for the caller. 107 parent_ref->AddRef(); // AddRef for the caller.
108 108
109 return parent_ref->GetResource(); 109 return parent_ref->GetResource();
110 } 110 }
111 111
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 if (pos == 0) 162 if (pos == 0)
163 pos++; 163 pos++;
164 std::string parent_path = path_.substr(0, pos); 164 std::string parent_path = path_.substr(0, pos);
165 165
166 FileRef* parent_ref = new FileRef(module(), fs_type_, parent_path, origin_); 166 FileRef* parent_ref = new FileRef(module(), fs_type_, parent_path, origin_);
167 parent_ref->AddRef(); // AddRef for the caller. 167 parent_ref->AddRef(); // AddRef for the caller.
168 return parent_ref; 168 return parent_ref;
169 } 169 }
170 170
171 } // namespace pepper 171 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_file_io.cc ('k') | webkit/glue/plugins/pepper_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698