OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ppb_file_ref_proxy.h" | 5 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // the callback will be identified when it's passed to the host and then | 69 // the callback will be identified when it's passed to the host and then |
70 // back here. | 70 // back here. |
71 int next_callback_id_; | 71 int next_callback_id_; |
72 typedef std::map<int, scoped_refptr<TrackedCallback> > PendingCallbackMap; | 72 typedef std::map<int, scoped_refptr<TrackedCallback> > PendingCallbackMap; |
73 PendingCallbackMap pending_callbacks_; | 73 PendingCallbackMap pending_callbacks_; |
74 | 74 |
75 DISALLOW_IMPLICIT_CONSTRUCTORS(FileRef); | 75 DISALLOW_IMPLICIT_CONSTRUCTORS(FileRef); |
76 }; | 76 }; |
77 | 77 |
78 FileRef::FileRef(const PPB_FileRef_CreateInfo& info) | 78 FileRef::FileRef(const PPB_FileRef_CreateInfo& info) |
79 : PPB_FileRef_Shared(PPB_FileRef_Shared::InitAsProxy(), info), | 79 : PPB_FileRef_Shared(OBJECT_IS_PROXY, info), |
80 next_callback_id_(1) { | 80 next_callback_id_(1) { |
81 } | 81 } |
82 | 82 |
83 FileRef::~FileRef() { | 83 FileRef::~FileRef() { |
84 // The callbacks map should have been cleared by LastPluginRefWasDeleted. | 84 // The callbacks map should have been cleared by LastPluginRefWasDeleted. |
85 DCHECK(pending_callbacks_.empty()); | 85 DCHECK(pending_callbacks_.empty()); |
86 } | 86 } |
87 | 87 |
88 void FileRef::LastPluginRefWasDeleted() { | 88 void FileRef::LastPluginRefWasDeleted() { |
89 // The callback tracker will abort our callbacks for us. | 89 // The callback tracker will abort our callbacks for us. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 int32_t result, | 337 int32_t result, |
338 const HostResource& host_resource, | 338 const HostResource& host_resource, |
339 int callback_id) { | 339 int callback_id) { |
340 // Execute OnMsgCallbackComplete in the plugin process. | 340 // Execute OnMsgCallbackComplete in the plugin process. |
341 Send(new PpapiMsg_PPBFileRef_CallbackComplete( | 341 Send(new PpapiMsg_PPBFileRef_CallbackComplete( |
342 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); | 342 API_ID_PPB_FILE_REF, host_resource, callback_id, result)); |
343 } | 343 } |
344 | 344 |
345 } // namespace proxy | 345 } // namespace proxy |
346 } // namespace ppapi | 346 } // namespace ppapi |
OLD | NEW |