17d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
27d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
37d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// found in the LICENSE file.
47d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
57d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#ifndef CHROME_RENDERER_PEPPER_PEPPER_FLASH_DRM_RENDERER_HOST_H_
67d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#define CHROME_RENDERER_PEPPER_PEPPER_FLASH_DRM_RENDERER_HOST_H_
77d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
87d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "base/basictypes.h"
97d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "base/compiler_specific.h"
10d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "base/memory/weak_ptr.h"
117d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "ppapi/host/resource_host.h"
127d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
13d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)namespace base {
14d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)class FilePath;
15d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)}
16d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
177d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)namespace content {
187d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)class RendererPpapiHost;
197d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)}
207d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
217d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// TODO(raymes): This is only needed until we move FileRef resources to the
227d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// browser. After that, get rid of this class altogether.
237d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)class PepperFlashDRMRendererHost : public ppapi::host::ResourceHost {
247d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) public:
257d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  PepperFlashDRMRendererHost(content::RendererPpapiHost* host,
267d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)                             PP_Instance instance,
277d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)                             PP_Resource resource);
287d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  virtual ~PepperFlashDRMRendererHost();
297d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
307d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  virtual int32_t OnResourceMessageReceived(
317d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)      const IPC::Message& msg,
327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)      ppapi::host::HostMessageContext* context) OVERRIDE;
337d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
347d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) private:
357d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  int32_t OnGetVoucherFile(ppapi::host::HostMessageContext* context);
367d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
37d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  void DidCreateFileRefHosts(
38d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)      const ppapi::host::ReplyMessageContext& reply_context,
39d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)      const base::FilePath& external_path,
40d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)      int renderer_pending_host_id,
41d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)      const std::vector<int>& browser_pending_host_ids);
42d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
437d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  // Non-owning pointer.
447d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  content::RendererPpapiHost* renderer_ppapi_host_;
457d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
46d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  base::WeakPtrFactory<PepperFlashDRMRendererHost> weak_factory_;
47d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
487d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMRendererHost);
497d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)};
507d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
517d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#endif  // CHROME_RENDERER_PEPPER_PEPPER_FLASH_DRM_RENDERER_HOST_H_
52