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

Side by Side Diff: content/common/media/media_stream_options.cc

Issue 364123002: [Cross-Site Isolation] Migrate entire MediaStream verticals to be per-RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: It's random enough. + REBASE Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/common/media/media_stream_messages.h ('k') | content/public/browser/media_observer.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 "content/common/media/media_stream_options.h" 5 #include "content/common/media/media_stream_options.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 return false; 36 return false;
37 } 37 }
38 38
39 bool GetFirstConstraintByName(const StreamOptions::Constraints& mandatory, 39 bool GetFirstConstraintByName(const StreamOptions::Constraints& mandatory,
40 const StreamOptions::Constraints& optional, 40 const StreamOptions::Constraints& optional,
41 const std::string& name, 41 const std::string& name,
42 std::string* value, 42 std::string* value,
43 bool* is_mandatory) { 43 bool* is_mandatory) {
44 if (GetFirstConstraintByName(mandatory, name, value)) { 44 if (GetFirstConstraintByName(mandatory, name, value)) {
45 if (is_mandatory)
46 *is_mandatory = true;
47 return true;
48 }
49 if (is_mandatory) 45 if (is_mandatory)
50 *is_mandatory = false; 46 *is_mandatory = true;
51 return GetFirstConstraintByName(optional, name, value); 47 return true;
48 }
49 if (is_mandatory)
50 *is_mandatory = false;
51 return GetFirstConstraintByName(optional, name, value);
52 } 52 }
53 53
54 } // namespace 54 } // namespace
55 55
56 StreamOptions::StreamOptions() 56 StreamOptions::StreamOptions()
57 : audio_requested(false), 57 : audio_requested(false),
58 video_requested(false) {} 58 video_requested(false) {}
59 59
60 StreamOptions::StreamOptions(bool request_audio, bool request_video) 60 StreamOptions::StreamOptions(bool request_audio, bool request_video)
61 : audio_requested(request_audio), video_requested(request_video) { 61 : audio_requested(request_audio), video_requested(request_video) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 // static 123 // static
124 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first, 124 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first,
125 const StreamDeviceInfo& second) { 125 const StreamDeviceInfo& second) {
126 return first.device.IsEqual(second.device) && 126 return first.device.IsEqual(second.device) &&
127 first.session_id == second.session_id; 127 first.session_id == second.session_id;
128 } 128 }
129 129
130 } // namespace content 130 } // namespace content
OLDNEW
« no previous file with comments | « content/common/media/media_stream_messages.h ('k') | content/public/browser/media_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698