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

Side by Side Diff: Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 1191033002: Improve error message in navigator.requestMediaKeySystemAccess() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" 6 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 188
189 // 5. Let origin be the origin of document. 189 // 5. Let origin be the origin of document.
190 // (Passed with the execution context in step 7.) 190 // (Passed with the execution context in step 7.)
191 191
192 // 6. Let promise be a new promise. 192 // 6. Let promise be a new promise.
193 Document* document = toDocument(executionContext); 193 Document* document = toDocument(executionContext);
194 if (!document->page()) { 194 if (!document->page()) {
195 return ScriptPromise::rejectWithDOMException( 195 return ScriptPromise::rejectWithDOMException(
196 scriptState, DOMException::create(InvalidStateError, "Document does not have a page.")); 196 scriptState, DOMException::create(InvalidStateError, "The context pr ovided is not associated with a page."));
197 } 197 }
198 198
199 MediaKeySystemAccessInitializer* initializer = new MediaKeySystemAccessIniti alizer(scriptState, keySystem, supportedConfigurations); 199 MediaKeySystemAccessInitializer* initializer = new MediaKeySystemAccessIniti alizer(scriptState, keySystem, supportedConfigurations);
200 ScriptPromise promise = initializer->promise(); 200 ScriptPromise promise = initializer->promise();
201 201
202 // 7. Asynchronously determine support, and if allowed, create and 202 // 7. Asynchronously determine support, and if allowed, create and
203 // initialize the MediaKeySystemAccess object. 203 // initialize the MediaKeySystemAccess object.
204 MediaKeysController* controller = MediaKeysController::from(document->page() ); 204 MediaKeysController* controller = MediaKeysController::from(document->page() );
205 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext); 205 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext);
206 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r)); 206 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r));
207 207
208 // 8. Return promise. 208 // 8. Return promise.
209 return promise; 209 return promise;
210 } 210 }
211 211
212 } // namespace blink 212 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698