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

Side by Side Diff: content/renderer/media/cdm/renderer_cdm_manager.cc

Issue 2034153002: Makes RenderFrameObserver/RenderViewObserver::OnDestruct pure virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer/media/cdm/renderer_cdm_manager.h" 5 #include "content/renderer/media/cdm/renderer_cdm_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 OnSessionExpirationUpdate) 43 OnSessionExpirationUpdate)
44 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromise, OnPromiseResolved) 44 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromise, OnPromiseResolved)
45 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromiseWithSession, 45 IPC_MESSAGE_HANDLER(CdmMsg_ResolvePromiseWithSession,
46 OnPromiseResolvedWithSession) 46 OnPromiseResolvedWithSession)
47 IPC_MESSAGE_HANDLER(CdmMsg_RejectPromise, OnPromiseRejected) 47 IPC_MESSAGE_HANDLER(CdmMsg_RejectPromise, OnPromiseRejected)
48 IPC_MESSAGE_UNHANDLED(handled = false) 48 IPC_MESSAGE_UNHANDLED(handled = false)
49 IPC_END_MESSAGE_MAP() 49 IPC_END_MESSAGE_MAP()
50 return handled; 50 return handled;
51 } 51 }
52 52
53 void RendererCdmManager::OnDestruct() {
54 delete this;
55 }
56
53 void RendererCdmManager::InitializeCdm(int cdm_id, 57 void RendererCdmManager::InitializeCdm(int cdm_id,
54 uint32_t promise_id, 58 uint32_t promise_id,
55 ProxyMediaKeys* media_keys, 59 ProxyMediaKeys* media_keys,
56 const std::string& key_system, 60 const std::string& key_system,
57 const GURL& security_origin, 61 const GURL& security_origin,
58 bool use_hw_secure_codecs) { 62 bool use_hw_secure_codecs) {
59 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered."; 63 DCHECK(GetMediaKeys(cdm_id)) << "|cdm_id| not registered.";
60 CdmHostMsg_InitializeCdm_Params params; 64 CdmHostMsg_InitializeCdm_Params params;
61 params.key_system = key_system; 65 params.key_system = key_system;
62 params.security_origin = security_origin; 66 params.security_origin = security_origin;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 proxy_media_keys_map_.erase(cdm_id); 243 proxy_media_keys_map_.erase(cdm_id);
240 } 244 }
241 245
242 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) { 246 ProxyMediaKeys* RendererCdmManager::GetMediaKeys(int cdm_id) {
243 std::map<int, ProxyMediaKeys*>::iterator iter = 247 std::map<int, ProxyMediaKeys*>::iterator iter =
244 proxy_media_keys_map_.find(cdm_id); 248 proxy_media_keys_map_.find(cdm_id);
245 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL; 249 return (iter != proxy_media_keys_map_.end()) ? iter->second : NULL;
246 } 250 }
247 251
248 } // namespace content 252 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/cdm/renderer_cdm_manager.h ('k') | content/renderer/media/media_stream_video_capturer_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698