CastContentBrowserClient should not hold CastBrowserMainParts lifetime.
R=lcwu@chromium.org,byungchul@chromium.org
BUG=None
Review URL: https://codereview.chromium.org/463563003
Cr-Commit-Position: refs/heads/master@{#289241}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289241 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chromecast/chromecast.gyp b/chromecast/chromecast.gyp
index 989b8aa..2430332 100644
--- a/chromecast/chromecast.gyp
+++ b/chromecast/chromecast.gyp
@@ -1,4 +1,4 @@
-# Copyright 2014 The Chromium Authors. All Rights Reserved.
+# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
diff --git a/chromecast/shell/browser/cast_content_browser_client.cc b/chromecast/shell/browser/cast_content_browser_client.cc
index fc1dac8..ccf8e21 100644
--- a/chromecast/shell/browser/cast_content_browser_client.cc
+++ b/chromecast/shell/browser/cast_content_browser_client.cc
@@ -28,9 +28,9 @@
content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) {
- shell_browser_main_parts_.reset(
- new CastBrowserMainParts(parameters, url_request_context_factory_.get()));
- return shell_browser_main_parts_.get();
+ shell_browser_main_parts_ =
+ new CastBrowserMainParts(parameters, url_request_context_factory_.get());
+ return shell_browser_main_parts_;
}
void CastContentBrowserClient::RenderProcessWillLaunch(
diff --git a/chromecast/shell/browser/cast_content_browser_client.h b/chromecast/shell/browser/cast_content_browser_client.h
index 8647cd2..100b3a4 100644
--- a/chromecast/shell/browser/cast_content_browser_client.h
+++ b/chromecast/shell/browser/cast_content_browser_client.h
@@ -6,6 +6,7 @@
#define CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "content/public/browser/content_browser_client.h"
namespace chromecast {
@@ -69,8 +70,9 @@
std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE;
private:
- scoped_ptr<CastBrowserMainParts> shell_browser_main_parts_;
-
+ // Note: BrowserMainLoop holds ownership of CastBrowserMainParts after it is
+ // created.
+ CastBrowserMainParts* shell_browser_main_parts_;
scoped_ptr<URLRequestContextFactory> url_request_context_factory_;
DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient);