Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: ppapi/proxy/resource_message_params.cc

Issue 11274036: Refactor video capture to new design (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: bind callback Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/resource_message_params.h" 5 #include "ppapi/proxy/resource_message_params.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 9
10 namespace ppapi { 10 namespace ppapi {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 size_t index, 63 size_t index,
64 IPC::PlatformFileForTransit* handle) const { 64 IPC::PlatformFileForTransit* handle) const {
65 const SerializedHandle* serialized = GetHandleOfTypeAtIndex( 65 const SerializedHandle* serialized = GetHandleOfTypeAtIndex(
66 index, SerializedHandle::SOCKET); 66 index, SerializedHandle::SOCKET);
67 if (!serialized) 67 if (!serialized)
68 return false; 68 return false;
69 *handle = serialized->descriptor(); 69 *handle = serialized->descriptor();
70 return true; 70 return true;
71 } 71 }
72 72
73 void ResourceMessageParams::GetAllSharedMemoryHandles(
74 std::vector<base::SharedMemoryHandle>* handles) const {
75 for (size_t i = 0; i < handles_.size(); ++i) {
76 base::SharedMemoryHandle handle;
77 if (GetSharedMemoryHandleAtIndex(i, &handle));
78 handles->push_back(handle);
79 }
80 }
81
73 void ResourceMessageParams::AppendHandle(const SerializedHandle& handle) { 82 void ResourceMessageParams::AppendHandle(const SerializedHandle& handle) {
74 handles_.push_back(handle); 83 handles_.push_back(handle);
75 } 84 }
76 85
77 ResourceMessageCallParams::ResourceMessageCallParams() 86 ResourceMessageCallParams::ResourceMessageCallParams()
78 : ResourceMessageParams(), 87 : ResourceMessageParams(),
79 has_callback_(0) { 88 has_callback_(0) {
80 } 89 }
81 90
82 ResourceMessageCallParams::ResourceMessageCallParams(PP_Resource resource, 91 ResourceMessageCallParams::ResourceMessageCallParams(PP_Resource resource,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 130
122 bool ResourceMessageReplyParams::Deserialize(const IPC::Message* msg, 131 bool ResourceMessageReplyParams::Deserialize(const IPC::Message* msg,
123 PickleIterator* iter) { 132 PickleIterator* iter) {
124 if (!ResourceMessageParams::Deserialize(msg, iter)) 133 if (!ResourceMessageParams::Deserialize(msg, iter))
125 return false; 134 return false;
126 return IPC::ParamTraits<int32_t>::Read(msg, iter, &result_); 135 return IPC::ParamTraits<int32_t>::Read(msg, iter, &result_);
127 } 136 }
128 137
129 } // namespace proxy 138 } // namespace proxy
130 } // namespace ppapi 139 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698