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
This commit is contained in:
chromecast
@ -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.
|
||||
|
||||
|
@ -28,9 +28,9 @@ CastContentBrowserClient::~CastContentBrowserClient() {
|
||||
|
||||
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(
|
||||
|
@ -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 @@ class CastContentBrowserClient: public content::ContentBrowserClient {
|
||||
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);
|
||||
|
Reference in New Issue
Block a user