summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/ppb_file_ref_shared.cc
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-05 23:36:16 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-05 23:36:16 +0000
commit76bf34a3260833d1cd522a9a7ccc4114baa4b72b (patch)
treedbd0196dca13c32c6ccdc289dbea541285baedf3 /ppapi/shared_impl/ppb_file_ref_shared.cc
parent32e6ccc621eeacc29df1c4c3fc88fa496351ff84 (diff)
downloadchromium_src-76bf34a3260833d1cd522a9a7ccc4114baa4b72b.zip
chromium_src-76bf34a3260833d1cd522a9a7ccc4114baa4b72b.tar.gz
chromium_src-76bf34a3260833d1cd522a9a7ccc4114baa4b72b.tar.bz2
Revert 221284 "Pepper: Move FileRef to the "new" resource proxy."
> Pepper: Move FileRef to the "new" resource proxy. > > This change moves the FileRef implementation from the previous one in the "old" > resource model (ppb_file_ref_impl.cc) to the "new" resource model > (pepper_file_ref_host.cc), and from the renderer to the browser. > > As many as possible of the supporting changes were split off to other changes > to minimize the size of this change. Unfortunately, a lot of changes for > URLLoader had to be rolled into this change. > > The data structures for CreateInfo have changed, and all users of FileRef have > to be moved over, which is what causes this change to be so large. > > TBR=dmichael@chromium.org, jschuh@chromium.org, yzshen@chromium.org > BUG=225441 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216744 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=218305 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219911 > > Review URL: https://codereview.chromium.org/21966004 TBR=teravest@chromium.org Review URL: https://codereview.chromium.org/23647008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/ppb_file_ref_shared.cc')
-rw-r--r--ppapi/shared_impl/ppb_file_ref_shared.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/ppapi/shared_impl/ppb_file_ref_shared.cc b/ppapi/shared_impl/ppb_file_ref_shared.cc
new file mode 100644
index 0000000..a47cdb8
--- /dev/null
+++ b/ppapi/shared_impl/ppb_file_ref_shared.cc
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/shared_impl/ppb_file_ref_shared.h"
+
+#include "base/logging.h"
+#include "ppapi/shared_impl/var.h"
+
+namespace ppapi {
+
+PPB_FileRef_Shared::PPB_FileRef_Shared(ResourceObjectType type,
+ const PPB_FileRef_CreateInfo& info)
+ : Resource(type, info.resource),
+ create_info_(info) {
+ if (type == OBJECT_IS_IMPL) {
+ // Resource's constructor assigned a PP_Resource, so we can fill out our
+ // host resource now.
+ create_info_.resource = host_resource();
+ }
+}
+
+PPB_FileRef_Shared::~PPB_FileRef_Shared() {
+}
+
+thunk::PPB_FileRef_API* PPB_FileRef_Shared::AsPPB_FileRef_API() {
+ return this;
+}
+
+PP_FileSystemType PPB_FileRef_Shared::GetFileSystemType() const {
+ return static_cast<PP_FileSystemType>(create_info_.file_system_type);
+}
+
+PP_Var PPB_FileRef_Shared::GetName() const {
+ if (!name_var_.get()) {
+ name_var_ = new StringVar(create_info_.name);
+ }
+ return name_var_->GetPPVar();
+}
+
+PP_Var PPB_FileRef_Shared::GetPath() const {
+ if (create_info_.file_system_type == PP_FILESYSTEMTYPE_EXTERNAL)
+ return PP_MakeUndefined();
+ if (!path_var_.get()) {
+ path_var_ = new StringVar(create_info_.path);
+ }
+ return path_var_->GetPPVar();
+}
+
+const PPB_FileRef_CreateInfo& PPB_FileRef_Shared::GetCreateInfo() const {
+ return create_info_;
+}
+
+} // namespace ppapi