flash_drm_host not required
This commit is contained in:
parent
3fdc4543b8
commit
1c190388e5
6 changed files with 2 additions and 154 deletions
|
@ -18,10 +18,7 @@
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
int32 kPepperFlashPermissions = ppapi::PERMISSION_DEV |
|
int32 kPepperFlashPermissions = ppapi::PERMISSION_ALL_BITS;
|
||||||
ppapi::PERMISSION_PRIVATE |
|
|
||||||
ppapi::PERMISSION_BYPASS_USER_GESTURE |
|
|
||||||
ppapi::PERMISSION_FLASH;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -65,11 +65,6 @@ scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
|
||||||
return scoped_ptr<ResourceHost>(new MessageFilterHost(
|
return scoped_ptr<ResourceHost>(new MessageFilterHost(
|
||||||
host_->GetPpapiHost(), instance, resource, clipboard_filter));
|
host_->GetPpapiHost(), instance, resource, clipboard_filter));
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
case PpapiHostMsg_FlashDRM_Create::ID:
|
|
||||||
return scoped_ptr<ResourceHost>(
|
|
||||||
new PepperFlashDRMHost(host_, instance, resource));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h"
|
#include "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "chrome/renderer/pepper/pepper_flash_drm_renderer_host.h"
|
|
||||||
#include "chrome/renderer/pepper/pepper_flash_font_file_host.h"
|
#include "chrome/renderer/pepper/pepper_flash_font_file_host.h"
|
||||||
#include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
|
#include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
|
||||||
#include "chrome/renderer/pepper/pepper_flash_menu_host.h"
|
#include "chrome/renderer/pepper/pepper_flash_menu_host.h"
|
||||||
|
@ -77,9 +76,6 @@ scoped_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PpapiHostMsg_FlashDRM_Create::ID:
|
|
||||||
return scoped_ptr<ResourceHost>(
|
|
||||||
new PepperFlashDRMRendererHost(host_, instance, resource));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
// 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 "chrome/renderer/pepper/pepper_flash_drm_renderer_host.h"
|
|
||||||
|
|
||||||
#include "base/files/file_path.h"
|
|
||||||
#include "content/public/renderer/pepper_plugin_instance.h"
|
|
||||||
#include "content/public/renderer/renderer_ppapi_host.h"
|
|
||||||
#include "ppapi/c/pp_errors.h"
|
|
||||||
#include "ppapi/host/dispatch_host_message.h"
|
|
||||||
#include "ppapi/host/host_message_context.h"
|
|
||||||
#include "ppapi/host/ppapi_host.h"
|
|
||||||
#include "ppapi/proxy/ppapi_messages.h"
|
|
||||||
|
|
||||||
// TODO(raymes): This is duplicated from pepper_flash_drm_host.cc but once
|
|
||||||
// FileRef is refactored to the browser, it won't need to be.
|
|
||||||
namespace {
|
|
||||||
const char kVoucherFilename[] = "plugin.vch";
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
PepperFlashDRMRendererHost::PepperFlashDRMRendererHost(
|
|
||||||
content::RendererPpapiHost* host,
|
|
||||||
PP_Instance instance,
|
|
||||||
PP_Resource resource)
|
|
||||||
: ResourceHost(host->GetPpapiHost(), instance, resource),
|
|
||||||
renderer_ppapi_host_(host),
|
|
||||||
weak_factory_(this) {}
|
|
||||||
|
|
||||||
PepperFlashDRMRendererHost::~PepperFlashDRMRendererHost() {}
|
|
||||||
|
|
||||||
int32_t PepperFlashDRMRendererHost::OnResourceMessageReceived(
|
|
||||||
const IPC::Message& msg,
|
|
||||||
ppapi::host::HostMessageContext* context) {
|
|
||||||
PPAPI_BEGIN_MESSAGE_MAP(PepperFlashDRMRendererHost, msg)
|
|
||||||
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_GetVoucherFile,
|
|
||||||
OnGetVoucherFile)
|
|
||||||
PPAPI_END_MESSAGE_MAP()
|
|
||||||
return PP_ERROR_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t PepperFlashDRMRendererHost::OnGetVoucherFile(
|
|
||||||
ppapi::host::HostMessageContext* context) {
|
|
||||||
content::PepperPluginInstance* plugin_instance =
|
|
||||||
renderer_ppapi_host_->GetPluginInstance(pp_instance());
|
|
||||||
if (!plugin_instance)
|
|
||||||
return PP_ERROR_FAILED;
|
|
||||||
|
|
||||||
base::FilePath plugin_dir = plugin_instance->GetModulePath().DirName();
|
|
||||||
DCHECK(!plugin_dir.empty());
|
|
||||||
base::FilePath voucher_file = plugin_dir.AppendASCII(kVoucherFilename);
|
|
||||||
|
|
||||||
int renderer_pending_host_id =
|
|
||||||
plugin_instance->MakePendingFileRefRendererHost(voucher_file);
|
|
||||||
if (renderer_pending_host_id == 0)
|
|
||||||
return PP_ERROR_FAILED;
|
|
||||||
|
|
||||||
std::vector<IPC::Message> create_msgs;
|
|
||||||
create_msgs.push_back(PpapiHostMsg_FileRef_CreateForRawFS(voucher_file));
|
|
||||||
|
|
||||||
renderer_ppapi_host_->CreateBrowserResourceHosts(
|
|
||||||
pp_instance(),
|
|
||||||
create_msgs,
|
|
||||||
base::Bind(&PepperFlashDRMRendererHost::DidCreateFileRefHosts,
|
|
||||||
weak_factory_.GetWeakPtr(),
|
|
||||||
context->MakeReplyMessageContext(),
|
|
||||||
voucher_file,
|
|
||||||
renderer_pending_host_id));
|
|
||||||
return PP_OK_COMPLETIONPENDING;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PepperFlashDRMRendererHost::DidCreateFileRefHosts(
|
|
||||||
const ppapi::host::ReplyMessageContext& reply_context,
|
|
||||||
const base::FilePath& external_path,
|
|
||||||
int renderer_pending_host_id,
|
|
||||||
const std::vector<int>& browser_pending_host_ids) {
|
|
||||||
DCHECK_EQ(1U, browser_pending_host_ids.size());
|
|
||||||
int browser_pending_host_id = browser_pending_host_ids[0];
|
|
||||||
|
|
||||||
ppapi::FileRefCreateInfo create_info =
|
|
||||||
ppapi::MakeExternalFileRefCreateInfo(external_path,
|
|
||||||
std::string(),
|
|
||||||
browser_pending_host_id,
|
|
||||||
renderer_pending_host_id);
|
|
||||||
host()->SendReply(reply_context,
|
|
||||||
PpapiPluginMsg_FlashDRM_GetVoucherFileReply(create_info));
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
#ifndef CHROME_RENDERER_PEPPER_PEPPER_FLASH_DRM_RENDERER_HOST_H_
|
|
||||||
#define CHROME_RENDERER_PEPPER_PEPPER_FLASH_DRM_RENDERER_HOST_H_
|
|
||||||
|
|
||||||
#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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(raymes): This is only needed until we move FileRef resources to the
|
|
||||||
// browser. After that, get rid of this class altogether.
|
|
||||||
class PepperFlashDRMRendererHost : public ppapi::host::ResourceHost {
|
|
||||||
public:
|
|
||||||
PepperFlashDRMRendererHost(content::RendererPpapiHost* host,
|
|
||||||
PP_Instance instance,
|
|
||||||
PP_Resource resource);
|
|
||||||
~PepperFlashDRMRendererHost() override;
|
|
||||||
|
|
||||||
int32_t OnResourceMessageReceived(
|
|
||||||
const IPC::Message& msg,
|
|
||||||
ppapi::host::HostMessageContext* context) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
int32_t OnGetVoucherFile(ppapi::host::HostMessageContext* context);
|
|
||||||
|
|
||||||
void DidCreateFileRefHosts(
|
|
||||||
const ppapi::host::ReplyMessageContext& reply_context,
|
|
||||||
const base::FilePath& external_path,
|
|
||||||
int renderer_pending_host_id,
|
|
||||||
const std::vector<int>& browser_pending_host_ids);
|
|
||||||
|
|
||||||
// Non-owning pointer.
|
|
||||||
content::RendererPpapiHost* renderer_ppapi_host_;
|
|
||||||
|
|
||||||
base::WeakPtrFactory<PepperFlashDRMRendererHost> weak_factory_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMRendererHost);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CHROME_RENDERER_PEPPER_PEPPER_FLASH_DRM_RENDERER_HOST_H_
|
|
|
@ -345,8 +345,6 @@
|
||||||
'chromium_src/chrome/common/tts_utterance_request.h',
|
'chromium_src/chrome/common/tts_utterance_request.h',
|
||||||
'chromium_src/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc',
|
'chromium_src/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc',
|
||||||
'chromium_src/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h',
|
'chromium_src/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h',
|
||||||
'chromium_src/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc',
|
|
||||||
'chromium_src/chrome/renderer/pepper/pepper_flash_drm_renderer_host.h',
|
|
||||||
'chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.cc',
|
'chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.cc',
|
||||||
'chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.h',
|
'chromium_src/chrome/renderer/pepper/pepper_flash_font_file_host.h',
|
||||||
'chromium_src/chrome/renderer/pepper/pepper_flash_fullscreen_host.cc',
|
'chromium_src/chrome/renderer/pepper/pepper_flash_fullscreen_host.cc',
|
||||||
|
|
Loading…
Reference in a new issue