Commit 9843d0a6 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

weblayer: renames SessionService to BrowserPersister

This better conveys what the object does.

BUG=none
TEST=none

Change-Id: I21df5bcf0eca88184ace9a479e35b0e76a4be595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2051018
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740452}
parent 315e9f13
......@@ -123,10 +123,10 @@ jumbo_static_library("weblayer_lib") {
"browser/navigation_impl.h",
"browser/persistence/browser_persistence_common.cc",
"browser/persistence/browser_persistence_common.h",
"browser/persistence/browser_persister.cc",
"browser/persistence/browser_persister.h",
"browser/persistence/minimal_browser_persister.cc",
"browser/persistence/minimal_browser_persister.h",
"browser/persistence/session_service.cc",
"browser/persistence/session_service.h",
"browser/profile_impl.cc",
"browser/profile_impl.h",
"browser/ssl_error_controller_client.cc",
......
......@@ -10,8 +10,8 @@
#include "base/path_service.h"
#include "components/base32/base32.h"
#include "content/public/browser/browser_context.h"
#include "weblayer/browser/persistence/browser_persister.h"
#include "weblayer/browser/persistence/minimal_browser_persister.h"
#include "weblayer/browser/persistence/session_service.h"
#include "weblayer/browser/profile_impl.h"
#include "weblayer/browser/tab_impl.h"
#include "weblayer/common/weblayer_paths.h"
......@@ -132,18 +132,18 @@ ScopedJavaLocalRef<jstring> BrowserImpl::GetPersistenceId(
base::android::ConvertUTF8ToJavaString(env, GetPersistenceId()));
}
void BrowserImpl::SaveSessionServiceIfNecessary(
void BrowserImpl::SaveBrowserPersisterIfNecessary(
JNIEnv* env,
const JavaParamRef<jobject>& caller) {
session_service_->SaveIfNecessary();
browser_persister_->SaveIfNecessary();
}
ScopedJavaLocalRef<jbyteArray> BrowserImpl::GetSessionServiceCryptoKey(
ScopedJavaLocalRef<jbyteArray> BrowserImpl::GetBrowserPersisterCryptoKey(
JNIEnv* env,
const JavaParamRef<jobject>& caller) {
std::vector<uint8_t> key;
if (session_service_)
key = session_service_->GetCryptoKey();
if (browser_persister_)
key = browser_persister_->GetCryptoKey();
return base::android::ToJavaByteArray(env, key);
}
......@@ -265,7 +265,7 @@ std::vector<Tab*> BrowserImpl::GetTabs() {
}
void BrowserImpl::PrepareForShutdown() {
session_service_.reset();
browser_persister_.reset();
}
std::string BrowserImpl::GetPersistenceId() {
......@@ -293,8 +293,8 @@ void BrowserImpl::RestoreStateIfNecessary(
const PersistenceInfo& persistence_info) {
persistence_id_ = persistence_info.id;
if (!persistence_id_.empty()) {
session_service_ = std::make_unique<SessionService>(
GetSessionServiceDataPath(), this, persistence_info.last_crypto_key);
browser_persister_ = std::make_unique<BrowserPersister>(
GetBrowserPersisterDataPath(), this, persistence_info.last_crypto_key);
} else if (!persistence_info.minimal_state.empty()) {
RestoreMinimalState(this, persistence_info.minimal_state);
}
......@@ -307,8 +307,8 @@ void BrowserImpl::VisibleSecurityStateOfActiveTabChanged() {
#endif
}
base::FilePath BrowserImpl::GetSessionServiceDataPath() {
base::FilePath base_path = profile_->GetSessionServiceDataBaseDir();
base::FilePath BrowserImpl::GetBrowserPersisterDataPath() {
base::FilePath base_path = profile_->GetBrowserPersisterDataBaseDir();
DCHECK(!GetPersistenceId().empty());
const std::string encoded_name = base32::Base32Encode(GetPersistenceId());
return base_path.AppendASCII("State" + encoded_name);
......
......@@ -26,8 +26,8 @@ class WebContents;
namespace weblayer {
class BrowserPersister;
class ProfileImpl;
class SessionService;
class TabImpl;
class BrowserImpl : public Browser {
......@@ -36,7 +36,7 @@ class BrowserImpl : public Browser {
BrowserImpl& operator=(const BrowserImpl&) = delete;
~BrowserImpl() override;
SessionService* session_service() { return session_service_.get(); }
BrowserPersister* browser_persister() { return browser_persister_.get(); }
ProfileImpl* profile() { return profile_; }
......@@ -66,10 +66,10 @@ class BrowserImpl : public Browser {
base::android::ScopedJavaLocalRef<jstring> GetPersistenceId(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& caller);
void SaveSessionServiceIfNecessary(
void SaveBrowserPersisterIfNecessary(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& caller);
base::android::ScopedJavaLocalRef<jbyteArray> GetSessionServiceCryptoKey(
base::android::ScopedJavaLocalRef<jbyteArray> GetBrowserPersisterCryptoKey(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& caller);
base::android::ScopedJavaLocalRef<jbyteArray> GetMinimalPersistenceState(
......@@ -113,8 +113,8 @@ class BrowserImpl : public Browser {
void RestoreStateIfNecessary(const PersistenceInfo& persistence_info);
// Returns the path used by |session_service_|.
base::FilePath GetSessionServiceDataPath();
// Returns the path used by |browser_persister_|.
base::FilePath GetBrowserPersisterDataPath();
#if defined(OS_ANDROID)
base::android::ScopedJavaGlobalRef<jobject> java_impl_;
......@@ -124,7 +124,7 @@ class BrowserImpl : public Browser {
std::vector<std::unique_ptr<Tab>> tabs_;
TabImpl* active_tab_ = nullptr;
std::string persistence_id_;
std::unique_ptr<SessionService> session_service_;
std::unique_ptr<BrowserPersister> browser_persister_;
};
} // namespace weblayer
......
......@@ -155,9 +155,9 @@ public class BrowserImpl extends IBrowser.Stub {
if (mProfile.isIncognito() && hasPersistenceId) {
// Trigger a save now as saving may generate a new crypto key. This doesn't actually
// save synchronously, rather triggers a save on a background task runner.
BrowserImplJni.get().saveSessionServiceIfNecessary(mNativeBrowser, this);
BrowserImplJni.get().saveBrowserPersisterIfNecessary(mNativeBrowser, this);
outState.putByteArray(SAVED_STATE_SESSION_SERVICE_CRYPTO_KEY,
BrowserImplJni.get().getSessionServiceCryptoKey(mNativeBrowser, this));
BrowserImplJni.get().getBrowserPersisterCryptoKey(mNativeBrowser, this));
} else if (!hasPersistenceId) {
outState.putByteArray(SAVED_STATE_MINIMAL_PERSISTENCE_STATE_KEY,
BrowserImplJni.get().getMinimalPersistenceState(mNativeBrowser, this));
......@@ -401,8 +401,8 @@ public class BrowserImpl extends IBrowser.Stub {
TabImpl getActiveTab(long nativeBrowserImpl, BrowserImpl browser);
void prepareForShutdown(long nativeBrowserImpl, BrowserImpl browser);
String getPersistenceId(long nativeBrowserImpl, BrowserImpl browser);
void saveSessionServiceIfNecessary(long nativeBrowserImpl, BrowserImpl browser);
byte[] getSessionServiceCryptoKey(long nativeBrowserImpl, BrowserImpl browser);
void saveBrowserPersisterIfNecessary(long nativeBrowserImpl, BrowserImpl browser);
byte[] getBrowserPersisterCryptoKey(long nativeBrowserImpl, BrowserImpl browser);
byte[] getMinimalPersistenceState(long nativeBrowserImpl, BrowserImpl browser);
void restoreStateIfNecessary(long nativeBrowserImpl, BrowserImpl browser,
String persistenceId, byte[] persistenceCryptoKey, byte[] minimalPersistenceState);
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/browser/persistence/session_service.h"
#include "weblayer/browser/persistence/browser_persister.h"
#include <stddef.h>
......@@ -48,11 +48,12 @@ int GetIndexOfTab(BrowserImpl* browser, Tab* tab) {
// Every kWritesPerReset commands triggers recreating the file.
constexpr int kWritesPerReset = 250;
// SessionService -------------------------------------------------------------
// BrowserPersister
// -------------------------------------------------------------
SessionService::SessionService(const base::FilePath& path,
BrowserImpl* browser,
const std::vector<uint8_t>& decryption_key)
BrowserPersister::BrowserPersister(const base::FilePath& path,
BrowserImpl* browser,
const std::vector<uint8_t>& decryption_key)
: browser_(browser),
browser_session_id_(SessionID::NewUnique()),
command_storage_manager_(
......@@ -64,30 +65,30 @@ SessionService::SessionService(const base::FilePath& path,
crypto_key_(decryption_key) {
browser_->AddObserver(this);
command_storage_manager_->ScheduleGetCurrentSessionCommands(
base::BindOnce(&SessionService::OnGotCurrentSessionCommands,
base::BindOnce(&BrowserPersister::OnGotCurrentSessionCommands,
base::Unretained(this)),
decryption_key, &cancelable_task_tracker_);
}
SessionService::~SessionService() {
BrowserPersister::~BrowserPersister() {
SaveIfNecessary();
browser_->RemoveObserver(this);
}
void SessionService::SaveIfNecessary() {
void BrowserPersister::SaveIfNecessary() {
if (command_storage_manager_->HasPendingSave())
command_storage_manager_->Save();
}
const std::vector<uint8_t>& SessionService::GetCryptoKey() const {
const std::vector<uint8_t>& BrowserPersister::GetCryptoKey() const {
return crypto_key_;
}
bool SessionService::ShouldUseDelayedSave() {
bool BrowserPersister::ShouldUseDelayedSave() {
return true;
}
void SessionService::OnWillSaveCommands() {
void BrowserPersister::OnWillSaveCommands() {
if (!rebuild_on_next_save_)
return;
......@@ -98,11 +99,12 @@ void SessionService::OnWillSaveCommands() {
BuildCommandsForBrowser();
}
void SessionService::OnGeneratedNewCryptoKey(const std::vector<uint8_t>& key) {
void BrowserPersister::OnGeneratedNewCryptoKey(
const std::vector<uint8_t>& key) {
crypto_key_ = key;
}
void SessionService::OnTabAdded(Tab* tab) {
void BrowserPersister::OnTabAdded(Tab* tab) {
content::WebContents* web_contents =
static_cast<TabImpl*>(tab)->web_contents();
auto* tab_helper = sessions::SessionTabHelper::FromWebContents(web_contents);
......@@ -127,7 +129,7 @@ void SessionService::OnTabAdded(Tab* tab) {
}
}
void SessionService::OnTabRemoved(Tab* tab, bool active_tab_changed) {
void BrowserPersister::OnTabRemoved(Tab* tab, bool active_tab_changed) {
// Allow the associated sessionStorage to get deleted; it won't be needed
// in the session restore.
content::WebContents* web_contents =
......@@ -150,7 +152,7 @@ void SessionService::OnTabRemoved(Tab* tab, bool active_tab_changed) {
tab_to_available_range_.erase(i);
}
void SessionService::OnActiveTabChanged(Tab* tab) {
void BrowserPersister::OnActiveTabChanged(Tab* tab) {
if (rebuild_on_next_save_)
return;
......@@ -159,7 +161,7 @@ void SessionService::OnActiveTabChanged(Tab* tab) {
browser_session_id_, index));
}
void SessionService::SetTabUserAgentOverride(
void BrowserPersister::SetTabUserAgentOverride(
const SessionID& window_id,
const SessionID& tab_id,
const std::string& user_agent_override) {
......@@ -170,9 +172,9 @@ void SessionService::SetTabUserAgentOverride(
tab_id, user_agent_override));
}
void SessionService::SetSelectedNavigationIndex(const SessionID& window_id,
const SessionID& tab_id,
int index) {
void BrowserPersister::SetSelectedNavigationIndex(const SessionID& window_id,
const SessionID& tab_id,
int index) {
if (rebuild_on_next_save_)
return;
......@@ -189,7 +191,7 @@ void SessionService::SetSelectedNavigationIndex(const SessionID& window_id,
sessions::CreateSetSelectedNavigationIndexCommand(tab_id, index));
}
void SessionService::UpdateTabNavigation(
void BrowserPersister::UpdateTabNavigation(
const SessionID& window_id,
const SessionID& tab_id,
const SerializedNavigationEntry& navigation) {
......@@ -204,10 +206,10 @@ void SessionService::UpdateTabNavigation(
ScheduleCommand(CreateUpdateTabNavigationCommand(tab_id, navigation));
}
void SessionService::TabNavigationPathPruned(const SessionID& window_id,
const SessionID& tab_id,
int index,
int count) {
void BrowserPersister::TabNavigationPathPruned(const SessionID& window_id,
const SessionID& tab_id,
int index,
int count) {
if (rebuild_on_next_save_)
return;
......@@ -241,8 +243,9 @@ void SessionService::TabNavigationPathPruned(const SessionID& window_id,
sessions::CreateTabNavigationPathPrunedCommand(tab_id, index, count));
}
void SessionService::TabNavigationPathEntriesDeleted(const SessionID& window_id,
const SessionID& tab_id) {
void BrowserPersister::TabNavigationPathEntriesDeleted(
const SessionID& window_id,
const SessionID& tab_id) {
if (rebuild_on_next_save_)
return;
......@@ -252,19 +255,19 @@ void SessionService::TabNavigationPathEntriesDeleted(const SessionID& window_id,
command_storage_manager_->StartSaveTimer();
}
void SessionService::ScheduleRebuildOnNextSave() {
void BrowserPersister::ScheduleRebuildOnNextSave() {
rebuild_on_next_save_ = true;
command_storage_manager_->StartSaveTimer();
}
void SessionService::OnGotCurrentSessionCommands(
void BrowserPersister::OnGotCurrentSessionCommands(
std::vector<std::unique_ptr<sessions::SessionCommand>> commands) {
ScheduleRebuildOnNextSave();
RestoreBrowserState(browser_, std::move(commands));
}
void SessionService::BuildCommandsForTab(TabImpl* tab, int index_in_browser) {
void BrowserPersister::BuildCommandsForTab(TabImpl* tab, int index_in_browser) {
command_storage_manager_->AppendRebuildCommands(
BuildCommandsForTabConfiguration(browser_session_id_, tab,
index_in_browser));
......@@ -303,8 +306,8 @@ void SessionService::BuildCommandsForTab(TabImpl* tab, int index_in_browser) {
session_id, session_storage_namespace->id()));
}
void SessionService::BuildCommandsForBrowser() {
// This is necessary for SessionService to restore the browser. The type is
void BrowserPersister::BuildCommandsForBrowser() {
// This is necessary for BrowserPersister to restore the browser. The type is
// effectively ignored.
command_storage_manager_->AppendRebuildCommand(
sessions::CreateSetWindowTypeCommand(
......@@ -325,7 +328,7 @@ void SessionService::BuildCommandsForBrowser() {
active_index));
}
void SessionService::ScheduleCommand(
void BrowserPersister::ScheduleCommand(
std::unique_ptr<sessions::SessionCommand> command) {
DCHECK(command);
if (ReplacePendingCommand(command_storage_manager_.get(), &command))
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_BROWSER_PERSISTENCE_SESSION_SERVICE_H_
#define WEBLAYER_BROWSER_PERSISTENCE_SESSION_SERVICE_H_
#ifndef WEBLAYER_BROWSER_PERSISTENCE_BROWSER_PERSISTER_H_
#define WEBLAYER_BROWSER_PERSISTENCE_BROWSER_PERSISTER_H_
#include <stddef.h>
......@@ -31,24 +31,25 @@ namespace weblayer {
class BrowserImpl;
class TabImpl;
// SessionService is responsible for maintaining the state of tabs in a Browser
// so that they can be restored at a later date. To avoid having to write the
// complete state anytime something changes interesting events (represented as
// SessionCommands) are written to disk. To restore, the events are read back
// and the state recreated. At certain times the file is truncated and rebuilt
// from the current state.
class SessionService : public sessions::CommandStorageManagerDelegate,
public sessions::SessionTabHelperDelegate,
public BrowserObserver {
// BrowserPersister is responsible for maintaining the state of tabs in a
// single Browser so that they can be restored at a later date. The state is
// written to a file. To avoid having to write the complete state anytime
// something changes interesting events (represented as SessionCommands) are
// written to disk. To restore, the events are read back and the state
// recreated. At certain times the file is truncated and rebuilt from the
// current state.
class BrowserPersister : public sessions::CommandStorageManagerDelegate,
public sessions::SessionTabHelperDelegate,
public BrowserObserver {
public:
SessionService(const base::FilePath& path,
BrowserImpl* browser,
const std::vector<uint8_t>& decryption_key);
BrowserPersister(const base::FilePath& path,
BrowserImpl* browser,
const std::vector<uint8_t>& decryption_key);
SessionService(const SessionService&) = delete;
SessionService& operator=(const SessionService&) = delete;
BrowserPersister(const BrowserPersister&) = delete;
BrowserPersister& operator=(const BrowserPersister&) = delete;
~SessionService() override;
~BrowserPersister() override;
void SaveIfNecessary();
......@@ -57,7 +58,7 @@ class SessionService : public sessions::CommandStorageManagerDelegate,
const std::vector<uint8_t>& GetCryptoKey() const;
private:
friend class SessionServiceTestHelper;
friend class BrowserPersisterTestHelper;
using IdToRange = std::map<SessionID, std::pair<int, int>>;
......@@ -130,4 +131,4 @@ class SessionService : public sessions::CommandStorageManagerDelegate,
} // namespace weblayer
#endif // WEBLAYER_BROWSER_PERSISTENCE_SESSION_SERVICE_H_
#endif // WEBLAYER_BROWSER_PERSISTENCE_BROWSER_PERSISTER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/browser/persistence/session_service.h"
#include "weblayer/browser/persistence/browser_persister.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
......@@ -29,11 +29,11 @@
namespace weblayer {
class SessionServiceTestHelper {
class BrowserPersisterTestHelper {
public:
static sessions::CommandStorageManager* GetCommandStorageManager(
SessionService* service) {
return service->command_storage_manager_.get();
BrowserPersister* persister) {
return persister->command_storage_manager_.get();
}
};
......@@ -152,10 +152,10 @@ class BrowserNavigationObserverImpl : public BrowserObserver,
base::RunLoop run_loop_;
};
void ShutdownSessionServiceAndWait(BrowserImpl* browser) {
void ShutdownBrowserPersisterAndWait(BrowserImpl* browser) {
auto task_runner = sessions::CommandStorageManagerTestHelper(
SessionServiceTestHelper::GetCommandStorageManager(
browser->session_service()))
BrowserPersisterTestHelper::GetCommandStorageManager(
browser->browser_persister()))
.GetBackendTaskRunner();
browser->PrepareForShutdown();
base::RunLoop run_loop;
......@@ -175,16 +175,16 @@ std::unique_ptr<BrowserImpl> CreateBrowser(ProfileImpl* profile,
} // namespace
using SessionServiceTest = WebLayerBrowserTest;
using BrowserPersisterTest = WebLayerBrowserTest;
IN_PROC_BROWSER_TEST_F(SessionServiceTest, SingleTab) {
IN_PROC_BROWSER_TEST_F(BrowserPersisterTest, SingleTab) {
ASSERT_TRUE(embedded_test_server()->Start());
std::unique_ptr<BrowserImpl> browser = CreateBrowser(GetProfile(), "x");
Tab* tab = browser->AddTab(Tab::Create(GetProfile()));
const GURL url = embedded_test_server()->GetURL("/simple_page.html");
NavigateAndWaitForCompletion(url, tab);
ShutdownSessionServiceAndWait(browser.get());
ShutdownBrowserPersisterAndWait(browser.get());
tab = nullptr;
browser.reset();
......@@ -202,7 +202,7 @@ IN_PROC_BROWSER_TEST_F(SessionServiceTest, SingleTab) {
->GetNavigationListSize());
}
IN_PROC_BROWSER_TEST_F(SessionServiceTest, TwoTabs) {
IN_PROC_BROWSER_TEST_F(BrowserPersisterTest, TwoTabs) {
ASSERT_TRUE(embedded_test_server()->Start());
std::unique_ptr<BrowserImpl> browser = CreateBrowser(GetProfile(), "x");
......@@ -216,7 +216,7 @@ IN_PROC_BROWSER_TEST_F(SessionServiceTest, TwoTabs) {
browser->SetActiveTab(tab2);
// Shut down the service.
ShutdownSessionServiceAndWait(browser.get());
ShutdownBrowserPersisterAndWait(browser.get());
tab1 = tab2 = nullptr;
browser.reset();
......@@ -245,11 +245,11 @@ IN_PROC_BROWSER_TEST_F(SessionServiceTest, TwoTabs) {
->GetNavigationListSize())
<< "iteration " << i;
ShutdownSessionServiceAndWait(browser.get());
ShutdownBrowserPersisterAndWait(browser.get());
}
}
IN_PROC_BROWSER_TEST_F(SessionServiceTest, MoveBetweenBrowsers) {
IN_PROC_BROWSER_TEST_F(BrowserPersisterTest, MoveBetweenBrowsers) {
ASSERT_TRUE(embedded_test_server()->Start());
// Create a browser with two tabs.
......@@ -273,8 +273,8 @@ IN_PROC_BROWSER_TEST_F(SessionServiceTest, MoveBetweenBrowsers) {
browser2->AddTab(browser1->RemoveTab(tab2));
browser2->SetActiveTab(tab2);
ShutdownSessionServiceAndWait(browser1.get());
ShutdownSessionServiceAndWait(browser2.get());
ShutdownBrowserPersisterAndWait(browser1.get());
ShutdownBrowserPersisterAndWait(browser2.get());
tab1 = nullptr;
browser1.reset();
......
......@@ -65,7 +65,7 @@ base::FilePath ComputeCachePath(const std::string& profile_name) {
}
#endif // OS_POSIX
base::FilePath ComputeSessionServiceDataBaseDir(
base::FilePath ComputeBrowserPersisterDataBaseDir(
const base::FilePath& data_path) {
base::FilePath base_path;
if (data_path.empty()) {
......@@ -81,7 +81,7 @@ void NukeProfileFromDisk(const std::string& profile_name,
const base::FilePath& data_path) {
if (data_path.empty()) {
// Incognito. Just delete session data.
base::DeleteFileRecursively(ComputeSessionServiceDataBaseDir(data_path));
base::DeleteFileRecursively(ComputeBrowserPersisterDataBaseDir(data_path));
return;
}
......@@ -317,8 +317,8 @@ void ProfileImpl::DecrementBrowserImplCount() {
num_browser_impl_--;
}
base::FilePath ProfileImpl::GetSessionServiceDataBaseDir() const {
return ComputeSessionServiceDataBaseDir(data_path_);
base::FilePath ProfileImpl::GetBrowserPersisterDataBaseDir() const {
return ComputeBrowserPersisterDataBaseDir(data_path_);
}
} // namespace weblayer
......@@ -70,9 +70,9 @@ class ProfileImpl : public Profile {
void DecrementBrowserImplCount();
const base::FilePath& download_directory() { return download_directory_; }
// Get the directory where session service should store tab state data. This
// will be a real file path even for the off-the-record profile.
base::FilePath GetSessionServiceDataBaseDir() const;
// Get the directory where BrowserPersister stores tab state data. This will
// be a real file path even for the off-the-record profile.
base::FilePath GetBrowserPersisterDataBaseDir() const;
private:
class DataClearer;
......
......@@ -29,7 +29,7 @@
#include "weblayer/browser/i18n_util.h"
#include "weblayer/browser/isolated_world_ids.h"
#include "weblayer/browser/navigation_controller_impl.h"
#include "weblayer/browser/persistence/session_service.h"
#include "weblayer/browser/persistence/browser_persister.h"
#include "weblayer/browser/profile_impl.h"
#include "weblayer/public/download_delegate.h"
#include "weblayer/public/fullscreen_delegate.h"
......@@ -665,7 +665,7 @@ find_in_page::FindTabHelper* TabImpl::GetFindTabHelper() {
sessions::SessionTabHelperDelegate* TabImpl::GetSessionServiceTabHelperDelegate(
content::WebContents* web_contents) {
DCHECK_EQ(web_contents, web_contents_.get());
return browser_ ? browser_->session_service() : nullptr;
return browser_ ? browser_->browser_persister() : nullptr;
}
} // namespace weblayer
......@@ -173,8 +173,8 @@ test("weblayer_browsertests") {
# These tests create Browser objects from C++, which the Java side is not
# setup for. Persistence related tests for Java will be done as
# integration tests.
"../browser/persistence/browser_persister_browsertest.cc",
"../browser/persistence/minimal_browser_persister_browsertest.cc",
"../browser/persistence/session_service_browsertest.cc",
]
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment