Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit c5fd179

Browse files
danbeamCommit bot
authored and
Commit bot
committed
Revert of Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM (patchset #8 id:150001 of https://codereview.chromium.org/561943002/)
Reason for revert: this CL might be breaking browser_tests and interactive_ui_tests on ChromeOS because it's starting a request on startup. here's an example: [15345:15369:0918/132152:ERROR:leak_tracker.h(97)] Leaked 0x11cd70da7cc0 which was allocated by: [15345:15369:0918/132152:ERROR:leak_tracker.h(98)] #0 0x7f44b584025e base::debug::StackTrace::StackTrace() #1 0x000000dfc481 base::debug::LeakTracker<>::LeakTracker() #2 0x000000df3e8d SystemURLRequestContextGetter::SystemURLRequestContextGetter() #3 0x000000df57f1 IOThread::InitSystemRequestContext() #4 0x000000df570b IOThread::system_url_request_context_getter() #5 0x000001443d9e BrowserProcessImpl::system_request_context() #6 0x000001028a8e SafeBrowsingService::Initialize() #7 0x0000014462c9 BrowserProcessImpl::CreateSafeBrowsingService() #8 0x000001446196 BrowserProcessImpl::safe_browsing_service() #9 0x0000014b9a06 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate() #10 0x0000014466dc BrowserProcessImpl::ResourceDispatcherHostCreated() #11 0x0000008a88e5 chrome::ChromeContentBrowserClient::ResourceDispatcherHostCreated() #12 0x7f44be489a2f content::ResourceDispatcherHostImpl::ResourceDispatcherHostImpl() #13 0x7f44be060f44 content::BrowserMainLoop::BrowserThreadsStarted() #14 0x7f44be068302 base::internal::RunnableAdapter<>::Run() #15 0x7f44be06826c base::internal::InvokeHelper<>::MakeItSo() #16 0x7f44be06821a base::internal::Invoker<>::Run() #17 0x7f44be54e46e base::Callback<>::Run() #18 0x7f44be8d223b content::StartupTaskRunner::RunAllTasksNow() #19 0x7f44be05ff97 content::BrowserMainLoop::CreateStartupTasks() #20 0x7f44be06b824 content::BrowserMainRunnerImpl::Initialize() #21 0x7f44be05c7df content::BrowserMain() #22 0x7f44bdee5f6f content::RunNamedProcessTypeMain() #23 0x7f44bdee9268 content::ContentMainRunnerImpl::Run() #24 0x7f44bdee5505 content::ContentMain() #25 0x0000041aa8cb content::BrowserTestBase::SetUp() #26 0x00000173e117 InProcessBrowserTest::SetUp() #27 0x000000671180 ExtensionBrowserTest::SetUp() #28 0x0000006711b2 ExtensionBrowserTest::SetUp() #29 0x0000017fb993 testing::internal::HandleSehExceptionsInMethodIfSupported<>() #30 0x0000017e8bfe testing::internal::HandleExceptionsInMethodIfSupported<>() #31 0x0000017dd1e3 testing::Test::Run() #32 0x0000017dd92b testing::TestInfo::Run() #33 0x0000017ddf1a testing::TestCase::Run() #34 0x0000017e3413 testing::internal::UnitTestImpl::RunAllTests() #35 0x0000017f47d3 testing::internal::HandleSehExceptionsInMethodIfSupported<>() #36 0x0000017ea96e testing::internal::HandleExceptionsInMethodIfSupported<>() #37 0x0000017e30b1 testing::UnitTest::Run() #38 0x000004187e41 RUN_ALL_TESTS() #39 0x000004186e67 base::TestSuite::Run() #40 0x0000007fcd62 InteractiveUITestSuiteRunner::RunTestSuite() #41 0x00000173c7b8 (anonymous namespace)::ChromeTestLauncherDelegate::RunTestSuite() #42 0x0000041bc2fb content::LaunchTests() #43 0x00000173c6e9 LaunchChromeTests() #44 0x0000007fccbf main #45 0x7f44ad8ed76d __libc_start_main #46 0x000000601389 <unknown> [15345:15369:0918/132152:FATAL:leak_tracker.h(102)] Check failed: 0u == count (0 vs. 1) #0 0x7f44b584025e base::debug::StackTrace::StackTrace() #1 0x7f44b58d7a62 logging::LogMessage::~LogMessage() #2 0x000000dfdd01 base::debug::LeakTracker<>::CheckForLeaks() #3 0x000000df8e13 IOThread::CleanUp() #4 0x7f44be0810b6 content::BrowserThreadImpl::CleanUp() #5 0x7f44be07e852 content::BrowserProcessSubThread::CleanUp() #6 0x7f44b59d0601 base::Thread::ThreadMain() #7 0x7f44b59bba3c base::(anonymous namespace)::ThreadFunc() #8 0x7f44b1aa9e9a start_thread #9 0x7f44ad9c03fd clone Original issue's description: > Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM > > BUG=384041 > TEST=new tests added > > Committed: https://crrev.com/3c23f4a188e171998f3042ad62f4aa5717e66d63 > Cr-Commit-Position: refs/heads/master@{#295524} [email protected],[email protected],[email protected],[email protected],[email protected] NOTREECHECKS=true NOTRY=true BUG=384041 Review URL: https://codereview.chromium.org/582913003 Cr-Commit-Position: refs/heads/master@{#295549}
1 parent aeae967 commit c5fd179

16 files changed

+21
-600
lines changed

chrome/browser/browser_process_impl.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,6 @@ void BrowserProcessImpl::CreateGCMDriver() {
11351135
CHECK(PathService::Get(chrome::DIR_GLOBAL_GCM_STORE, &store_path));
11361136
gcm_driver_ = gcm::CreateGCMDriverDesktop(
11371137
make_scoped_ptr(new gcm::GCMClientFactory),
1138-
local_state(),
11391138
store_path,
11401139
system_request_context());
11411140
// Sign-in is not required for device-level GCM usage. So we just call

chrome/browser/prefs/browser_prefs.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
#include "components/autofill/core/browser/autofill_manager.h"
8383
#include "components/bookmarks/browser/bookmark_utils.h"
8484
#include "components/dom_distiller/core/distilled_page_prefs.h"
85-
#include "components/gcm_driver/gcm_channel_status_syncer.h"
8685
#include "components/google/core/browser/google_pref_names.h"
8786
#include "components/google/core/browser/google_url_tracker.h"
8887
#include "components/network_time/network_time_tracker.h"
@@ -294,8 +293,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
294293
AutomaticProfileResetterFactory::RegisterPrefs(registry);
295294
BackgroundModeManager::RegisterPrefs(registry);
296295
RegisterBrowserPrefs(registry);
297-
// The native GCM is used on Android instead.
298-
gcm::GCMChannelStatusSyncer::RegisterPrefs(registry);
299296
#if !defined(OS_CHROMEOS)
300297
RegisterDefaultBrowserPromptPrefs(registry);
301298
#endif // !defined(OS_CHROMEOS)
@@ -446,7 +443,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
446443
extensions::ExtensionSettingsHandler::RegisterProfilePrefs(registry);
447444
extensions::TabsCaptureVisibleTabFunction::RegisterProfilePrefs(registry);
448445
first_run::RegisterProfilePrefs(registry);
449-
gcm::GCMChannelStatusSyncer::RegisterProfilePrefs(registry);
450446
NewTabUI::RegisterProfilePrefs(registry);
451447
PepperFlashSettingsManager::RegisterProfilePrefs(registry);
452448
PinnedTabCodec::RegisterProfilePrefs(registry);

chrome/browser/services/gcm/gcm_desktop_utils.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ GCMClient::ChromeBuildInfo GetChromeBuildInfo() {
7373

7474
scoped_ptr<GCMDriver> CreateGCMDriverDesktop(
7575
scoped_ptr<GCMClientFactory> gcm_client_factory,
76-
PrefService* prefs,
7776
const base::FilePath& store_path,
7877
const scoped_refptr<net::URLRequestContextGetter>& request_context) {
7978
scoped_refptr<base::SequencedWorkerPool> worker_pool(
@@ -85,7 +84,6 @@ scoped_ptr<GCMDriver> CreateGCMDriverDesktop(
8584
return scoped_ptr<GCMDriver>(new GCMDriverDesktop(
8685
gcm_client_factory.Pass(),
8786
GetChromeBuildInfo(),
88-
prefs,
8987
store_path,
9088
request_context,
9189
content::BrowserThread::GetMessageLoopProxyForThread(

chrome/browser/services/gcm/gcm_desktop_utils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "base/memory/ref_counted.h"
99
#include "base/memory/scoped_ptr.h"
1010

11-
class PrefService;
1211
namespace base {
1312
class FilePath;
1413
}
@@ -24,7 +23,6 @@ class GCMClientFactory;
2423

2524
scoped_ptr<GCMDriver> CreateGCMDriverDesktop(
2625
scoped_ptr<GCMClientFactory> gcm_client_factory,
27-
PrefService* prefs,
2826
const base::FilePath& store_path,
2927
const scoped_refptr<net::URLRequestContextGetter>& request_context);
3028

chrome/browser/services/gcm/gcm_profile_service.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ GCMProfileService::GCMProfileService(
169169

170170
driver_ = CreateGCMDriverDesktop(
171171
gcm_client_factory.Pass(),
172-
profile_->GetPrefs(),
173172
profile_->GetPath().Append(chrome::kGCMStoreDirname),
174173
profile_->GetRequestContext());
175174

components/gcm_driver.gypi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
'gcm_driver/gcm_backoff_policy.h',
3434
'gcm_driver/gcm_channel_status_request.cc',
3535
'gcm_driver/gcm_channel_status_request.h',
36-
'gcm_driver/gcm_channel_status_syncer.cc',
37-
'gcm_driver/gcm_channel_status_syncer.h',
3836
'gcm_driver/gcm_client.cc',
3937
'gcm_driver/gcm_client.h',
4038
'gcm_driver/gcm_client_factory.cc',
@@ -75,8 +73,6 @@
7573
'gcm_driver/gcm_account_mapper.h',
7674
'gcm_driver/gcm_channel_status_request.cc',
7775
'gcm_driver/gcm_channel_status_request.h',
78-
'gcm_driver/gcm_channel_status_syncer.cc',
79-
'gcm_driver/gcm_channel_status_syncer.h',
8076
'gcm_driver/gcm_client_factory.cc',
8177
'gcm_driver/gcm_client_factory.h',
8278
'gcm_driver/gcm_client_impl.cc',

components/gcm_driver/BUILD.gn

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ static_library("gcm_driver") {
1717
"gcm_backoff_policy.h",
1818
"gcm_channel_status_request.cc",
1919
"gcm_channel_status_request.h",
20-
"gcm_channel_status_syncer.cc",
21-
"gcm_channel_status_syncer.h",
2220
"gcm_client.cc",
2321
"gcm_client.h",
2422
"gcm_client_factory.cc",
@@ -53,8 +51,6 @@ static_library("gcm_driver") {
5351
sources -= [
5452
"gcm_channel_status_request.cc",
5553
"gcm_channel_status_request.h",
56-
"gcm_channel_status_syncer.cc",
57-
"gcm_channel_status_syncer.h",
5854
"gcm_client_factory.cc",
5955
"gcm_client_factory.h",
6056
"gcm_client_impl.cc",

components/gcm_driver/DEPS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include_rules = [
22
"+components/os_crypt",
3-
"+components/pref_registry",
43
# TODO(johnme): Fix this layering violation.
54
"!content/public/android/java",
65
"+google_apis/gaia",

components/gcm_driver/gcm_channel_status_request.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ GCMChannelStatusRequest::~GCMChannelStatusRequest() {
4141
}
4242

4343
// static
44-
int GCMChannelStatusRequest::default_poll_interval_seconds() {
44+
int GCMChannelStatusRequest::default_poll_interval_seconds_for_testing() {
4545
return kDefaultPollIntervalSeconds;
4646
}
4747

4848
// static
49-
int GCMChannelStatusRequest::min_poll_interval_seconds() {
49+
int GCMChannelStatusRequest::min_poll_interval_seconds_for_testing() {
5050
return kMinPollIntervalSeconds;
5151
}
5252

components/gcm_driver/gcm_channel_status_request.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class GCMChannelStatusRequest : public net::URLFetcherDelegate {
3636

3737
void Start();
3838

39-
static int default_poll_interval_seconds();
40-
static int min_poll_interval_seconds();
39+
// Exposed for testing purpose.
40+
static int default_poll_interval_seconds_for_testing();
41+
static int min_poll_interval_seconds_for_testing();
4142

4243
private:
4344
// Overridden from URLFetcherDelegate:

components/gcm_driver/gcm_channel_status_request_unittest.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ TEST_F(GCMChannelStatusRequestTest, ResponseWithDisabledStatus) {
136136
EXPECT_TRUE(request_callback_invoked_);
137137
EXPECT_FALSE(enabled_);
138138
EXPECT_EQ(
139-
GCMChannelStatusRequest::default_poll_interval_seconds(),
139+
GCMChannelStatusRequest::default_poll_interval_seconds_for_testing(),
140140
poll_interval_seconds_);
141141
}
142142

@@ -148,15 +148,16 @@ TEST_F(GCMChannelStatusRequestTest, ResponseWithEnabledStatus) {
148148
EXPECT_TRUE(request_callback_invoked_);
149149
EXPECT_TRUE(enabled_);
150150
EXPECT_EQ(
151-
GCMChannelStatusRequest::default_poll_interval_seconds(),
151+
GCMChannelStatusRequest::default_poll_interval_seconds_for_testing(),
152152
poll_interval_seconds_);
153153
}
154154

155155
TEST_F(GCMChannelStatusRequestTest, ResponseWithPollInterval) {
156156
// Setting a poll interval 15 minutes longer than the minimum interval we
157157
// enforce.
158158
int poll_interval_seconds =
159-
GCMChannelStatusRequest::min_poll_interval_seconds() + 15 * 60;
159+
GCMChannelStatusRequest::min_poll_interval_seconds_for_testing() +
160+
15 * 60;
160161
StartRequest();
161162
SetResponseProtoData(NOT_SPECIFIED, poll_interval_seconds);
162163
CompleteFetch();
@@ -170,20 +171,22 @@ TEST_F(GCMChannelStatusRequestTest, ResponseWithShortPollInterval) {
170171
// Setting a poll interval 15 minutes shorter than the minimum interval we
171172
// enforce.
172173
int poll_interval_seconds =
173-
GCMChannelStatusRequest::min_poll_interval_seconds() - 15 * 60;
174+
GCMChannelStatusRequest::min_poll_interval_seconds_for_testing() -
175+
15 * 60;
174176
StartRequest();
175177
SetResponseProtoData(NOT_SPECIFIED, poll_interval_seconds);
176178
CompleteFetch();
177179

178180
EXPECT_TRUE(request_callback_invoked_);
179181
EXPECT_TRUE(enabled_);
180-
EXPECT_EQ(GCMChannelStatusRequest::min_poll_interval_seconds(),
182+
EXPECT_EQ(GCMChannelStatusRequest::min_poll_interval_seconds_for_testing(),
181183
poll_interval_seconds_);
182184
}
183185

184186
TEST_F(GCMChannelStatusRequestTest, ResponseWithDisabledStatusAndPollInterval) {
185187
int poll_interval_seconds =
186-
GCMChannelStatusRequest::min_poll_interval_seconds() + 15 * 60;
188+
GCMChannelStatusRequest::min_poll_interval_seconds_for_testing() +
189+
15 * 60;
187190
StartRequest();
188191
SetResponseProtoData(GCM_DISABLED, poll_interval_seconds);
189192
CompleteFetch();

components/gcm_driver/gcm_channel_status_syncer.cc

Lines changed: 0 additions & 183 deletions
This file was deleted.

0 commit comments

Comments
 (0)