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

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: export 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
« no previous file with comments | « ppapi/proxy/resource_message_params.h ('k') | ppapi/proxy/serialized_structs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 size_t index, 84 size_t index,
85 IPC::PlatformFileForTransit* handle) const { 85 IPC::PlatformFileForTransit* handle) const {
86 SerializedHandle serialized = TakeHandleOfTypeAtIndex( 86 SerializedHandle serialized = TakeHandleOfTypeAtIndex(
87 index, SerializedHandle::SOCKET); 87 index, SerializedHandle::SOCKET);
88 if (!serialized.is_socket()) 88 if (!serialized.is_socket())
89 return false; 89 return false;
90 *handle = serialized.descriptor(); 90 *handle = serialized.descriptor();
91 return true; 91 return true;
92 } 92 }
93 93
94 void ResourceMessageParams::TakeAllSharedMemoryHandles(
95 std::vector<base::SharedMemoryHandle>* handles) const {
96 for (size_t i = 0; i < handles_->data().size(); ++i) {
97 base::SharedMemoryHandle handle;
98 if (TakeSharedMemoryHandleAtIndex(i, &handle))
99 handles->push_back(handle);
100 }
101 }
102
94 void ResourceMessageParams::AppendHandle(const SerializedHandle& handle) const { 103 void ResourceMessageParams::AppendHandle(const SerializedHandle& handle) const {
95 handles_->data().push_back(handle); 104 handles_->data().push_back(handle);
96 } 105 }
97 106
98 ResourceMessageCallParams::ResourceMessageCallParams() 107 ResourceMessageCallParams::ResourceMessageCallParams()
99 : ResourceMessageParams(), 108 : ResourceMessageParams(),
100 has_callback_(0) { 109 has_callback_(0) {
101 } 110 }
102 111
103 ResourceMessageCallParams::ResourceMessageCallParams(PP_Resource resource, 112 ResourceMessageCallParams::ResourceMessageCallParams(PP_Resource resource,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 151
143 bool ResourceMessageReplyParams::Deserialize(const IPC::Message* msg, 152 bool ResourceMessageReplyParams::Deserialize(const IPC::Message* msg,
144 PickleIterator* iter) { 153 PickleIterator* iter) {
145 if (!ResourceMessageParams::Deserialize(msg, iter)) 154 if (!ResourceMessageParams::Deserialize(msg, iter))
146 return false; 155 return false;
147 return IPC::ParamTraits<int32_t>::Read(msg, iter, &result_); 156 return IPC::ParamTraits<int32_t>::Read(msg, iter, &result_);
148 } 157 }
149 158
150 } // namespace proxy 159 } // namespace proxy
151 } // namespace ppapi 160 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_message_params.h ('k') | ppapi/proxy/serialized_structs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698