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

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

Issue 2630583003: Fix potential process-routing id mismatch (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_player_renderer.h" 5 #include "content/browser/media/android/media_player_renderer.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "content/browser/android/scoped_surface_request_manager.h" 10 #include "content/browser/android/scoped_surface_request_manager.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 media_player_->SetVolume(volume); 165 media_player_->SetVolume(volume);
166 } 166 }
167 167
168 base::TimeDelta MediaPlayerRenderer::GetMediaTime() { 168 base::TimeDelta MediaPlayerRenderer::GetMediaTime() {
169 return media_player_->GetCurrentTime(); 169 return media_player_->GetCurrentTime();
170 } 170 }
171 171
172 media::MediaResourceGetter* MediaPlayerRenderer::GetMediaResourceGetter() { 172 media::MediaResourceGetter* MediaPlayerRenderer::GetMediaResourceGetter() {
173 DCHECK_CURRENTLY_ON(BrowserThread::UI); 173 DCHECK_CURRENTLY_ON(BrowserThread::UI);
174 if (!media_resource_getter_.get()) { 174 if (!media_resource_getter_.get()) {
175 WebContents* web_contents = 175 RenderProcessHost* host = render_frame_host_->GetProcess();
176 WebContents::FromRenderFrameHost(render_frame_host_);
177 RenderProcessHost* host = web_contents->GetRenderProcessHost();
178 BrowserContext* context = host->GetBrowserContext(); 176 BrowserContext* context = host->GetBrowserContext();
179 StoragePartition* partition = host->GetStoragePartition(); 177 StoragePartition* partition = host->GetStoragePartition();
180 storage::FileSystemContext* file_system_context = 178 storage::FileSystemContext* file_system_context =
181 partition ? partition->GetFileSystemContext() : nullptr; 179 partition ? partition->GetFileSystemContext() : nullptr;
182 media_resource_getter_.reset( 180 media_resource_getter_.reset(
183 new MediaResourceGetterImpl(context, file_system_context, host->GetID(), 181 new MediaResourceGetterImpl(context, file_system_context, host->GetID(),
184 render_frame_host_->GetRoutingID())); 182 render_frame_host_->GetRoutingID()));
185 } 183 }
186 return media_resource_getter_.get(); 184 return media_resource_getter_.get();
187 } 185 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void MediaPlayerRenderer::CancelScopedSurfaceRequest() { 271 void MediaPlayerRenderer::CancelScopedSurfaceRequest() {
274 if (!surface_request_token_) 272 if (!surface_request_token_)
275 return; 273 return;
276 274
277 ScopedSurfaceRequestManager::GetInstance()->UnregisterScopedSurfaceRequest( 275 ScopedSurfaceRequestManager::GetInstance()->UnregisterScopedSurfaceRequest(
278 surface_request_token_); 276 surface_request_token_);
279 surface_request_token_ = base::UnguessableToken(); 277 surface_request_token_ = base::UnguessableToken();
280 } 278 }
281 279
282 } // namespace content 280 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698