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

Side by Side Diff: media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java

Issue 10961015: Android: MediaPlayerBridge JNI cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.media;
6
7 import android.content.Context;
8 import android.media.MediaPlayer;
9 import android.net.Uri;
10 import android.text.TextUtils;
11
12 import java.util.HashMap;
13
14 import org.chromium.base.CalledByNative;
15 import org.chromium.base.JNINamespace;
16
17 @JNINamespace("media")
18 class MediaPlayerBridge {
19 @CalledByNative
20 private static boolean setDataSource(MediaPlayer player, Context context, St ring url,
21 String cookies, boolean hideUrlLog) {
22 Uri uri = Uri.parse(url);
23 HashMap headersMap = new HashMap<String, String>();
24 if (hideUrlLog)
25 headersMap.put("x-hide-urls-from-log", "true");
26 if (!TextUtils.isEmpty(cookies))
27 headersMap.put("Cookie", cookies);
28 try {
29 player.setDataSource(context, uri, headersMap);
scherkus (not reviewing) 2012/09/20 19:13:55 should these be 4 space indent?
bulach 2012/09/21 10:10:26 Done.
30 return true;
31 } catch (Exception e) {
32 return false;
33 }
34 }
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698