OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_RENDERER_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_RENDERER_HOST_H_ |
| 6 #define CHROME_RENDERER_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_RENDERER_HOST_H_ |
| 7 |
| 8 #include "googleurl/src/gurl.h" |
| 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_resource.h" |
| 11 #include "ppapi/host/file_system_registry.h" |
| 12 #include "ppapi/host/host_message_context.h" |
| 13 #include "ppapi/host/resource_host.h" |
| 14 #include "ppapi/proxy/resource_message_params.h" |
| 15 |
| 16 namespace content { |
| 17 class RendererPpapiHost; |
| 18 } |
| 19 |
| 20 namespace chrome { |
| 21 |
| 22 // Renderer host of CRX filesystem resource, mainly to allow FileRef direct |
| 23 // access (through FileSystemPeeker) on the host side. |
| 24 class PepperExtCrxFileSystemRendererHost |
| 25 : public ppapi::host::ResourceHost, |
| 26 public ppapi::host::FileSystemRegistry::FileSystemPeeker { |
| 27 public: |
| 28 PepperExtCrxFileSystemRendererHost(content::RendererPpapiHost* host, |
| 29 PP_Instance instance, |
| 30 PP_Resource resource); |
| 31 virtual ~PepperExtCrxFileSystemRendererHost(); |
| 32 |
| 33 // ResourceHost override. |
| 34 virtual int32_t OnResourceMessageReceived( |
| 35 const IPC::Message& msg, |
| 36 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 37 |
| 38 // PepperFileSystemRegistry::FileSystemPeeker override. |
| 39 virtual PP_FileSystemType GetType() const OVERRIDE; |
| 40 virtual bool IsOpened() const OVERRIDE; |
| 41 virtual const GURL& GetRootUrl() const OVERRIDE; |
| 42 |
| 43 private: |
| 44 int32_t OnOpenFileSystem(ppapi::host::HostMessageContext* context, |
| 45 const std::string& origin, |
| 46 const std::string& fsid); |
| 47 |
| 48 bool opened_; |
| 49 GURL root_url_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(PepperExtCrxFileSystemRendererHost); |
| 52 }; |
| 53 |
| 54 } // namespace chrome |
| 55 |
| 56 #endif // CHROME_RENDERER_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_RENDERER_HOST_H_ |
OLD | NEW |