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 #include "ppapi/proxy/plugin_resource.h" | 5 #include "ppapi/proxy/plugin_resource.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ppapi/proxy/plugin_globals.h" | 9 #include "ppapi/proxy/plugin_globals.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 PluginResource::~PluginResource() { | 27 PluginResource::~PluginResource() { |
28 if (sent_create_to_browser_) { | 28 if (sent_create_to_browser_) { |
29 connection_.browser_sender->Send( | 29 connection_.browser_sender->Send( |
30 new PpapiHostMsg_ResourceDestroyed(pp_resource())); | 30 new PpapiHostMsg_ResourceDestroyed(pp_resource())); |
31 } | 31 } |
32 if (sent_create_to_renderer_) { | 32 if (sent_create_to_renderer_) { |
33 connection_.renderer_sender->Send( | 33 connection_.renderer_sender->Send( |
34 new PpapiHostMsg_ResourceDestroyed(pp_resource())); | 34 new PpapiHostMsg_ResourceDestroyed(pp_resource())); |
35 } | 35 } |
36 | 36 |
37 if (resource_reply_thread_registrar_) | 37 if (resource_reply_thread_registrar_.get()) |
38 resource_reply_thread_registrar_->Unregister(pp_resource()); | 38 resource_reply_thread_registrar_->Unregister(pp_resource()); |
39 } | 39 } |
40 | 40 |
41 void PluginResource::OnReplyReceived( | 41 void PluginResource::OnReplyReceived( |
42 const proxy::ResourceMessageReplyParams& params, | 42 const proxy::ResourceMessageReplyParams& params, |
43 const IPC::Message& msg) { | 43 const IPC::Message& msg) { |
44 TRACE_EVENT2("ppapi proxy", "PluginResource::OnReplyReceived", | 44 TRACE_EVENT2("ppapi proxy", "PluginResource::OnReplyReceived", |
45 "Class", IPC_MESSAGE_ID_CLASS(msg.type()), | 45 "Class", IPC_MESSAGE_ID_CLASS(msg.type()), |
46 "Line", IPC_MESSAGE_ID_LINE(msg.type())); | 46 "Line", IPC_MESSAGE_ID_LINE(msg.type())); |
47 // Grab the callback for the reply sequence number and run it with |msg|. | 47 // Grab the callback for the reply sequence number and run it with |msg|. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 int32_t ret = next_sequence_number_; | 159 int32_t ret = next_sequence_number_; |
160 if (next_sequence_number_ == std::numeric_limits<int32_t>::max()) | 160 if (next_sequence_number_ == std::numeric_limits<int32_t>::max()) |
161 next_sequence_number_ = 1; // Skip 0 which is invalid. | 161 next_sequence_number_ = 1; // Skip 0 which is invalid. |
162 else | 162 else |
163 next_sequence_number_++; | 163 next_sequence_number_++; |
164 return ret; | 164 return ret; |
165 } | 165 } |
166 | 166 |
167 } // namespace proxy | 167 } // namespace proxy |
168 } // namespace ppapi | 168 } // namespace ppapi |
OLD | NEW |