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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2460303003: Checking RendererThreadImpl for null when creating media player. (Closed)
Patch Set: addressing review comments Created 4 years, 1 month 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 | « content/renderer/media/audio_device_factory.cc ('k') | 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 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 if (!web_stream.isNull()) 2728 if (!web_stream.isNull())
2729 return CreateWebMediaPlayerForMediaStream(client, sink_id, 2729 return CreateWebMediaPlayerForMediaStream(client, sink_id,
2730 frame_->getSecurityOrigin()); 2730 frame_->getSecurityOrigin());
2731 2731
2732 // If |source| was not a MediaStream, it must be a URL. 2732 // If |source| was not a MediaStream, it must be a URL.
2733 // TODO(guidou): Fix this when support for other srcObject types is added. 2733 // TODO(guidou): Fix this when support for other srcObject types is added.
2734 DCHECK(source.isURL()); 2734 DCHECK(source.isURL());
2735 blink::WebURL url = source.getAsURL(); 2735 blink::WebURL url = source.getAsURL();
2736 2736
2737 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 2737 RenderThreadImpl* render_thread = RenderThreadImpl::current();
2738 // Render thread may not exist in tests, returning nullptr if it does not.
2739 if (!render_thread)
2740 return nullptr;
2738 2741
2739 scoped_refptr<media::SwitchableAudioRendererSink> audio_renderer_sink = 2742 scoped_refptr<media::SwitchableAudioRendererSink> audio_renderer_sink =
2740 AudioDeviceFactory::NewSwitchableAudioRendererSink( 2743 AudioDeviceFactory::NewSwitchableAudioRendererSink(
2741 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, 2744 AudioDeviceFactory::kSourceMediaElement, routing_id_, 0,
2742 sink_id.utf8(), frame_->getSecurityOrigin()); 2745 sink_id.utf8(), frame_->getSecurityOrigin());
2743 // We need to keep a reference to the context provider (see crbug.com/610527) 2746 // We need to keep a reference to the context provider (see crbug.com/610527)
2744 // but media/ can't depend on cc/, so for now, just keep a reference in the 2747 // but media/ can't depend on cc/, so for now, just keep a reference in the
2745 // callback. 2748 // callback.
2746 // TODO(piman): replace media::Context3D to scoped_refptr<ContextProvider> in 2749 // TODO(piman): replace media::Context3D to scoped_refptr<ContextProvider> in
2747 // media/ once ContextProvider is in gpu/. 2750 // media/ once ContextProvider is in gpu/.
(...skipping 3867 matching lines...) Expand 10 before | Expand all | Expand 10 after
6615 // event target. Potentially a Pepper plugin will receive the event. 6618 // event target. Potentially a Pepper plugin will receive the event.
6616 // In order to tell whether a plugin gets the last mouse event and which it 6619 // In order to tell whether a plugin gets the last mouse event and which it
6617 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6620 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6618 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6621 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6619 // |pepper_last_mouse_event_target_|. 6622 // |pepper_last_mouse_event_target_|.
6620 pepper_last_mouse_event_target_ = nullptr; 6623 pepper_last_mouse_event_target_ = nullptr;
6621 #endif 6624 #endif
6622 } 6625 }
6623 6626
6624 } // namespace content 6627 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698