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

Side by Side Diff: Source/modules/mediastream/UserMediaRequest.cpp

Issue 72363002: Rename es => exceptionState in other than bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Retry Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 27 matching lines...) Expand all
38 #include "core/dom/Document.h" 38 #include "core/dom/Document.h"
39 #include "core/dom/SpaceSplitString.h" 39 #include "core/dom/SpaceSplitString.h"
40 #include "core/platform/mediastream/MediaStreamCenter.h" 40 #include "core/platform/mediastream/MediaStreamCenter.h"
41 #include "core/platform/mediastream/MediaStreamDescriptor.h" 41 #include "core/platform/mediastream/MediaStreamDescriptor.h"
42 #include "modules/mediastream/MediaConstraintsImpl.h" 42 #include "modules/mediastream/MediaConstraintsImpl.h"
43 #include "modules/mediastream/MediaStream.h" 43 #include "modules/mediastream/MediaStream.h"
44 #include "modules/mediastream/UserMediaController.h" 44 #include "modules/mediastream/UserMediaController.h"
45 45
46 namespace WebCore { 46 namespace WebCore {
47 47
48 static PassRefPtr<MediaConstraintsImpl> parseOptions(const Dictionary& options, const String& mediaType, ExceptionState& es) 48 static PassRefPtr<MediaConstraintsImpl> parseOptions(const Dictionary& options, const String& mediaType, ExceptionState& exceptionState)
49 { 49 {
50 RefPtr<MediaConstraintsImpl> constraints; 50 RefPtr<MediaConstraintsImpl> constraints;
51 51
52 Dictionary constraintsDictionary; 52 Dictionary constraintsDictionary;
53 bool ok = options.get(mediaType, constraintsDictionary); 53 bool ok = options.get(mediaType, constraintsDictionary);
54 if (ok && !constraintsDictionary.isUndefinedOrNull()) 54 if (ok && !constraintsDictionary.isUndefinedOrNull())
55 constraints = MediaConstraintsImpl::create(constraintsDictionary, es); 55 constraints = MediaConstraintsImpl::create(constraintsDictionary, except ionState);
56 else { 56 else {
57 bool mediaRequested = false; 57 bool mediaRequested = false;
58 options.get(mediaType, mediaRequested); 58 options.get(mediaType, mediaRequested);
59 if (mediaRequested) 59 if (mediaRequested)
60 constraints = MediaConstraintsImpl::create(); 60 constraints = MediaConstraintsImpl::create();
61 } 61 }
62 62
63 return constraints.release(); 63 return constraints.release();
64 } 64 }
65 65
66 PassRefPtr<UserMediaRequest> UserMediaRequest::create(ExecutionContext* context, UserMediaController* controller, const Dictionary& options, PassRefPtr<Navigato rUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCa llback> errorCallback, ExceptionState& es) 66 PassRefPtr<UserMediaRequest> UserMediaRequest::create(ExecutionContext* context, UserMediaController* controller, const Dictionary& options, PassRefPtr<Navigato rUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCa llback> errorCallback, ExceptionState& exceptionState)
67 { 67 {
68 RefPtr<MediaConstraintsImpl> audio = parseOptions(options, "audio", es); 68 RefPtr<MediaConstraintsImpl> audio = parseOptions(options, "audio", exceptio nState);
69 if (es.hadException()) 69 if (exceptionState.hadException())
70 return 0; 70 return 0;
71 71
72 RefPtr<MediaConstraintsImpl> video = parseOptions(options, "video", es); 72 RefPtr<MediaConstraintsImpl> video = parseOptions(options, "video", exceptio nState);
73 if (es.hadException()) 73 if (exceptionState.hadException())
74 return 0; 74 return 0;
75 75
76 if (!audio && !video) 76 if (!audio && !video)
77 return 0; 77 return 0;
78 78
79 return adoptRef(new UserMediaRequest(context, controller, audio.release(), v ideo.release(), successCallback, errorCallback)); 79 return adoptRef(new UserMediaRequest(context, controller, audio.release(), v ideo.release(), successCallback, errorCallback));
80 } 80 }
81 81
82 UserMediaRequest::UserMediaRequest(ExecutionContext* context, UserMediaControlle r* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstrain tsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, Pa ssRefPtr<NavigatorUserMediaErrorCallback> errorCallback) 82 UserMediaRequest::UserMediaRequest(ExecutionContext* context, UserMediaControlle r* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstrain tsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, Pa ssRefPtr<NavigatorUserMediaErrorCallback> errorCallback)
83 : ContextLifecycleObserver(context) 83 : ContextLifecycleObserver(context)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 if (m_controller) { 178 if (m_controller) {
179 m_controller->cancelUserMediaRequest(this); 179 m_controller->cancelUserMediaRequest(this);
180 m_controller = 0; 180 m_controller = 0;
181 } 181 }
182 182
183 ContextLifecycleObserver::contextDestroyed(); 183 ContextLifecycleObserver::contextDestroyed();
184 } 184 }
185 185
186 } // namespace WebCore 186 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/RTCSessionDescription.cpp ('k') | Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698