OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_PEPPER_PEPPER_BROWSER_CONNECTION_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_BROWSER_CONNECTION_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_BROWSER_CONNECTION_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_BROWSER_CONNECTION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Sends a request to the browser to create ResourceHosts for the given | 42 // Sends a request to the browser to create ResourceHosts for the given |
43 // |instance| of a plugin identified by |child_process_id|. |callback| will be | 43 // |instance| of a plugin identified by |child_process_id|. |callback| will be |
44 // run when a reply is received with the pending resource IDs. | 44 // run when a reply is received with the pending resource IDs. |
45 void SendBrowserCreate(PP_Instance instance, | 45 void SendBrowserCreate(PP_Instance instance, |
46 int child_process_id, | 46 int child_process_id, |
47 const std::vector<IPC::Message>& create_messages, | 47 const std::vector<IPC::Message>& create_messages, |
48 const PendingResourceIDCallback& callback); | 48 const PendingResourceIDCallback& callback); |
49 | 49 |
50 // Called when the renderer creates an in-process instance. | 50 // Called when the renderer creates an in-process instance. |
51 void DidCreateInProcessInstance(PP_Instance instance, | 51 void DidCreateInProcessInstance(PP_Instance instance, |
52 int render_view_id, | 52 int render_frame_id, |
53 const GURL& document_url, | 53 const GURL& document_url, |
54 const GURL& plugin_url); | 54 const GURL& plugin_url); |
55 | 55 |
56 // Called when the renderer deletes an in-process instance. | 56 // Called when the renderer deletes an in-process instance. |
57 void DidDeleteInProcessInstance(PP_Instance instance); | 57 void DidDeleteInProcessInstance(PP_Instance instance); |
58 | 58 |
59 private: | 59 private: |
60 // Message handlers. | 60 // Message handlers. |
61 void OnMsgCreateResourceHostsFromHostReply( | 61 void OnMsgCreateResourceHostsFromHostReply( |
62 int32_t sequence_number, | 62 int32_t sequence_number, |
63 const std::vector<int>& pending_resource_host_ids); | 63 const std::vector<int>& pending_resource_host_ids); |
64 | 64 |
65 // Return the next sequence number. | 65 // Return the next sequence number. |
66 int32_t GetNextSequence(); | 66 int32_t GetNextSequence(); |
67 | 67 |
68 // Sequence number to track pending callbacks. | 68 // Sequence number to track pending callbacks. |
69 int32_t next_sequence_number_; | 69 int32_t next_sequence_number_; |
70 | 70 |
71 // Maps a sequence number to the callback to be run. | 71 // Maps a sequence number to the callback to be run. |
72 std::map<int32_t, PendingResourceIDCallback> pending_create_map_; | 72 std::map<int32_t, PendingResourceIDCallback> pending_create_map_; |
73 DISALLOW_COPY_AND_ASSIGN(PepperBrowserConnection); | 73 DISALLOW_COPY_AND_ASSIGN(PepperBrowserConnection); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace content | 76 } // namespace content |
77 | 77 |
78 #endif // CONTENT_RENDERER_PEPPER_PEPPER_BROWSER_CONNECTION_H_ | 78 #endif // CONTENT_RENDERER_PEPPER_PEPPER_BROWSER_CONNECTION_H_ |
OLD | NEW |