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

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

Issue 1318793005: [part 2] Make classes and structures in modules fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 /* 1 /*
2 * Copyright (C) 2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 22 matching lines...) Expand all
33 #include "core/page/Page.h" 33 #include "core/page/Page.h"
34 #include "modules/mediastream/MediaDevicesRequest.h" 34 #include "modules/mediastream/MediaDevicesRequest.h"
35 #include "modules/mediastream/MediaStreamConstraints.h" 35 #include "modules/mediastream/MediaStreamConstraints.h"
36 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h" 36 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h"
37 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h" 37 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h"
38 #include "modules/mediastream/UserMediaController.h" 38 #include "modules/mediastream/UserMediaController.h"
39 #include "modules/mediastream/UserMediaRequest.h" 39 #include "modules/mediastream/UserMediaRequest.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 NavigatorMediaStream::NavigatorMediaStream()
44 {
45 }
46
47 NavigatorMediaStream::~NavigatorMediaStream()
48 {
49 }
50
51 void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const MediaS treamConstraints& options, NavigatorUserMediaSuccessCallback* successCallback, N avigatorUserMediaErrorCallback* errorCallback, ExceptionState& exceptionState) 43 void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const MediaS treamConstraints& options, NavigatorUserMediaSuccessCallback* successCallback, N avigatorUserMediaErrorCallback* errorCallback, ExceptionState& exceptionState)
52 { 44 {
53 if (!successCallback) 45 if (!successCallback)
54 return; 46 return;
55 47
56 UserMediaController* userMedia = UserMediaController::from(navigator.frame() ); 48 UserMediaController* userMedia = UserMediaController::from(navigator.frame() );
57 if (!userMedia) { 49 if (!userMedia) {
58 exceptionState.throwDOMException(NotSupportedError, "No user media contr oller available; is this a detached window?"); 50 exceptionState.throwDOMException(NotSupportedError, "No user media contr oller available; is this a detached window?");
59 return; 51 return;
60 } 52 }
61 53
62 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu ment(), userMedia, options, successCallback, errorCallback, exceptionState); 54 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu ment(), userMedia, options, successCallback, errorCallback, exceptionState);
63 if (!request) { 55 if (!request) {
64 ASSERT(exceptionState.hadException()); 56 ASSERT(exceptionState.hadException());
65 return; 57 return;
66 } 58 }
67 59
68 String errorMessage; 60 String errorMessage;
69 if (!request->isPrivilegedContextUse(errorMessage)) { 61 if (!request->isPrivilegedContextUse(errorMessage)) {
70 request->failPermissionDenied(errorMessage); 62 request->failPermissionDenied(errorMessage);
71 return; 63 return;
72 } 64 }
73 65
74 request->start(); 66 request->start();
75 } 67 }
76 68
77 } // namespace blink 69 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/mediastream/NavigatorMediaStream.h ('k') | Source/modules/mediastream/URLMediaStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698