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

Side by Side Diff: media/base/android/media_player_bridge.cc

Issue 601043003: Speculative fix when translating blob data to a file path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add NOTREACHED Created 6 years, 2 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 | « content/browser/media/android/media_resource_getter_impl.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 "media/base/android/media_player_bridge.h" 5 #include "media/base/android/media_player_bridge.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (!username.empty()) { 256 if (!username.empty()) {
257 replacements.SetUsernameStr(username); 257 replacements.SetUsernameStr(username);
258 if (!password.empty()) 258 if (!password.empty())
259 replacements.SetPasswordStr(password); 259 replacements.SetPasswordStr(password);
260 url_ = url_.ReplaceComponents(replacements); 260 url_ = url_.ReplaceComponents(replacements);
261 } 261 }
262 ExtractMediaMetadata(url_.spec()); 262 ExtractMediaMetadata(url_.spec());
263 } 263 }
264 264
265 void MediaPlayerBridge::ExtractMediaMetadata(const std::string& url) { 265 void MediaPlayerBridge::ExtractMediaMetadata(const std::string& url) {
266 if (url.empty()) {
267 OnMediaError(MEDIA_ERROR_FORMAT);
268 return;
269 }
270
266 int fd; 271 int fd;
267 int64 offset; 272 int64 offset;
268 int64 size; 273 int64 size;
269 if (InterceptMediaUrl(url, &fd, &offset, &size)) { 274 if (InterceptMediaUrl(url, &fd, &offset, &size)) {
270 manager()->GetMediaResourceGetter()->ExtractMediaMetadata( 275 manager()->GetMediaResourceGetter()->ExtractMediaMetadata(
271 fd, offset, size, 276 fd, offset, size,
272 base::Bind(&MediaPlayerBridge::OnMediaMetadataExtracted, 277 base::Bind(&MediaPlayerBridge::OnMediaMetadataExtracted,
273 weak_factory_.GetWeakPtr())); 278 weak_factory_.GetWeakPtr()));
274 } else { 279 } else {
275 manager()->GetMediaResourceGetter()->ExtractMediaMetadata( 280 manager()->GetMediaResourceGetter()->ExtractMediaMetadata(
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 544
540 GURL MediaPlayerBridge::GetFirstPartyForCookies() { 545 GURL MediaPlayerBridge::GetFirstPartyForCookies() {
541 return first_party_for_cookies_; 546 return first_party_for_cookies_;
542 } 547 }
543 548
544 bool MediaPlayerBridge::IsSurfaceInUse() const { 549 bool MediaPlayerBridge::IsSurfaceInUse() const {
545 return is_surface_in_use_; 550 return is_surface_in_use_;
546 } 551 }
547 552
548 } // namespace media 553 } // namespace media
OLDNEW
« no previous file with comments | « content/browser/media/android/media_resource_getter_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698