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 16 matching lines...) Expand all Loading... |
27 // process ID to identify which plugin they are talking about. | 27 // process ID to identify which plugin they are talking about. |
28 class PepperBrowserConnection | 28 class PepperBrowserConnection |
29 : public RenderFrameObserver, | 29 : public RenderFrameObserver, |
30 public RenderFrameObserverTracker<PepperBrowserConnection> { | 30 public RenderFrameObserverTracker<PepperBrowserConnection> { |
31 public: | 31 public: |
32 typedef base::Callback<void(const std::vector<int>&)> | 32 typedef base::Callback<void(const std::vector<int>&)> |
33 PendingResourceIDCallback; | 33 PendingResourceIDCallback; |
34 explicit PepperBrowserConnection(RenderFrame* render_frame); | 34 explicit PepperBrowserConnection(RenderFrame* render_frame); |
35 virtual ~PepperBrowserConnection(); | 35 virtual ~PepperBrowserConnection(); |
36 | 36 |
37 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 37 virtual bool OnMessageReceived(const IPC::Message& message) override; |
38 | 38 |
39 // TODO(teravest): Instead of having separate methods per message, we should | 39 // TODO(teravest): Instead of having separate methods per message, we should |
40 // add generic functionality similar to PluginResource::Call(). | 40 // add generic functionality similar to PluginResource::Call(). |
41 | 41 |
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, |
(...skipping 21 matching lines...) Expand all Loading... |
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 |