| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // asynchronously on the UI thread. | 33 // asynchronously on the UI thread. |
| 34 class MediaResourceGetterImpl : public media::MediaResourceGetter { | 34 class MediaResourceGetterImpl : public media::MediaResourceGetter { |
| 35 public: | 35 public: |
| 36 // Construct a MediaResourceGetterImpl object. |browser_context| and | 36 // Construct a MediaResourceGetterImpl object. |browser_context| and |
| 37 // |render_process_id| are passed to retrieve the CookieStore. | 37 // |render_process_id| are passed to retrieve the CookieStore. |
| 38 // |file_system_context| are used to get the platform path. | 38 // |file_system_context| are used to get the platform path. |
| 39 MediaResourceGetterImpl(BrowserContext* browser_context, | 39 MediaResourceGetterImpl(BrowserContext* browser_context, |
| 40 storage::FileSystemContext* file_system_context, | 40 storage::FileSystemContext* file_system_context, |
| 41 int render_process_id, | 41 int render_process_id, |
| 42 int render_frame_id); | 42 int render_frame_id); |
| 43 virtual ~MediaResourceGetterImpl(); | 43 ~MediaResourceGetterImpl() override; |
| 44 | 44 |
| 45 // media::MediaResourceGetter implementation. | 45 // media::MediaResourceGetter implementation. |
| 46 // Must be called on the UI thread. | 46 // Must be called on the UI thread. |
| 47 virtual void GetAuthCredentials( | 47 void GetAuthCredentials(const GURL& url, |
| 48 const GURL& url, | 48 const GetAuthCredentialsCB& callback) override; |
| 49 const GetAuthCredentialsCB& callback) override; | 49 void GetCookies(const GURL& url, |
| 50 virtual void GetCookies( | 50 const GURL& first_party_for_cookies, |
| 51 const GURL& url, | 51 const GetCookieCB& callback) override; |
| 52 const GURL& first_party_for_cookies, | 52 void GetPlatformPathFromURL(const GURL& url, |
| 53 const GetCookieCB& callback) override; | 53 const GetPlatformPathCB& callback) override; |
| 54 virtual void GetPlatformPathFromURL( | 54 void ExtractMediaMetadata(const std::string& url, |
| 55 const GURL& url, | 55 const std::string& cookies, |
| 56 const GetPlatformPathCB& callback) override; | 56 const std::string& user_agent, |
| 57 virtual void ExtractMediaMetadata( | 57 const ExtractMediaMetadataCB& callback) override; |
| 58 const std::string& url, | 58 void ExtractMediaMetadata(const int fd, |
| 59 const std::string& cookies, | 59 const int64 offset, |
| 60 const std::string& user_agent, | 60 const int64 size, |
| 61 const ExtractMediaMetadataCB& callback) override; | 61 const ExtractMediaMetadataCB& callback) override; |
| 62 virtual void ExtractMediaMetadata( | |
| 63 const int fd, | |
| 64 const int64 offset, | |
| 65 const int64 size, | |
| 66 const ExtractMediaMetadataCB& callback) override; | |
| 67 | 62 |
| 68 static bool RegisterMediaResourceGetter(JNIEnv* env); | 63 static bool RegisterMediaResourceGetter(JNIEnv* env); |
| 69 | 64 |
| 70 private: | 65 private: |
| 71 // Called when GetAuthCredentials() finishes. | 66 // Called when GetAuthCredentials() finishes. |
| 72 void GetAuthCredentialsCallback( | 67 void GetAuthCredentialsCallback( |
| 73 const GetAuthCredentialsCB& callback, | 68 const GetAuthCredentialsCB& callback, |
| 74 const net::AuthCredentials& credentials); | 69 const net::AuthCredentials& credentials); |
| 75 | 70 |
| 76 // Called when GetCookies() finishes. | 71 // Called when GetCookies() finishes. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 95 | 90 |
| 96 // NOTE: Weak pointers must be invalidated before all other member variables. | 91 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 97 base::WeakPtrFactory<MediaResourceGetterImpl> weak_factory_; | 92 base::WeakPtrFactory<MediaResourceGetterImpl> weak_factory_; |
| 98 | 93 |
| 99 DISALLOW_COPY_AND_ASSIGN(MediaResourceGetterImpl); | 94 DISALLOW_COPY_AND_ASSIGN(MediaResourceGetterImpl); |
| 100 }; | 95 }; |
| 101 | 96 |
| 102 } // namespace content | 97 } // namespace content |
| 103 | 98 |
| 104 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_ | 99 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_ |
| OLD | NEW |