Chromium Code Reviews| Index: chrome/browser/renderer_host/pepper/pepper_ext_crx_file_system_browser_host.h |
| diff --git a/chrome/browser/renderer_host/pepper/pepper_ext_crx_file_system_browser_host.h b/chrome/browser/renderer_host/pepper/pepper_ext_crx_file_system_browser_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0772c9d054e83a151ca09af5b8e923c138355eeb |
| --- /dev/null |
| +++ b/chrome/browser/renderer_host/pepper/pepper_ext_crx_file_system_browser_host.h |
| @@ -0,0 +1,67 @@ |
| +// 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_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_BROWSER_HOST_H_ |
| +#define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_BROWSER_HOST_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/memory/weak_ptr.h" |
| +#include "ppapi/c/pp_instance.h" |
| +#include "ppapi/c/pp_resource.h" |
| +#include "ppapi/host/resource_host.h" |
| +#include "ppapi/proxy/resource_message_params.h" |
| + |
| +namespace content { |
| +class BrowserPpapiHost; |
| +} |
| + |
| +namespace ppapi { |
| +namespace host { |
| +struct HostMessageContext; |
| +} // namespace host |
| +} // namespace ppapi |
| + |
| +namespace chrome { |
| + |
| +class PepperExtCrxFileSystemBrowserHost |
|
yzshen1
2013/04/30 19:31:19
Because this performs its task on the UI thread on
victorhsieh
2013/04/30 22:04:32
But since we need to reply message in IO thread, i
yzshen1
2013/05/01 17:45:10
The code looks cleaner. There are other places whe
victorhsieh
2013/05/02 18:59:06
Done. Thanks for your previous hint of using cont
|
| + : public ppapi::host::ResourceHost, |
| + public base::SupportsWeakPtr<PepperExtCrxFileSystemBrowserHost> { |
|
yzshen1
2013/04/30 19:31:19
You already have weak_ptr_factory_. You probably d
victorhsieh
2013/04/30 22:04:32
Done.
|
| + public: |
| + PepperExtCrxFileSystemBrowserHost(content::BrowserPpapiHost* host, |
| + PP_Instance instance, |
| + PP_Resource resource); |
| + virtual ~PepperExtCrxFileSystemBrowserHost(); |
| + |
| + // ResourceHost override. |
| + virtual int32_t OnResourceMessageReceived( |
| + const IPC::Message& msg, |
| + ppapi::host::HostMessageContext* context) OVERRIDE; |
| + |
| + private: |
| + int32_t OnOpenFileSystem(ppapi::host::HostMessageContext* context); |
| + |
| + void OnIsolatedFileSystemCreated( |
| + ppapi::host::ReplyMessageContext reply_context, |
| + const std::string& fsid); |
| + |
| + void Reply( |
| + ppapi::host::ReplyMessageContext* reply_context, |
| + int32_t pp_error, |
| + const std::string& extension_id, |
| + const std::string& fsid); |
| + |
| + // Performs a sanity check that fsid received from plugin looks not harmful. |
|
yzshen1
2013/04/30 19:31:19
This fsid is *not* received from plugin, right? Th
victorhsieh
2013/04/30 22:04:32
Please see my design doc (CRX FileSystem Pepper (p
yzshen1
2013/05/01 17:45:10
I read it. The fsid is passed to the plugin proces
victorhsieh
2013/05/02 18:59:06
Done.
|
| + bool LooksLikeAGuid(const std::string& fsid) const; |
| + |
| + content::BrowserPpapiHost* browser_ppapi_host_; |
| + |
| + base::WeakPtrFactory<PepperExtCrxFileSystemBrowserHost> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PepperExtCrxFileSystemBrowserHost); |
| +}; |
| + |
| +} // namespace chrome |
| + |
| +#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXT_CRX_FILE_SYSTEM_BROWSER_HOST_H_ |