OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
6 #define CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 6 #define CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Converts the IPC messages from WebPluginDelegateProxy into calls to the | 35 // Converts the IPC messages from WebPluginDelegateProxy into calls to the |
36 // actual WebPluginDelegateImpl object. | 36 // actual WebPluginDelegateImpl object. |
37 class WebPluginDelegateStub : public IPC::Listener, | 37 class WebPluginDelegateStub : public IPC::Listener, |
38 public IPC::Sender, | 38 public IPC::Sender, |
39 public base::RefCounted<WebPluginDelegateStub> { | 39 public base::RefCounted<WebPluginDelegateStub> { |
40 public: | 40 public: |
41 WebPluginDelegateStub(const std::string& mime_type, int instance_id, | 41 WebPluginDelegateStub(const std::string& mime_type, int instance_id, |
42 PluginChannel* channel); | 42 PluginChannel* channel); |
43 | 43 |
44 // IPC::Listener implementation: | 44 // IPC::Listener implementation: |
45 virtual bool OnMessageReceived(const IPC::Message& msg) override; | 45 bool OnMessageReceived(const IPC::Message& msg) override; |
46 | 46 |
47 // IPC::Sender implementation: | 47 // IPC::Sender implementation: |
48 virtual bool Send(IPC::Message* msg) override; | 48 bool Send(IPC::Message* msg) override; |
49 | 49 |
50 int instance_id() { return instance_id_; } | 50 int instance_id() { return instance_id_; } |
51 WebPluginDelegateImpl* delegate() { return delegate_; } | 51 WebPluginDelegateImpl* delegate() { return delegate_; } |
52 WebPluginProxy* webplugin() { return webplugin_; } | 52 WebPluginProxy* webplugin() { return webplugin_; } |
53 | 53 |
54 private: | 54 private: |
55 friend class base::RefCounted<WebPluginDelegateStub>; | 55 friend class base::RefCounted<WebPluginDelegateStub>; |
56 | 56 |
57 virtual ~WebPluginDelegateStub(); | 57 ~WebPluginDelegateStub() override; |
58 | 58 |
59 // Message handlers for the WebPluginDelegate calls that are proxied from the | 59 // Message handlers for the WebPluginDelegate calls that are proxied from the |
60 // renderer over the IPC channel. | 60 // renderer over the IPC channel. |
61 void OnInit(const PluginMsg_Init_Params& params, | 61 void OnInit(const PluginMsg_Init_Params& params, |
62 bool* transparent, | 62 bool* transparent, |
63 bool* result); | 63 bool* result); |
64 void OnWillSendRequest(int id, const GURL& url, int http_status_code); | 64 void OnWillSendRequest(int id, const GURL& url, int http_status_code); |
65 void OnDidReceiveResponse(const PluginMsg_DidReceiveResponseParams& params); | 65 void OnDidReceiveResponse(const PluginMsg_DidReceiveResponseParams& params); |
66 void OnDidReceiveData(int id, const std::vector<char>& buffer, | 66 void OnDidReceiveData(int id, const std::vector<char>& buffer, |
67 int data_offset); | 67 int data_offset); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // The url of the main frame hosting the plugin. | 124 // The url of the main frame hosting the plugin. |
125 GURL page_url_; | 125 GURL page_url_; |
126 | 126 |
127 DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); | 127 DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace content | 130 } // namespace content |
131 | 131 |
132 #endif // CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 132 #endif // CONTENT_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
OLD | NEW |