diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-28 12:39:59 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-28 12:39:59 +0000 |
commit | dd85d45bfb6d0253a088521ceca46405b39f18e2 (patch) | |
tree | ce611af56fdf0befb5f2e724618cc1c9693a170b /chrome_frame/test/net | |
parent | 4ad65c3a4747321e98974fa27db4ebab895daaf7 (diff) | |
download | chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.zip chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.tar.gz chromium_src-dd85d45bfb6d0253a088521ceca46405b39f18e2.tar.bz2 |
Simplify the ProcessSingleton API.
Instead of having multiple functions that take a callback to initialize a member variable, intitialize the member once during the constructor. This reduces the variability of the internal state of ProcessSingleton.
BUG=170726, 170734
Review URL: https://chromiumcodereview.appspot.com/12668027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/net')
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index 464f0a0..887abf6 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -785,7 +785,12 @@ int CFUrlRequestUnittestRunner::PreCreateThreads() { fake_chrome_.reset(new FakeExternalTab()); fake_chrome_->Initialize(); fake_chrome_->browser_process()->PreCreateThreads(); - process_singleton_.reset(new ProcessSingleton(fake_chrome_->user_data())); + ProcessSingleton::NotificationCallback callback( + base::Bind( + &CFUrlRequestUnittestRunner::ProcessSingletonNotificationCallback, + base::Unretained(this))); + process_singleton_.reset(new ProcessSingleton(fake_chrome_->user_data(), + callback)); process_singleton_->Lock(NULL); return 0; } @@ -808,13 +813,9 @@ bool CFUrlRequestUnittestRunner::ProcessSingletonNotificationCallback( void CFUrlRequestUnittestRunner::PreMainMessageLoopRun() { fake_chrome_->InitializePostThreadsCreated(); - ProcessSingleton::NotificationCallback callback( - base::Bind( - &CFUrlRequestUnittestRunner::ProcessSingletonNotificationCallback, - base::Unretained(this))); // Call Create directly instead of NotifyOtherProcessOrCreate as failure is // prefered to notifying another process here. - if (!process_singleton_->Create(callback)) { + if (!process_singleton_->Create()) { LOG(FATAL) << "Failed to start up ProcessSingleton. Is another test " << "executable or Chrome Frame running?"; if (crash_service_) |