summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/pepper
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-29 02:15:49 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-29 02:15:49 +0000
commit2498c499249ef946517e2238a8f688c6d0f0a086 (patch)
treec7498fea0ef897dcee9411674aaca62194522344 /chrome/renderer/pepper
parent25df6cd8013abc840d3906eedbefd850e264a86e (diff)
downloadchromium_src-2498c499249ef946517e2238a8f688c6d0f0a086.zip
chromium_src-2498c499249ef946517e2238a8f688c6d0f0a086.tar.gz
chromium_src-2498c499249ef946517e2238a8f688c6d0f0a086.tar.bz2
Revert 219911 "Pepper: Move FileRef to the "new" resource proxy."
There have been multiple test failures among users of the CRX filesystem, which is not adequately tested by existing tests. I'm not sure at all what's broken, but I guess I'll have to do manual testing to sort it out. > 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 > > Review URL: https://chromiumcodereview.appspot.com/21966004 TBR=teravest@chromium.org Review URL: https://codereview.chromium.org/23462016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/pepper')
-rw-r--r--chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc40
-rw-r--r--chrome/renderer/pepper/pepper_flash_drm_renderer_host.h12
2 files changed, 9 insertions, 43 deletions
diff --git a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc
index 243a9bb..ca59c7ef 100644
--- a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc
+++ b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc
@@ -12,6 +12,7 @@
#include "ppapi/host/host_message_context.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/proxy/ppb_file_ref_proxy.h"
namespace chrome {
@@ -27,8 +28,7 @@ PepperFlashDRMRendererHost::PepperFlashDRMRendererHost(
PP_Instance instance,
PP_Resource resource)
: ResourceHost(host->GetPpapiHost(), instance, resource),
- renderer_ppapi_host_(host),
- weak_factory_(this) {
+ renderer_ppapi_host_(host) {
}
PepperFlashDRMRendererHost::~PepperFlashDRMRendererHost() {
@@ -56,35 +56,13 @@ int32_t PepperFlashDRMRendererHost::OnGetVoucherFile(
base::FilePath voucher_file = plugin_dir.Append(
base::FilePath(kVoucherFilename));
- std::vector<IPC::Message> create_msgs;
- create_msgs.push_back(PpapiHostMsg_FileRef_CreateExternal(voucher_file));
-
- renderer_ppapi_host_->CreateBrowserResourceHosts(
- pp_instance(),
- create_msgs,
- base::Bind(&PepperFlashDRMRendererHost::DidCreateFileRefHosts,
- weak_factory_.GetWeakPtr(),
- context->MakeReplyMessageContext(),
- voucher_file));
- return PP_OK_COMPLETIONPENDING;
-}
-
-void PepperFlashDRMRendererHost::DidCreateFileRefHosts(
- const ppapi::host::ReplyMessageContext& reply_context,
- const base::FilePath& external_path,
- const std::vector<int>& pending_resource_ids) {
- DCHECK(pending_resource_ids.size() == 1);
-
- int pending_resource_id = 0;
- if (pending_resource_ids.size() == 1)
- pending_resource_id = pending_resource_ids[0];
-
- ppapi::FileRefCreateInfo create_info =
- ppapi::MakeExternalFileRefCreateInfo(external_path,
- std::string(),
- pending_resource_id);
- host()->SendReply(reply_context,
- PpapiPluginMsg_FlashDRM_GetVoucherFileReply(create_info));
+ ppapi::PPB_FileRef_CreateInfo create_info;
+ ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef(
+ plugin_instance->CreateExternalFileReference(voucher_file),
+ &create_info);
+ context->reply_msg =
+ PpapiPluginMsg_FlashDRM_GetVoucherFileReply(create_info);
+ return PP_OK;
}
} // namespace chrome
diff --git a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.h b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.h
index 4e39c71..f7247d6 100644
--- a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.h
+++ b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.h
@@ -7,13 +7,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/memory/weak_ptr.h"
#include "ppapi/host/resource_host.h"
-namespace base {
-class FilePath;
-}
-
namespace content {
class RendererPpapiHost;
}
@@ -36,16 +31,9 @@ class PepperFlashDRMRendererHost : public ppapi::host::ResourceHost {
private:
int32_t OnGetVoucherFile(ppapi::host::HostMessageContext* context);
- void DidCreateFileRefHosts(
- const ppapi::host::ReplyMessageContext& reply_context,
- const base::FilePath& external_path,
- const std::vector<int>& pending_resource_ids);
-
// Non-owning pointer.
content::RendererPpapiHost* renderer_ppapi_host_;
- base::WeakPtrFactory<PepperFlashDRMRendererHost> weak_factory_;
-
DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMRendererHost);
};