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_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXTENSIONS_COMMON_MESSAGE_FIL
TER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXTENSIONS_COMMON_MESSAGE_FIL
TER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
| 12 #include "base/files/file_path.h" |
| 13 #include "googleurl/src/gurl.h" |
| 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/host/resource_message_filter.h" |
| 16 |
| 17 namespace base { |
| 18 class ListValue; |
| 19 } |
| 20 |
| 21 namespace content { |
| 22 class BrowserPpapiHost; |
| 23 } |
| 24 |
| 25 namespace ppapi { |
| 26 namespace host { |
| 27 struct HostMessageContext; |
| 28 } |
| 29 } |
| 30 |
| 31 namespace chrome { |
| 32 |
| 33 class PepperExtensionsCommonMessageFilter |
| 34 : public ppapi::host::ResourceMessageFilter { |
| 35 public: |
| 36 static PepperExtensionsCommonMessageFilter* Create( |
| 37 content::BrowserPpapiHost* host, |
| 38 PP_Instance instance); |
| 39 |
| 40 protected: |
| 41 PepperExtensionsCommonMessageFilter(int render_process_id, |
| 42 int render_view_id, |
| 43 const base::FilePath& profile_directory, |
| 44 const GURL& document_url); |
| 45 virtual ~PepperExtensionsCommonMessageFilter(); |
| 46 |
| 47 // ppapi::host::ResourceMessageFilter overrides. |
| 48 virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( |
| 49 const IPC::Message& msg) OVERRIDE; |
| 50 virtual int32_t OnResourceMessageReceived( |
| 51 const IPC::Message& msg, |
| 52 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 53 |
| 54 private: |
| 55 int32_t OnPost(ppapi::host::HostMessageContext* context, |
| 56 const std::string& request_name, |
| 57 base::ListValue& args); |
| 58 |
| 59 int32_t OnCall(ppapi::host::HostMessageContext* context, |
| 60 const std::string& request_name, |
| 61 base::ListValue& args); |
| 62 |
| 63 // All the members are initialized on the IO thread when the object is |
| 64 // constructed, and accessed only on the UI thread afterwards. |
| 65 int render_process_id_; |
| 66 int render_view_id_; |
| 67 base::FilePath profile_directory_; |
| 68 GURL document_url_; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(PepperExtensionsCommonMessageFilter); |
| 71 }; |
| 72 |
| 73 } // namespace chrome |
| 74 |
| 75 #endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_EXTENSIONS_COMMON_MESSAGE_
FILTER_H_ |
OLD | NEW |