Merge ~abreu-alexandre/oxide:fixmhbuild into oxide:master

Proposed by Alexandre Abreu
Status: Merged
Approved by: Chris Coulson
Approved revision: b69207c18d7073a380f736f32215e9745043ff12
Merged at revision: b69207c18d7073a380f736f32215e9745043ff12
Proposed branch: ~abreu-alexandre/oxide:fixmhbuild
Merge into: oxide:master
Diff against target: 248 lines (+29/-45)
4 files modified
shared/renderer/media/oxide_media_info_loader.cc (+15/-24)
shared/renderer/media/oxide_media_info_loader.h (+7/-16)
shared/renderer/media/oxide_web_media_player.cc (+4/-3)
shared/renderer/media/oxide_web_media_player.h (+3/-2)
Reviewer Review Type Date Requested Status
Oxide Developers Pending
Review via email: mp+310107@code.launchpad.net

Description of the change

Fix mediahub build

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/shared/renderer/media/oxide_media_info_loader.cc b/shared/renderer/media/oxide_media_info_loader.cc
2index be79e9f..13cbd9e 100644
3--- a/shared/renderer/media/oxide_media_info_loader.cc
4+++ b/shared/renderer/media/oxide_media_info_loader.cc
5@@ -12,12 +12,13 @@
6 #include "third_party/WebKit/public/platform/WebURLError.h"
7 #include "third_party/WebKit/public/platform/WebURLLoader.h"
8 #include "third_party/WebKit/public/platform/WebURLResponse.h"
9+#include "third_party/WebKit/public/web/WebAssociatedURLLoader.h"
10 #include "third_party/WebKit/public/web/WebFrame.h"
11
12 using blink::WebFrame;
13 using blink::WebURLError;
14-using blink::WebURLLoader;
15-using blink::WebURLLoaderOptions;
16+using blink::WebAssociatedURLLoader;
17+using blink::WebAssociatedURLLoaderOptions;
18 using blink::WebURLRequest;
19 using blink::WebURLResponse;
20
21@@ -50,18 +51,18 @@ void MediaInfoLoader::Start(blink::WebFrame* frame) {
22 // TODO:
23 frame->setReferrerForRequest(request, blink::WebURL());
24
25- std::unique_ptr<WebURLLoader> loader;
26- WebURLLoaderOptions options;
27+ std::unique_ptr<WebAssociatedURLLoader> loader;
28+ WebAssociatedURLLoaderOptions options;
29 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUnspecified) {
30 options.allowCredentials = true;
31 options.crossOriginRequestPolicy =
32- WebURLLoaderOptions::CrossOriginRequestPolicyAllow;
33+ WebAssociatedURLLoaderOptions::CrossOriginRequestPolicyAllow;
34 } else {
35 options.exposeAllResponseHeaders = true;
36 // The author header set is empty, no preflight should go ahead.
37- options.preflightPolicy = WebURLLoaderOptions::PreventPreflight;
38+ options.preflightPolicy = WebAssociatedURLLoaderOptions::PreventPreflight;
39 options.crossOriginRequestPolicy =
40- WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl;
41+ WebAssociatedURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl;
42 if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials) {
43 options.allowCredentials = true;
44 }
45@@ -75,34 +76,30 @@ void MediaInfoLoader::Start(blink::WebFrame* frame) {
46
47 /////////////////////////////////////////////////////////////////////////////
48 // blink::WebURLLoaderClient implementation.
49-void MediaInfoLoader::willSendRequest(
50- WebURLLoader* loader,
51- WebURLRequest& newRequest,
52+bool MediaInfoLoader::willFollowRedirect(
53+ const WebURLRequest& newRequest,
54 const WebURLResponse& redirectResponse) {
55 // The load may have been stopped and |ready_cb| is destroyed.
56 // In this case we shouldn't do anything.
57- if (ready_cb_.is_null()) {
58- // Set the url in the request to an invalid value (empty url).
59- newRequest.setURL(blink::WebURL());
60- return;
61- }
62+ if (ready_cb_.is_null())
63+ return false;
64
65 // Only allow |single_origin_| if we haven't seen a different origin yet.
66 if (single_origin_) {
67 single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin();
68 }
69 url_ = newRequest.url();
70+
71+ return true;
72 }
73
74 void MediaInfoLoader::didSendData(
75- WebURLLoader* loader,
76 unsigned long long bytes_sent,
77 unsigned long long total_bytes_to_be_sent) {
78 NOTIMPLEMENTED();
79 }
80
81 void MediaInfoLoader::didReceiveResponse(
82- WebURLLoader* loader,
83 const WebURLResponse& response) {
84 DVLOG(1) << "didReceiveResponse: HTTP/"
85 << (response.httpVersion() == WebURLResponse::HTTPVersion_0_9 ? "0.9" :
86@@ -124,7 +121,6 @@ void MediaInfoLoader::didReceiveResponse(
87 }
88
89 void MediaInfoLoader::didReceiveData(
90- WebURLLoader* loader,
91 const char* data,
92 int data_length,
93 int encoded_data_length) {
94@@ -132,29 +128,24 @@ void MediaInfoLoader::didReceiveData(
95 }
96
97 void MediaInfoLoader::didDownloadData(
98- blink::WebURLLoader* loader,
99 int dataLength,
100 int encodedDataLength) {
101 NOTIMPLEMENTED();
102 }
103
104 void MediaInfoLoader::didReceiveCachedMetadata(
105- WebURLLoader* loader,
106 const char* data,
107 int data_length) {
108 NOTIMPLEMENTED();
109 }
110
111 void MediaInfoLoader::didFinishLoading(
112- WebURLLoader* loader,
113- double finishTime,
114- int64_t total_encoded_data_length) {
115+ double finishTime) {
116 DCHECK(active_loader_.get());
117 DidBecomeReady(kOk);
118 }
119
120 void MediaInfoLoader::didFail(
121- WebURLLoader* loader,
122 const WebURLError& error) {
123 DVLOG(1) << "didFail: reason=" << error.reason
124 << ", isCancellation=" << error.isCancellation
125diff --git a/shared/renderer/media/oxide_media_info_loader.h b/shared/renderer/media/oxide_media_info_loader.h
126index 1c74955..7c7939a 100644
127--- a/shared/renderer/media/oxide_media_info_loader.h
128+++ b/shared/renderer/media/oxide_media_info_loader.h
129@@ -13,12 +13,12 @@
130 #include "content/common/content_export.h"
131 #include "media/blink/active_loader.h"
132 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
133-#include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
134+#include "third_party/WebKit/public/web/WebAssociatedURLLoaderClient.h"
135 #include "url/gurl.h"
136
137 namespace blink {
138 class WebFrame;
139-class WebURLLoader;
140+class WebAssociatedURLLoader;
141 class WebURLRequest;
142 }
143
144@@ -27,7 +27,7 @@ namespace oxide {
145 // This class provides additional information about a media URL. Currently it
146 // can be used to determine if a media URL has a single security origin and
147 // whether the URL passes a CORS access check.
148-class MediaInfoLoader : private blink::WebURLLoaderClient {
149+class MediaInfoLoader : private blink::WebAssociatedURLLoaderClient {
150 public:
151 // Status codes for start operations on MediaInfoLoader.
152 enum Status {
153@@ -73,36 +73,27 @@ class MediaInfoLoader : private blink::WebURLLoaderClient {
154 private:
155 friend class MediaInfoLoaderTest;
156
157- // blink::WebURLLoaderClient implementation.
158- void willSendRequest(
159- blink::WebURLLoader* loader,
160- blink::WebURLRequest& newRequest,
161+ // blink::WebAssociatedURLLoaderClient implementation.
162+ bool willFollowRedirect(
163+ const blink::WebURLRequest& newRequest,
164 const blink::WebURLResponse& redirectResponse);
165 void didSendData(
166- blink::WebURLLoader* loader,
167 unsigned long long bytesSent,
168 unsigned long long totalBytesToBeSent);
169 void didReceiveResponse(
170- blink::WebURLLoader* loader,
171 const blink::WebURLResponse& response);
172 void didDownloadData(
173- blink::WebURLLoader* loader,
174 int data_length,
175 int encodedDataLength);
176 void didReceiveData(
177- blink::WebURLLoader* loader,
178 const char* data,
179 int data_length,
180 int encoded_data_length);
181 void didReceiveCachedMetadata(
182- blink::WebURLLoader* loader,
183 const char* data, int dataLength);
184 void didFinishLoading(
185- blink::WebURLLoader* loader,
186- double finishTime,
187- int64_t total_encoded_data_length);
188+ double finishTime);
189 void didFail(
190- blink::WebURLLoader* loader,
191 const blink::WebURLError&);
192
193 void DidBecomeReady(Status status);
194diff --git a/shared/renderer/media/oxide_web_media_player.cc b/shared/renderer/media/oxide_web_media_player.cc
195index 7a883a2..9fd3e41 100644
196--- a/shared/renderer/media/oxide_web_media_player.cc
197+++ b/shared/renderer/media/oxide_web_media_player.cc
198@@ -21,6 +21,7 @@
199 #include "content/public/common/content_switches.h"
200 #include "content/public/renderer/render_frame.h"
201 #include "media/base/key_systems.h"
202+#include "media/base/media_content_type.h"
203 #include "media/base/media_log.h"
204 #include "media/blink/webcontentdecryptionmodule_impl.h"
205 #include "media/blink/webmediaplayer_delegate.h"
206@@ -351,8 +352,8 @@ bool WebMediaPlayer::didLoadingProgress() {
207 }
208
209 void WebMediaPlayer::paint(blink::WebCanvas* canvas,
210- const blink::WebRect& rect,
211- unsigned char alpha) {
212+ const blink::WebRect& rect,
213+ SkPaint&) {
214 NOTIMPLEMENTED();
215 }
216
217@@ -672,7 +673,7 @@ void WebMediaPlayer::UpdatePlayingState(bool is_playing) {
218 hasVideo(),
219 !hasVideo(),
220 isRemote(),
221- duration_);
222+ media::DurationToMediaContentType(duration_));
223 } else {
224 delegate_->DidPause(delegate_id_,
225 !pending_seek_ || currentTime() >= duration());
226diff --git a/shared/renderer/media/oxide_web_media_player.h b/shared/renderer/media/oxide_web_media_player.h
227index f49fe3d..2380906 100644
228--- a/shared/renderer/media/oxide_web_media_player.h
229+++ b/shared/renderer/media/oxide_web_media_player.h
230@@ -22,6 +22,7 @@
231 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
232 #include "third_party/WebKit/public/platform/WebSize.h"
233 #include "third_party/WebKit/public/platform/WebURL.h"
234+#include "third_party/skia/include/core/SkXfermode.h"
235 #include "ui/gfx/geometry/rect_f.h"
236 #include "shared/common/oxide_message_enums.h"
237
238@@ -91,8 +92,8 @@ class WebMediaPlayer : public blink::WebMediaPlayer,
239
240 // Methods for painting.
241 void paint(blink::WebCanvas* canvas,
242- const blink::WebRect& rect,
243- unsigned char alpha);
244+ const blink::WebRect& rect,
245+ SkPaint&);
246
247 // True if the loaded media has a playable video/audio track.
248 bool hasVideo() const;

Subscribers

People subscribed via source and target branches