diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 06:02:58 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 06:02:58 +0000 |
commit | af20e8978167d2a0f9fda5c3245bc19de7f0a295 (patch) | |
tree | ffd028c89ae699e291ce978939b758a7361f8bba | |
parent | a86e03c9a96bbbb13db11705703b23bf4feec742 (diff) | |
download | chromium_src-af20e8978167d2a0f9fda5c3245bc19de7f0a295.zip chromium_src-af20e8978167d2a0f9fda5c3245bc19de7f0a295.tar.gz chromium_src-af20e8978167d2a0f9fda5c3245bc19de7f0a295.tar.bz2 |
Remove Chrome Frame's delay shutdown field trial.
Delete lots of related code in both Chrome and CF.
BUG=229940
TEST=NONE
Review URL: https://chromiumcodereview.appspot.com/14030003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194798 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/automation/chrome_frame_automation_provider_win.cc | 48 | ||||
-rw-r--r-- | chrome/browser/automation/chrome_frame_automation_provider_win.h | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 53 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 21 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_plugin.h | 3 | ||||
-rw-r--r-- | chrome_frame/chrome_launcher.cc | 1 | ||||
-rw-r--r-- | chrome_frame/chrome_tab.cc | 11 | ||||
-rw-r--r-- | chrome_frame/metrics_service.h | 1 | ||||
-rw-r--r-- | chrome_frame/test/automation_client_mock.cc | 10 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_automation_mock.h | 2 | ||||
-rw-r--r-- | chrome_frame/test/proxy_factory_mock.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/run_all_unittests.cc | 5 |
14 files changed, 14 insertions, 152 deletions
diff --git a/chrome/browser/automation/chrome_frame_automation_provider_win.cc b/chrome/browser/automation/chrome_frame_automation_provider_win.cc index 808b711..e251a35 100644 --- a/chrome/browser/automation/chrome_frame_automation_provider_win.cc +++ b/chrome/browser/automation/chrome_frame_automation_provider_win.cc @@ -4,10 +4,6 @@ #include "chrome/browser/automation/chrome_frame_automation_provider_win.h" -#include <algorithm> - -#include "base/command_line.h" -#include "base/strings/string_number_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" @@ -16,8 +12,6 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_message.h" -const int kMaxChromeShutdownDelaySeconds = 60*60; - ChromeFrameAutomationProvider::ChromeFrameAutomationProvider(Profile* profile) : AutomationProvider(profile) { DCHECK(g_browser_process); @@ -27,38 +21,8 @@ ChromeFrameAutomationProvider::ChromeFrameAutomationProvider(Profile* profile) ChromeFrameAutomationProvider::~ChromeFrameAutomationProvider() { DCHECK(g_browser_process); - if (g_browser_process) { - CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); - - CommandLine::StringType shutdown_delay( - cmd_line.GetSwitchValueNative(switches::kChromeFrameShutdownDelay)); - if (!shutdown_delay.empty()) { - VLOG(1) << "ChromeFrameAutomationProvider: " - "Scheduling ReleaseBrowserProcess."; - - // Grab the specified shutdown delay. - int shutdown_delay_seconds = 0; - base::StringToInt(shutdown_delay, &shutdown_delay_seconds); - - // Clamp to reasonable values. - shutdown_delay_seconds = std::max(0, shutdown_delay_seconds); - shutdown_delay_seconds = std::min(shutdown_delay_seconds, - kMaxChromeShutdownDelaySeconds); - - // We have Chrome Frame defer Chrome shutdown for a time to improve - // intra-page load times. - // Note that we are tracking the perf impact of this under - // http://crbug.com/98506 - MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&ChromeFrameAutomationProvider::ReleaseBrowserProcess), - base::TimeDelta::FromSeconds(shutdown_delay_seconds)); - } else { - VLOG(1) << "ChromeFrameAutomationProvider: " - "Releasing browser module with no delay."; - g_browser_process->ReleaseModule(); - } - } + if (g_browser_process) + g_browser_process->ReleaseModule(); } bool ChromeFrameAutomationProvider::OnMessageReceived( @@ -120,11 +84,3 @@ bool ChromeFrameAutomationProvider::IsValidMessage(uint32 type) { return is_valid_message; } - -// static -void ChromeFrameAutomationProvider::ReleaseBrowserProcess() { - if (g_browser_process) { - VLOG(1) << "ChromeFrameAutomationProvider: Releasing browser process."; - g_browser_process->ReleaseModule(); - } -} diff --git a/chrome/browser/automation/chrome_frame_automation_provider_win.h b/chrome/browser/automation/chrome_frame_automation_provider_win.h index 6b5a145..5fe0eef 100644 --- a/chrome/browser/automation/chrome_frame_automation_provider_win.h +++ b/chrome/browser/automation/chrome_frame_automation_provider_win.h @@ -33,10 +33,6 @@ class ChromeFrameAutomationProvider : public AutomationProvider { // Returns true if the message received is a valid chrome frame message. bool IsValidMessage(uint32 type); - // Called to release an instance's ref count on the global BrowserProcess - // instance. - static void ReleaseBrowserProcess(); - private: DISALLOW_COPY_AND_ASSIGN(ChromeFrameAutomationProvider); }; diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 334010c..053eb57 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -151,10 +151,6 @@ const char kCheckCloudPrintConnectorPolicy[] = // as a dependent process of the Chrome Frame plugin. const char kChromeFrame[] = "chrome-frame"; -// Tells Chrome to delay shutdown (for a specified number of seconds) when a -// Chrome Frame automation channel is closed. -const char kChromeFrameShutdownDelay[] = "chrome-frame-shutdown-delay"; - // Tells chrome to load the specified version of chrome.dll on Windows. If this // version cannot be loaded, Chrome will exit. const char kChromeVersion[] = "chrome-version"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 0bd37fe..30582b1 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -59,7 +59,6 @@ extern const char kAutomationReinitializeOnChannelError[]; extern const char kCheckForUpdateIntervalSec[]; extern const char kCheckCloudPrintConnectorPolicy[]; extern const char kChromeFrame[]; -extern const char kChromeFrameShutdownDelay[]; extern const char kChromeVersion[]; extern const char kCipherSuiteBlacklist[]; extern const char kClearTokenService[]; diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 633a1ae..3247343 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -14,7 +14,6 @@ #include "base/file_version_info.h" #include "base/lazy_instance.h" #include "base/logging.h" -#include "base/metrics/field_trial.h" #include "base/path_service.h" #include "base/process_util.h" #include "base/string_util.h" @@ -43,10 +42,6 @@ int64 kAutomationServerReasonableLaunchDelay = 1000; // in milliseconds int64 kAutomationServerReasonableLaunchDelay = 1000 * 10; #endif -const char kChromeShutdownDelaySeconds[] = "30"; -const char kWithDelayFieldTrialName[] = "WithShutdownDelay"; -const char kNoDelayFieldTrialName[] = "NoShutdownDelay"; - } // namespace class ChromeFrameAutomationProxyImpl::TabProxyNotificationMessageFilter @@ -302,10 +297,6 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params, if (IsAccessibleMode()) command_line->AppendSwitch(switches::kForceRendererAccessibility); - if (params->send_shutdown_delay_switch()) - command_line->AppendSwitchASCII(switches::kChromeFrameShutdownDelay, - kChromeShutdownDelaySeconds); - DVLOG(1) << "Profile path: " << params->profile_path().value(); command_line->AppendSwitchPath(switches::kUserDataDir, params->profile_path()); @@ -350,19 +341,9 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params, if (launch_result_ == AUTOMATION_SUCCESS) { UMA_HISTOGRAM_TIMES( "ChromeFrame.AutomationServerLaunchSuccessTime", delta); - UMA_HISTOGRAM_TIMES( - base::FieldTrial::MakeName( - "ChromeFrame.AutomationServerLaunchSuccessTime", - "ChromeShutdownDelay"), - delta); } else { UMA_HISTOGRAM_TIMES( "ChromeFrame.AutomationServerLaunchFailedTime", delta); - UMA_HISTOGRAM_TIMES( - base::FieldTrial::MakeName( - "ChromeFrame.AutomationServerLaunchFailedTime", - "ChromeShutdownDelay"), - delta); } UMA_HISTOGRAM_CUSTOM_COUNTS("ChromeFrame.LaunchResult", @@ -557,9 +538,7 @@ ChromeFrameAutomationClient::ChromeFrameAutomationClient() url_fetcher_(NULL), url_fetcher_flags_(PluginUrlRequestManager::NOT_THREADSAFE), navigate_after_initialization_(false), - route_all_top_level_navigations_(false), - send_shutdown_delay_switch_(true) { - InitializeFieldTrials(); + route_all_top_level_navigations_(false) { } ChromeFrameAutomationClient::~ChromeFrameAutomationClient() { @@ -698,8 +677,7 @@ bool ChromeFrameAutomationClient::InitiateNavigation( base::FilePath profile_path; chrome_launch_params_ = new ChromeFrameLaunchParams(parsed_url, referrer_gurl, profile_path, L"", SimpleResourceLoader::GetLanguage(), - false, false, route_all_top_level_navigations_, - send_shutdown_delay_switch_); + false, false, route_all_top_level_navigations_); } else { chrome_launch_params_->set_referrer(referrer_gurl); chrome_launch_params_->set_url(parsed_url); @@ -1037,33 +1015,6 @@ bool ChromeFrameAutomationClient::ProcessUrlRequestMessage(TabProxy* tab, return true; } -void ChromeFrameAutomationClient::InitializeFieldTrials() { - static base::FieldTrial* trial = NULL; - if (!trial) { - // Do one-time initialization of the field trial here. - // TODO(robertshield): End the field trial before March 7th 2013. - scoped_refptr<base::FieldTrial> new_trial = - base::FieldTrialList::FactoryGetFieldTrial( - "ChromeShutdownDelay", 1000, kWithDelayFieldTrialName, - 2013, 3, 7, NULL); - - // Be consistent for this client. Note that this will only have an effect - // once the client id is persisted. See http://crbug.com/117188 - new_trial->UseOneTimeRandomization(); - - new_trial->AppendGroup(kNoDelayFieldTrialName, 500); // 50% without. - - trial = new_trial.get(); - } - - // Take action depending of which group we randomly land in. - if (trial->group_name() == kWithDelayFieldTrialName) - send_shutdown_delay_switch_ = true; - else - send_shutdown_delay_switch_ = false; - -} - // These are invoked in channel's background thread. // Cannot call any method of the activex here since it is a STA kind of being. // By default we marshal the IPC message to the main/GUI thread and from there diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index f6db526..e903268 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -111,15 +111,13 @@ class ChromeFrameLaunchParams : // NOLINT const std::wstring& profile_name, const std::wstring& language, bool incognito, bool widget_mode, - bool route_all_top_level_navigations, - bool send_shutdown_delay_switch) + bool route_all_top_level_navigations) : launch_timeout_(kCommandExecutionTimeout), url_(url), referrer_(referrer), profile_path_(profile_path), profile_name_(profile_name), language_(language), version_check_(true), incognito_mode_(incognito), is_widget_mode_(widget_mode), - route_all_top_level_navigations_(route_all_top_level_navigations), - send_shutdown_delay_switch_(send_shutdown_delay_switch) { + route_all_top_level_navigations_(route_all_top_level_navigations) { } ~ChromeFrameLaunchParams() { @@ -186,10 +184,6 @@ class ChromeFrameLaunchParams : // NOLINT return route_all_top_level_navigations_; } - bool send_shutdown_delay_switch() const { - return send_shutdown_delay_switch_; - } - protected: int launch_timeout_; GURL url_; @@ -201,7 +195,6 @@ class ChromeFrameLaunchParams : // NOLINT bool incognito_mode_; bool is_widget_mode_; bool route_all_top_level_navigations_; - bool send_shutdown_delay_switch_; private: DISALLOW_COPY_AND_ASSIGN(ChromeFrameLaunchParams); @@ -378,10 +371,6 @@ class ChromeFrameAutomationClient return use_chrome_network_; } - bool send_shutdown_delay_switch() const { - return send_shutdown_delay_switch_; - } - #ifdef UNIT_TEST void set_proxy_factory(ProxyFactory* factory) { proxy_factory_ = factory; @@ -439,8 +428,6 @@ class ChromeFrameAutomationClient } private: - void InitializeFieldTrials(); - void OnMessageReceivedUIThread(const IPC::Message& msg); void OnChannelErrorUIThread(); @@ -525,10 +512,6 @@ class ChromeFrameAutomationClient // page without chrome frame. Defaults to false. bool route_all_top_level_navigations_; - // Set to true if Chrome Frame should tell Chrome to delay shutdown after - // we break a connection. Currently used only as part of a field trial. - bool send_shutdown_delay_switch_; - friend class BeginNavigateContext; friend class CreateExternalTabContext; }; diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h index 8eeeee6..4ac984e 100644 --- a/chrome_frame/chrome_frame_plugin.h +++ b/chrome_frame/chrome_frame_plugin.h @@ -82,8 +82,7 @@ END_MSG_MAP() base::FilePath actual_profile_name = profile_path.BaseName(); launch_params_ = new ChromeFrameLaunchParams(url, referrer, profile_path, actual_profile_name.value(), SimpleResourceLoader::GetLanguage(), - incognito_mode, is_widget_mode, route_all_top_level_navigations, - automation_client_->send_shutdown_delay_switch()); + incognito_mode, is_widget_mode, route_all_top_level_navigations); return automation_client_->Initialize(this, launch_params_); } diff --git a/chrome_frame/chrome_launcher.cc b/chrome_frame/chrome_launcher.cc index 28613f4..d9f3a9f 100644 --- a/chrome_frame/chrome_launcher.cc +++ b/chrome_frame/chrome_launcher.cc @@ -22,7 +22,6 @@ namespace { const wchar_t* kAllowedSwitches[] = { L"automation-channel", L"chrome-frame", - L"chrome-frame-shutdown-delay", L"chrome-version", L"disable-background-mode", L"disable-popup-blocking", diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc index 0d6e059..a65c3d7 100644 --- a/chrome_frame/chrome_tab.cc +++ b/chrome_frame/chrome_tab.cc @@ -17,7 +17,6 @@ #include "base/file_version_info.h" #include "base/logging.h" #include "base/logging_win.h" -#include "base/metrics/field_trial.h" #include "base/path_service.h" #include "base/string16.h" #include "base/string_number_conversions.h" @@ -40,7 +39,6 @@ #include "chrome_frame/chrome_protocol.h" #include "chrome_frame/dll_redirector.h" #include "chrome_frame/exception_barrier.h" -#include "chrome_frame/metrics_service.h" #include "chrome_frame/pin_module.h" #include "chrome_frame/resource.h" #include "chrome_frame/utils.h" @@ -233,7 +231,6 @@ class ChromeTabModule : public CAtlDllModuleT<ChromeTabModule> { ChromeTabModule _AtlModule; base::AtExitManager* g_exit_manager = NULL; -base::FieldTrialList* g_field_trial_list = NULL; HRESULT RefreshElevationPolicy() { const wchar_t kIEFrameDll[] = L"ieframe.dll"; @@ -899,18 +896,10 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, // Enable trace control and transport through event tracing for Windows. logging::LogEventProvider::Initialize(kChromeFrameProvider); - // Initialize the field test infrastructure. Must be done somewhere that - // can only get called once. For Chrome Frame, that is here. - g_field_trial_list = new base::FieldTrialList( - new metrics::SHA1EntropyProvider(MetricsService::GetClientID())); - // Set a callback so that crash reporting can be pinned when the module is // pinned. chrome_frame::SetPinModuleCallback(&OnPinModule); } else if (reason == DLL_PROCESS_DETACH) { - delete g_field_trial_list; - g_field_trial_list = NULL; - DllRedirector* dll_redirector = DllRedirector::GetInstance(); DCHECK(dll_redirector); dll_redirector->UnregisterAsFirstCFModule(); diff --git a/chrome_frame/metrics_service.h b/chrome_frame/metrics_service.h index ab0c008..821a537 100644 --- a/chrome_frame/metrics_service.h +++ b/chrome_frame/metrics_service.h @@ -14,7 +14,6 @@ #include "base/basictypes.h" #include "base/lazy_instance.h" #include "base/memory/scoped_ptr.h" -#include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" #include "base/synchronization/lock.h" #include "base/threading/platform_thread.h" diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index 347a041..2bd0c64 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -137,7 +137,7 @@ void CFACWithChrome::SetUp() { GURL empty; launch_params_ = new ChromeFrameLaunchParams( empty, empty, profile_path_, profile_path_.BaseName().value(), L"", - false, false, false, false); + false, false, false); launch_params_->set_version_check(false); launch_params_->set_launch_timeout(kSaneAutomationTimeoutMs); } @@ -266,7 +266,7 @@ TEST_F(CFACMockTest, MockedCreateTabOk) { GURL empty; scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( empty, empty, profile_path_, profile_path_.BaseName().value(), L"", - false, false, false, false)); + false, false, false)); clp->set_launch_timeout(timeout); clp->set_version_check(false); EXPECT_TRUE(client_->Initialize(&cfd_, clp)); @@ -299,7 +299,7 @@ TEST_F(CFACMockTest, MockedCreateTabFailed) { GURL empty; scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( empty, empty, profile_path_, profile_path_.BaseName().value(), L"", - false, false, false, false)); + false, false, false)); clp->set_launch_timeout(timeout_); clp->set_version_check(false); EXPECT_TRUE(client_->Initialize(&cfd_, clp)); @@ -343,7 +343,7 @@ TEST_F(CFACMockTest, OnChannelError) { GURL empty; scoped_refptr<ChromeFrameLaunchParams> clp(new ChromeFrameLaunchParams( empty, empty, profile_path_, profile_path_.BaseName().value(), L"", - false, false, false, false)); + false, false, false)); clp->set_launch_timeout(1); // Unneeded timeout, but can't be 0. clp->set_version_check(false); @@ -463,7 +463,7 @@ TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) { scoped_refptr<ChromeFrameLaunchParams> launch_params( new ChromeFrameLaunchParams( GURL("http://www.nonexistent.com"), empty, profile_path_, - profile_path_.BaseName().value(), L"", false, false, false, false)); + profile_path_.BaseName().value(), L"", false, false, false)); launch_params->set_launch_timeout(timeout); launch_params->set_version_check(false); EXPECT_TRUE(client_->Initialize(&cfd_, launch_params)); diff --git a/chrome_frame/test/chrome_frame_automation_mock.h b/chrome_frame/test/chrome_frame_automation_mock.h index 052d36d..3cdaf68 100644 --- a/chrome_frame/test/chrome_frame_automation_mock.h +++ b/chrome_frame/test/chrome_frame_automation_mock.h @@ -49,7 +49,7 @@ class AutomationMockDelegate GURL empty; scoped_refptr<ChromeFrameLaunchParams> clp( new ChromeFrameLaunchParams(empty, empty, profile_path, profile_name, - language, incognito, is_widget_mode, false, false)); + language, incognito, is_widget_mode, false)); clp->set_launch_timeout(launch_timeout); clp->set_version_check(perform_version_check); automation_client_->Initialize(this, clp); diff --git a/chrome_frame/test/proxy_factory_mock.cc b/chrome_frame/test/proxy_factory_mock.cc index f98a2e6..fdad575 100644 --- a/chrome_frame/test/proxy_factory_mock.cc +++ b/chrome_frame/test/proxy_factory_mock.cc @@ -40,7 +40,7 @@ ChromeFrameLaunchParams* ProxyFactoryTest::MakeLaunchParams( ChromeFrameLaunchParams* params = new ChromeFrameLaunchParams(empty, empty, profile_path, profile_path.BaseName().value(), L"", false, - false, false, false); + false, false); params->set_launch_timeout(0); params->set_version_check(false); return params; diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc index 55e21cc..f9b7335 100644 --- a/chrome_frame/test/run_all_unittests.cc +++ b/chrome_frame/test/run_all_unittests.cc @@ -5,7 +5,6 @@ #include <atlbase.h> #include "base/command_line.h" -#include "base/metrics/field_trial.h" #include "base/process_util.h" #include "base/test/test_suite.h" #include "base/threading/platform_thread.h" @@ -55,10 +54,6 @@ int main(int argc, char **argv) { _set_purecall_handler(PureCall); - // Set up a FieldTrialList to keep any field trials we have going in - // Chrome Frame happy. - base::FieldTrialList field_trial_list(new metrics::SHA1EntropyProvider("42")); - base::TestSuite test_suite(argc, argv); SetConfigBool(kChromeFrameHeadlessMode, true); |