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

Side by Side Diff: content/renderer/pepper/pepper_video_source_host.cc

Issue 141113003: Refactor base/safe_numerics.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/renderer/pepper/pepper_video_source_host.h" 5 #include "content/renderer/pepper/pepper_video_source_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/safe_numerics.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "content/public/renderer/renderer_ppapi_host.h" 9 #include "content/public/renderer/renderer_ppapi_host.h"
10 #include "content/renderer/pepper/ppb_image_data_impl.h" 10 #include "content/renderer/pepper/ppb_image_data_impl.h"
11 #include "content/renderer/render_thread_impl.h" 11 #include "content/renderer/render_thread_impl.h"
12 #include "ppapi/c/pp_errors.h" 12 #include "ppapi/c/pp_errors.h"
13 #include "ppapi/host/dispatch_host_message.h" 13 #include "ppapi/host/dispatch_host_message.h"
14 #include "ppapi/host/ppapi_host.h" 14 #include "ppapi/host/ppapi_host.h"
15 #include "ppapi/proxy/ppapi_messages.h" 15 #include "ppapi/proxy/ppapi_messages.h"
16 #include "ppapi/proxy/ppb_image_data_proxy.h" 16 #include "ppapi/proxy/ppb_image_data_proxy.h"
17 #include "ppapi/shared_impl/scoped_pp_resource.h" 17 #include "ppapi/shared_impl/scoped_pp_resource.h"
18 #include "ppapi/thunk/enter.h" 18 #include "ppapi/thunk/enter.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return PP_OK; 127 return PP_OK;
128 } 128 }
129 129
130 void PepperVideoSourceHost::SendGetFrameReply() { 130 void PepperVideoSourceHost::SendGetFrameReply() {
131 DCHECK(get_frame_pending_); 131 DCHECK(get_frame_pending_);
132 get_frame_pending_ = false; 132 get_frame_pending_ = false;
133 133
134 DCHECK(last_frame_.get()); 134 DCHECK(last_frame_.get());
135 scoped_ptr<cricket::VideoFrame> frame(last_frame_.release()); 135 scoped_ptr<cricket::VideoFrame> frame(last_frame_.release());
136 136
137 int32_t width = base::checked_numeric_cast<int32_t>(frame->GetWidth()); 137 int32_t width = base::checked_cast<int32_t>(frame->GetWidth());
138 int32_t height = base::checked_numeric_cast<int32_t>(frame->GetHeight()); 138 int32_t height = base::checked_cast<int32_t>(frame->GetHeight());
139 PP_ImageDataDesc image_desc; 139 PP_ImageDataDesc image_desc;
140 IPC::PlatformFileForTransit image_handle; 140 IPC::PlatformFileForTransit image_handle;
141 uint32_t byte_count; 141 uint32_t byte_count;
142 ppapi::ScopedPPResource resource( 142 ppapi::ScopedPPResource resource(
143 ppapi::ScopedPPResource::PassRef(), 143 ppapi::ScopedPPResource::PassRef(),
144 ppapi::proxy::PPB_ImageData_Proxy::CreateImageData( 144 ppapi::proxy::PPB_ImageData_Proxy::CreateImageData(
145 pp_instance(), 145 pp_instance(),
146 ppapi::PPB_ImageData_Shared::SIMPLE, 146 ppapi::PPB_ImageData_Shared::SIMPLE,
147 PP_IMAGEDATAFORMAT_BGRA_PREMUL, 147 PP_IMAGEDATAFORMAT_BGRA_PREMUL,
148 PP_MakeSize(width, height), 148 PP_MakeSize(width, height),
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 void PepperVideoSourceHost::Close() { 223 void PepperVideoSourceHost::Close() {
224 if (source_handler_.get() && !stream_url_.empty()) 224 if (source_handler_.get() && !stream_url_.empty())
225 source_handler_->Close(stream_url_, frame_receiver_.get()); 225 source_handler_->Close(stream_url_, frame_receiver_.get());
226 226
227 source_handler_.reset(NULL); 227 source_handler_.reset(NULL);
228 stream_url_.clear(); 228 stream_url_.clear();
229 } 229 }
230 230
231 } // namespace content 231 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_truetype_font_linux.cc ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698