Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / extensions / api / messaging / extension_message_port.h
blob79b8003e6e5815b44879def5e06219fee3b5ed71
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
8 #include "chrome/browser/extensions/api/messaging/message_service.h"
10 class GURL;
12 namespace content {
13 class RenderProcessHost;
14 } // namespace content
16 namespace extensions {
18 // A port that manages communication with an extension.
19 class ExtensionMessagePort : public MessageService::MessagePort {
20 public:
21 ExtensionMessagePort(content::RenderProcessHost* process,
22 int routing_id,
23 const std::string& extension_id);
24 void DispatchOnConnect(int dest_port_id,
25 const std::string& channel_name,
26 scoped_ptr<base::DictionaryValue> source_tab,
27 int source_frame_id,
28 int target_tab_id,
29 int target_frame_id,
30 int guest_process_id,
31 int guest_render_frame_routing_id,
32 const std::string& source_extension_id,
33 const std::string& target_extension_id,
34 const GURL& source_url,
35 const std::string& tls_channel_id) override;
36 void DispatchOnDisconnect(int source_port_id,
37 const std::string& error_message) override;
38 void DispatchOnMessage(const Message& message, int target_port_id) override;
39 void IncrementLazyKeepaliveCount() override;
40 void DecrementLazyKeepaliveCount() override;
41 content::RenderProcessHost* GetRenderProcessHost() override;
43 private:
44 content::RenderProcessHost* process_;
45 int routing_id_;
46 std::string extension_id_;
47 void* background_host_ptr_; // used in IncrementLazyKeepaliveCount
50 } // namespace extensions
52 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_