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

Side by Side Diff: content/browser/media/android/media_resource_getter_impl.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/media/android/media_resource_getter_impl.h" 5 #include "content/browser/media/android/media_resource_getter_impl.h"
6 6
7 #include "base/android/context_utils.h" 7 #include "base/android/context_utils.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 context_getter_->GetURLRequestContext()->http_transaction_factory(); 209 context_getter_->GetURLRequestContext()->http_transaction_factory();
210 if (!factory) 210 if (!factory)
211 return net::AuthCredentials(); 211 return net::AuthCredentials();
212 212
213 net::HttpAuthCache* auth_cache = 213 net::HttpAuthCache* auth_cache =
214 factory->GetSession()->http_auth_cache(); 214 factory->GetSession()->http_auth_cache();
215 if (!auth_cache) 215 if (!auth_cache)
216 return net::AuthCredentials(); 216 return net::AuthCredentials();
217 217
218 net::HttpAuthCache::Entry* entry = 218 net::HttpAuthCache::Entry* entry =
219 auth_cache->LookupByPath(url.GetOrigin(), url.path()); 219 auth_cache->LookupByPath(url.GetOrigin(), url.path().as_string());
220 220
221 // TODO(qinmin): handle other auth schemes. See http://crbug.com/395219. 221 // TODO(qinmin): handle other auth schemes. See http://crbug.com/395219.
222 if (entry && entry->scheme() == net::HttpAuth::AUTH_SCHEME_BASIC) 222 if (entry && entry->scheme() == net::HttpAuth::AUTH_SCHEME_BASIC)
223 return entry->credentials(); 223 return entry->credentials();
224 else 224 else
225 return net::AuthCredentials(); 225 return net::AuthCredentials();
226 } 226 }
227 227
228 void MediaResourceGetterTask::RequestCookies( 228 void MediaResourceGetterTask::RequestCookies(
229 const GURL& url, const GURL& first_party_for_cookies, 229 const GURL& url, const GURL& first_party_for_cookies,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 const int64_t size, 374 const int64_t size,
375 const ExtractMediaMetadataCB& callback) { 375 const ExtractMediaMetadataCB& callback) {
376 DCHECK_CURRENTLY_ON(BrowserThread::UI); 376 DCHECK_CURRENTLY_ON(BrowserThread::UI);
377 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); 377 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool();
378 pool->PostWorkerTask( 378 pool->PostWorkerTask(
379 FROM_HERE, 379 FROM_HERE,
380 base::Bind(&GetMediaMetadataFromFd, fd, offset, size, callback)); 380 base::Bind(&GetMediaMetadataFromFd, fd, offset, size, callback));
381 } 381 }
382 382
383 } // namespace content 383 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698