summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-01 17:29:36 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-01 17:29:36 +0000
commit69fdab209f919fd0538b2c0c0fcafe0255836f37 (patch)
treec91775b5f7576d1203ba123ddae6e868546da89b /ppapi
parent014f00f31aa5ab156052587b1dc21a403f2551b0 (diff)
downloadchromium_src-69fdab209f919fd0538b2c0c0fcafe0255836f37.zip
chromium_src-69fdab209f919fd0538b2c0c0fcafe0255836f37.tar.gz
chromium_src-69fdab209f919fd0538b2c0c0fcafe0255836f37.tar.bz2
Pepper: Fix display name for internal FileRefs.
There was a bug where internal FileRefs would use the given display name instead of determining it from the internal filesystem. This fixes that problem. R=yzshen BUG= Review URL: https://chromiumcodereview.appspot.com/18211002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/file_ref_resource.cc13
-rw-r--r--ppapi/proxy/file_ref_resource.h4
2 files changed, 9 insertions, 8 deletions
diff --git a/ppapi/proxy/file_ref_resource.cc b/ppapi/proxy/file_ref_resource.cc
index c66a321..38379bd 100644
--- a/ppapi/proxy/file_ref_resource.cc
+++ b/ppapi/proxy/file_ref_resource.cc
@@ -22,10 +22,9 @@ namespace proxy {
FileRefResource::FileRefResource(
Connection connection,
PP_Instance instance,
- FileRef_CreateInfo create_info)
+ const FileRef_CreateInfo& create_info)
: PluginResource(connection, instance),
- create_info_(create_info),
- name_var_(new StringVar(create_info_.display_name)) {
+ create_info_(create_info) {
if (create_info_.file_system_type != PP_FILESYSTEMTYPE_EXTERNAL) {
// If path ends with a slash, then normalize it away unless path is
// the root path.
@@ -38,6 +37,7 @@ FileRefResource::FileRefResource(
create_info_.display_name = GetNameForInternalFilePath(
create_info_.internal_path);
}
+ name_var_ = new StringVar(create_info_.display_name);
if (create_info_.pending_host_resource_id != 0) {
AttachToPendingHost(BROWSER, create_info_.pending_host_resource_id);
@@ -53,9 +53,10 @@ FileRefResource::~FileRefResource() {
}
//static
-PP_Resource FileRefResource::CreateFileRef(Connection connection,
- PP_Instance instance,
- FileRef_CreateInfo create_info) {
+PP_Resource FileRefResource::CreateFileRef(
+ Connection connection,
+ PP_Instance instance,
+ const FileRef_CreateInfo& create_info) {
// If we have a valid file_system resource, ensure that its type matches that
// of the fs_type parameter.
if (create_info.pending_host_resource_id != 0) {
diff --git a/ppapi/proxy/file_ref_resource.h b/ppapi/proxy/file_ref_resource.h
index 62926d7..4e4d1b6 100644
--- a/ppapi/proxy/file_ref_resource.h
+++ b/ppapi/proxy/file_ref_resource.h
@@ -28,7 +28,7 @@ class PPAPI_PROXY_EXPORT FileRefResource
public:
static PP_Resource CreateFileRef(Connection connection,
PP_Instance instance,
- FileRef_CreateInfo info);
+ const FileRef_CreateInfo& info);
virtual ~FileRefResource();
@@ -68,7 +68,7 @@ class PPAPI_PROXY_EXPORT FileRefResource
private:
FileRefResource(Connection connection,
PP_Instance instance,
- FileRef_CreateInfo info);
+ const FileRef_CreateInfo& info);
void RunTrackedCallback(scoped_refptr<TrackedCallback> callback,
const ResourceMessageReplyParams& params);