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

Side by Side Diff: services/media/framework/parts/reader.cc

Issue 1577953002: Motown in-proc streaming framework used to implement media services. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync, updates based on feedback, some functions declared const. Created 4 years, 10 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/logging.h"
6 #include "services/media/framework/parts/file_reader.h"
7 #include "services/media/framework/parts/reader.h"
8 #include "url/gurl.h"
9
10 namespace mojo {
11 namespace media {
12
13 Result Reader::Create(const GURL& gurl, ReaderPtr* reader_out) {
14 if (!gurl.is_valid()) {
15 return Result::kInvalidArgument;
16 }
17
18 ReaderPtr reader = nullptr;
19 if (gurl.SchemeIsFile()) {
20 reader = FileReader::New();
21 }
22 // TODO(dalesat): More schemes.
jeffbrown 2016/02/02 05:35:48 Honestly this code doesn't belong in your framewor
dalesat 2016/02/02 21:46:40 I agree that *most* of the resolution should be do
23
24 if (reader == nullptr) {
25 return Result::kUnsupportedOperation;
26 }
27
28 Result result = reader->Init(gurl);
29 if (result == Result::kOk) {
30 *reader_out = reader;
31 }
32
33 return result;
34 }
35
36 } // namespace media
37 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698