summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorben <ben@chromium.org>2015-08-11 17:39:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-12 00:40:26 +0000
commitefecf8ac86019d7f191159279f46c1a90d071be9 (patch)
tree5b1a79eb26ca43ccc172466cb3a370e9dbbe4727 /media
parent17e96910eb69f6c05573b8a295dcb1792918e490 (diff)
downloadchromium_src-efecf8ac86019d7f191159279f46c1a90d071be9.zip
chromium_src-efecf8ac86019d7f191159279f46c1a90d071be9.tar.gz
chromium_src-efecf8ac86019d7f191159279f46c1a90d071be9.tar.bz2
Changes lifetime of ApplicationConnection instances.
Before this change, ApplicationConnections were owned by the ApplicationImpl, one created for every call to ConnectToApplication/AcceptConnection. While this makes sense for incoming connections (it doesn't make sense to transfer ownership of the connection to the delegate), it doesn't for outgoing connections. So we change ConnectToApplication to return a scoped_ptr<ApplicationConnection> which the caller must manage. R=sky@chromium.org http://crbug.com/519583 Review URL: https://codereview.chromium.org/1254383016 Cr-Commit-Position: refs/heads/master@{#342947}
Diffstat (limited to 'media')
-rw-r--r--media/mojo/services/media_apptest.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/media/mojo/services/media_apptest.cc b/media/mojo/services/media_apptest.cc
index 4d08fba..958c662 100644
--- a/media/mojo/services/media_apptest.cc
+++ b/media/mojo/services/media_apptest.cc
@@ -59,12 +59,11 @@ class MediaAppTest : public mojo::test::ApplicationTestBase {
mojo::URLRequestPtr request = mojo::URLRequest::New();
request->url = "mojo:media";
- mojo::ApplicationConnection* connection =
- application_impl()->ConnectToApplication(request.Pass());
- connection->SetRemoteServiceProviderConnectionErrorHandler(
+ connection_ = application_impl()->ConnectToApplication(request.Pass());
+ connection_->SetRemoteServiceProviderConnectionErrorHandler(
base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this)));
- connection->ConnectToService(&service_factory_);
+ connection_->ConnectToService(&service_factory_);
service_factory_->CreateCdm(mojo::GetProxy(&cdm_));
service_factory_->CreateRenderer(mojo::GetProxy(&renderer_));
@@ -122,6 +121,8 @@ class MediaAppTest : public mojo::test::ApplicationTestBase {
StrictMock<MockDemuxerStream> video_demuxer_stream_;
private:
+ scoped_ptr<mojo::ApplicationConnection> connection_;
+
DISALLOW_COPY_AND_ASSIGN(MediaAppTest);
};