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

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 2119283002: Use container::back() and container::pop_back() for content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 "content/browser/renderer_host/media/video_capture_controller.h" 5 #include "content/browser/renderer_host/media/video_capture_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 media::PIXEL_STORAGE_GPUMEMORYBUFFER)) { 172 media::PIXEL_STORAGE_GPUMEMORYBUFFER)) {
173 // Crash in debug builds since the renderer should not have asked for 173 // Crash in debug builds since the renderer should not have asked for
174 // invalid or unsupported parameters. 174 // invalid or unsupported parameters.
175 LOG(DFATAL) << "Invalid or unsupported video capture parameters requested: " 175 LOG(DFATAL) << "Invalid or unsupported video capture parameters requested: "
176 << media::VideoCaptureFormat::ToString(params.requested_format); 176 << media::VideoCaptureFormat::ToString(params.requested_format);
177 event_handler->OnError(id); 177 event_handler->OnError(id);
178 return; 178 return;
179 } 179 }
180 180
181 // If this is the first client added to the controller, cache the parameters. 181 // If this is the first client added to the controller, cache the parameters.
182 if (!controller_clients_.size()) 182 if (controller_clients_.empty())
183 video_capture_format_ = params.requested_format; 183 video_capture_format_ = params.requested_format;
184 184
185 // Signal error in case device is already in error state. 185 // Signal error in case device is already in error state.
186 if (state_ == VIDEO_CAPTURE_STATE_ERROR) { 186 if (state_ == VIDEO_CAPTURE_STATE_ERROR) {
187 event_handler->OnError(id); 187 event_handler->OnError(id);
188 return; 188 return;
189 } 189 }
190 190
191 // Do nothing if this client has called AddClient before. 191 // Do nothing if this client has called AddClient before.
192 if (FindClient(id, event_handler, controller_clients_)) 192 if (FindClient(id, event_handler, controller_clients_))
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 int session_id, 507 int session_id,
508 const ControllerClients& clients) { 508 const ControllerClients& clients) {
509 for (auto client : clients) { 509 for (auto client : clients) {
510 if (client->session_id == session_id) 510 if (client->session_id == session_id)
511 return client; 511 return client;
512 } 512 }
513 return NULL; 513 return NULL;
514 } 514 }
515 515
516 } // namespace content 516 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698