Chromium Code Reviews| Index: chrome/renderer/pepper/pepper_ext_crx_file_system_renderer_host.h |
| diff --git a/chrome/renderer/pepper/pepper_ext_crx_file_system_renderer_host.h b/chrome/renderer/pepper/pepper_ext_crx_file_system_renderer_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..077aee51d3fb8861f14a0df441ee5e6c90bb68be |
| --- /dev/null |
| +++ b/chrome/renderer/pepper/pepper_ext_crx_file_system_renderer_host.h |
| @@ -0,0 +1,56 @@ |
| +// Copyright (c) 2013 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_EXT_CRX_FILE_SYSTEM_RENDERER_HOST_H_ |
| +#define CHROME_RENDERER_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_RENDERER_HOST_H_ |
| + |
| +#include "googleurl/src/gurl.h" |
| +#include "ppapi/c/pp_instance.h" |
| +#include "ppapi/c/pp_resource.h" |
| +#include "ppapi/host/file_system_registry.h" |
| +#include "ppapi/host/host_message_context.h" |
| +#include "ppapi/host/resource_host.h" |
| +#include "ppapi/proxy/resource_message_params.h" |
| + |
| +namespace content { |
| +class RendererPpapiHost; |
| +} |
| + |
| +namespace chrome { |
| + |
| +// Renderer host of CRX filesystem resource, mainly to allow FileRef direct |
| +// access (through FileSystemPeeker) on the host side. |
|
kinuko
2013/04/18 13:45:03
Hmm, this Peeker design is interesting..
|
| +class PepperExtCrxFileSystemRendererHost |
| + : public ppapi::host::ResourceHost, |
| + public ppapi::host::FileSystemRegistry::FileSystemPeeker { |
| + public: |
| + PepperExtCrxFileSystemRendererHost(content::RendererPpapiHost* host, |
| + PP_Instance instance, |
| + PP_Resource resource); |
| + virtual ~PepperExtCrxFileSystemRendererHost(); |
| + |
| + // ResourceHost override. |
| + virtual int32_t OnResourceMessageReceived( |
| + const IPC::Message& msg, |
| + ppapi::host::HostMessageContext* context) OVERRIDE; |
| + |
| + // PepperFileSystemRegistry::FileSystemPeeker override. |
| + virtual PP_FileSystemType GetType() const OVERRIDE; |
| + virtual bool IsOpened() const OVERRIDE; |
| + virtual GURL GetRootUrl() const OVERRIDE; |
|
teravest
2013/04/18 16:10:38
This can probably return const GURL&
victorhsieh
2013/04/18 19:28:38
Done.
|
| + |
| + private: |
| + int32_t OnOpenFileSystem(ppapi::host::HostMessageContext* context, |
| + const std::string& origin, |
| + const std::string& fsid); |
| + |
| + bool opened_; |
| + GURL root_url_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PepperExtCrxFileSystemRendererHost); |
| +}; |
| + |
| +} // namespace chrome |
| + |
| +#endif // CHROME_RENDERER_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_RENDERER_HOST_H_ |