Commit 21bed4d9 authored by Uzair Jaleel's avatar Uzair Jaleel Committed by Commit Bot

Remove WeakPtrFactory from PepperFileSystemHost

PepperFileSystemHost already inherits SupportsWeakPtr.
Hence, instead of creating a WeakPtrFactory instance to
access its weak pointer, we can directly use AsWeakPtr().

BUG=None

Change-Id: I97e716d9ceb479e02ae7b80ea77fe1eaf7bf28b0
Reviewed-on: https://chromium-review.googlesource.com/590342Reviewed-by: default avatarBill Budge <bbudge@chromium.org>
Commit-Queue: SUCHIT AGRAWAL <a.suchit@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490664}
parent d36bea9f
......@@ -33,8 +33,7 @@ PepperFileSystemHost::PepperFileSystemHost(RendererPpapiHost* host,
renderer_ppapi_host_(host),
type_(type),
opened_(false),
called_open_(false),
weak_factory_(this) {}
called_open_(false) {}
PepperFileSystemHost::PepperFileSystemHost(RendererPpapiHost* host,
PP_Instance instance,
......@@ -46,8 +45,7 @@ PepperFileSystemHost::PepperFileSystemHost(RendererPpapiHost* host,
type_(type),
opened_(true),
root_url_(root_url),
called_open_(true),
weak_factory_(this) {}
called_open_(true) {}
PepperFileSystemHost::~PepperFileSystemHost() {}
......@@ -105,12 +103,9 @@ int32_t PepperFileSystemHost::OnHostMsgOpen(
ChildThreadImpl::current()->file_system_dispatcher();
reply_context_ = context->MakeReplyMessageContext();
file_system_dispatcher->OpenFileSystem(
document_url.GetOrigin(),
file_system_type,
base::Bind(&PepperFileSystemHost::DidOpenFileSystem,
weak_factory_.GetWeakPtr()),
base::Bind(&PepperFileSystemHost::DidFailOpenFileSystem,
weak_factory_.GetWeakPtr()));
document_url.GetOrigin(), file_system_type,
base::Bind(&PepperFileSystemHost::DidOpenFileSystem, AsWeakPtr()),
base::Bind(&PepperFileSystemHost::DidFailOpenFileSystem, AsWeakPtr()));
return PP_OK_COMPLETIONPENDING;
}
......
......@@ -74,8 +74,6 @@ class PepperFileSystemHost
GURL root_url_;
bool called_open_; // whether open has been called.
base::WeakPtrFactory<PepperFileSystemHost> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PepperFileSystemHost);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment