| 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 WEBKIT_RENDERER_MEDIA_MEDIA_INFO_LOADER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_INFO_LOADER_H_ |
| 6 #define WEBKIT_RENDERER_MEDIA_MEDIA_INFO_LOADER_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_INFO_LOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "content/common/content_export.h" |
| 13 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
| 14 #include "third_party/WebKit/public/web/WebMediaPlayer.h" | 16 #include "third_party/WebKit/public/web/WebMediaPlayer.h" |
| 15 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | |
| 16 #include "webkit/renderer/media/active_loader.h" | 17 #include "webkit/renderer/media/active_loader.h" |
| 17 | 18 |
| 18 namespace WebKit { | 19 namespace WebKit { |
| 19 class WebFrame; | 20 class WebFrame; |
| 20 class WebURLLoader; | 21 class WebURLLoader; |
| 21 class WebURLRequest; | 22 class WebURLRequest; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace webkit_media { | 25 namespace content { |
| 25 | 26 |
| 26 // This class provides additional information about a media URL. Currently it | 27 // This class provides additional information about a media URL. Currently it |
| 27 // can be used to determine if a media URL has a single security origin and | 28 // can be used to determine if a media URL has a single security origin and |
| 28 // whether the URL passes a CORS access check. | 29 // whether the URL passes a CORS access check. |
| 29 class MediaInfoLoader : private WebKit::WebURLLoaderClient { | 30 class CONTENT_EXPORT MediaInfoLoader : private WebKit::WebURLLoaderClient { |
| 30 public: | 31 public: |
| 31 // Status codes for start operations on MediaInfoLoader. | 32 // Status codes for start operations on MediaInfoLoader. |
| 32 enum Status { | 33 enum Status { |
| 33 // The operation failed, which may have been due to: | 34 // The operation failed, which may have been due to: |
| 34 // - Page navigation | 35 // - Page navigation |
| 35 // - Server replied 4xx/5xx | 36 // - Server replied 4xx/5xx |
| 36 // - The response was invalid | 37 // - The response was invalid |
| 37 // - Connection was terminated | 38 // - Connection was terminated |
| 38 // | 39 // |
| 39 // At this point you should delete the loader. | 40 // At this point you should delete the loader. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 virtual void didFail( | 98 virtual void didFail( |
| 98 WebKit::WebURLLoader* loader, | 99 WebKit::WebURLLoader* loader, |
| 99 const WebKit::WebURLError&); | 100 const WebKit::WebURLError&); |
| 100 | 101 |
| 101 void DidBecomeReady(Status status); | 102 void DidBecomeReady(Status status); |
| 102 | 103 |
| 103 // Injected WebURLLoader instance for testing purposes. | 104 // Injected WebURLLoader instance for testing purposes. |
| 104 scoped_ptr<WebKit::WebURLLoader> test_loader_; | 105 scoped_ptr<WebKit::WebURLLoader> test_loader_; |
| 105 | 106 |
| 106 // Keeps track of an active WebURLLoader and associated state. | 107 // Keeps track of an active WebURLLoader and associated state. |
| 107 scoped_ptr<ActiveLoader> active_loader_; | 108 scoped_ptr<webkit_media::ActiveLoader> active_loader_; |
| 108 | 109 |
| 109 bool loader_failed_; | 110 bool loader_failed_; |
| 110 GURL url_; | 111 GURL url_; |
| 111 WebKit::WebMediaPlayer::CORSMode cors_mode_; | 112 WebKit::WebMediaPlayer::CORSMode cors_mode_; |
| 112 bool single_origin_; | 113 bool single_origin_; |
| 113 | 114 |
| 114 ReadyCB ready_cb_; | 115 ReadyCB ready_cb_; |
| 115 base::TimeTicks start_time_; | 116 base::TimeTicks start_time_; |
| 116 | 117 |
| 117 DISALLOW_COPY_AND_ASSIGN(MediaInfoLoader); | 118 DISALLOW_COPY_AND_ASSIGN(MediaInfoLoader); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // namespace webkit_media | 121 } // namespace content |
| 121 | 122 |
| 122 #endif // WEBKIT_RENDERER_MEDIA_MEDIA_INFO_LOADER_H_ | 123 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_INFO_LOADER_H_ |
| OLD | NEW |