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

Side by Side Diff: webkit/plugins/ppapi/ppb_file_ref_impl.cc

Issue 9391013: Make a global enum to differentiate impl & proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
OLDNEW
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 "webkit/plugins/ppapi/ppb_file_ref_impl.h" 5 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // There should always be a leading slash at least! 73 // There should always be a leading slash at least!
74 size_t pos = path.rfind('/'); 74 size_t pos = path.rfind('/');
75 CHECK(pos != std::string::npos); 75 CHECK(pos != std::string::npos);
76 return path.substr(pos + 1); 76 return path.substr(pos + 1);
77 } 77 }
78 78
79 } // namespace 79 } // namespace
80 80
81 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info, 81 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info,
82 PPB_FileSystem_Impl* file_system) 82 PPB_FileSystem_Impl* file_system)
83 : PPB_FileRef_Shared(PPB_FileRef_Shared::InitAsImpl(), info), 83 : PPB_FileRef_Shared(::ppapi::OBJECT_IS_IMPL, info),
84 file_system_(file_system), 84 file_system_(file_system),
85 external_file_system_path_() { 85 external_file_system_path_() {
86 } 86 }
87 87
88 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info, 88 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info,
89 const FilePath& external_file_path) 89 const FilePath& external_file_path)
90 : PPB_FileRef_Shared(PPB_FileRef_Shared::InitAsImpl(), info), 90 : PPB_FileRef_Shared(::ppapi::OBJECT_IS_IMPL, info),
91 file_system_(), 91 file_system_(),
92 external_file_system_path_(external_file_path) { 92 external_file_system_path_(external_file_path) {
93 } 93 }
94 94
95 PPB_FileRef_Impl::~PPB_FileRef_Impl() { 95 PPB_FileRef_Impl::~PPB_FileRef_Impl() {
96 } 96 }
97 97
98 // static 98 // static
99 PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Resource pp_file_system, 99 PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Resource pp_file_system,
100 const std::string& path) { 100 const std::string& path) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return file_system_ && file_system_->opened(); 281 return file_system_ && file_system_->opened();
282 } 282 }
283 283
284 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { 284 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const {
285 return file_system_ && file_system_->opened() && 285 return file_system_ && file_system_->opened() &&
286 file_system_->type() != PP_FILESYSTEMTYPE_EXTERNAL; 286 file_system_->type() != PP_FILESYSTEMTYPE_EXTERNAL;
287 } 287 }
288 288
289 } // namespace ppapi 289 } // namespace ppapi
290 } // namespace webkit 290 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698