summaryrefslogtreecommitdiffstats
path: root/google_apis/gcm/engine
Commit message (Collapse)AuthorAgeFilesLines
* Adding handling of heartbeat intervals to the GCM store.fgorski2015-05-044-1/+182
| | | | | | | | | | | | | | | Adding methods to GCMStore, GCMStoreImpl and ::Backend: * AddHeartbeatInterval, RemoveHeartbeatInterval, for managing persistence, as well as * LoadHeartbeatIntervals to load intervals at startup Adding tests for the above. BUG=481174 Review URL: https://codereview.chromium.org/1121003003 Cr-Commit-Position: refs/heads/master@{#328191}
* Remove outdated instrumentation and move a few remaining bits around.pkasting2015-05-021-1/+1
| | | | | | | | | | BUG=424359,455469,455884,457528,483686,483689 TEST=none TBR=mattm,erikwright,zea Review URL: https://codereview.chromium.org/1119163004 Cr-Commit-Position: refs/heads/master@{#328038}
* [GCM] Adding custom heartbeat interval to MCS Clientfgorski2015-05-019-32/+386
| | | | | | | | | | | | | | | | | In this patch: * Heartbeat manager is extended to expose max and min custom heartbeat, based on the current network connection, as well as calculate HB to use including client request * MCS Client adds methods to specify a heartbeat as well as revoke it, calculates the current minimal interval and if necessary, resets the connection to use it. BUG=481174 R=zea@chromium.org Review URL: https://codereview.chromium.org/1101333002 Cr-Commit-Position: refs/heads/master@{#327962}
* Adjust URLFetcher::Create API so that object is returned as scoped_ptr.dtapuska2015-05-013-6/+6
| | | | | | | | | | | | | | | | | | | | Most interfaces were storing the object in a scoped_ptr already. This adjusts the API so that it is a little clearer of the ownership transfer. A number of clients put the URLFetcher in a table and do memory management on it themselves; this is likely templatable code for a future CL. The scope of this CL was to change the API but no control flow changes. Making this change found one memory leak; (http://crbug.com/482459) has been addressed separately. BUG=371201 TESTS=net_unittests google_api_unittests TBR=jochen@chromium.org, thakis@chromium.org, oshima@chromium.org, armansito@chromium.org, reillyg@chromium.org, rogerta@chromium.org, stuartmorgan@chromium.org, wez@chromium.org, pavely@chromium.org, rouslan@chromium.org Review URL: https://codereview.chromium.org/1117703002 Cr-Commit-Position: refs/heads/master@{#327901}
* Refactor net::BackoffEntry to not require subclassingjohnme2015-04-201-23/+2
| | | | | | | | | | | | | | | | | | | | | | | | Before this patch, net::BackoffEntry had a virtual ImplGetTimeNow method that tests etc would override to change what time is considered "now". As suggested by rsleevi in https://codereview.chromium.org/1023473003, this patch removes that method, and instead makes net::BackoffEntry accept a base::TickClock in the constructor, to allow overriding the time without subclassing. (this will allow future changes to net::BackoffEntry without the fragile base class problem) Accordingly, I've removed all subclasses of BackoffEntry, and made them pass TickClocks instead; in most cases this has been a nice simplification. BUG=465399 TBR=stevenjb@chromium.org Review URL: https://codereview.chromium.org/1076853003 Cr-Commit-Position: refs/heads/master@{#325865}
* Add instrumentation for various functions janky on the Mac IO thread.pkasting2015-04-151-0/+5
| | | | | | | | | | | | Ultimately these will be split into more fine-grained bugs. BUG=477117 TEST=none TBR=darin,blundell,rogerta,cbentzel Review URL: https://codereview.chromium.org/1082383003 Cr-Commit-Position: refs/heads/master@{#325189}
* Update instrumentation for various functions janky on the Mac IO thread.pkasting2015-04-141-0/+5
| | | | | | | | | | BUG=455469,458404,457528,457525,455884,454983 TEST=none TBR=zea,mmenke,jochen Review URL: https://codereview.chromium.org/1062683005 Cr-Commit-Position: refs/heads/master@{#324995}
* leveldb: Reuse manifest (AKA logs) during open.cmumford2015-03-261-0/+2
| | | | | | | | | | | | | | | | All leveldb uses now set the reuse_logs option to trigger a new fast open path. For db's with prior changes (i.e. non-empty logs) this avoids three fsync calls (on average) for every open as well as the need to compact (rewrite) the db. More info at: https://github.com/google/leveldb/commit/251ebf5dc70129ad3c38193fe6c99a5b0ec6b9fa BUG=468810 Review URL: https://codereview.chromium.org/1025433003 Cr-Commit-Position: refs/heads/master@{#322433}
* Use base::PowerObserver to check for missed heartbeatschirantan2015-03-093-9/+37
| | | | | | | | | | | | | | base::PowerObserver provides a platform-agnostic way to be notified about system suspend and resume events. Use it to check for missed heartbeats instead of polling. Unfortunately we still need to poll on linux because there is no common system-wide notification about suspend and resume events. BUG=421725 Review URL: https://codereview.chromium.org/989803002 Cr-Commit-Position: refs/heads/master@{#319730}
* [GCM] Fix crash during connection raceszea2015-03-054-7/+56
| | | | | | | | | | | | If a connection attempt is triggered while a connection is open, but not active (for example due to a socket error), make sure the old connection is closed before reattempting to connect. BUG=462319 Review URL: https://codereview.chromium.org/980433003 Cr-Commit-Position: refs/heads/master@{#319201}
* [GCM] Fixing the problem of passing linked_ptr across threadsfgorski2015-02-271-5/+5
| | | | | | | | | BUG=461936 R=zea@chromium.org Review URL: https://codereview.chromium.org/958133004 Cr-Commit-Position: refs/heads/master@{#318368}
* Update instrumentation for many different bugs based on new UMA data.pkasting2015-02-211-5/+0
| | | | | | | | | | BUG=373841,455423,455434,455469,455884,455942,455952,456331,456373,457517,457525,457528 TEST=none TBR=jochen,mmenke,zea Review URL: https://codereview.chromium.org/946133002 Cr-Commit-Position: refs/heads/master@{#317501}
* Reset the GCM store to recover from it when it is bustedjianli2015-02-101-23/+59
| | | | | | | | | | | Also update the UMA to include details BUG=435387 TEST=new test added Review URL: https://codereview.chromium.org/910093003 Cr-Commit-Position: refs/heads/master@{#315673}
* Adding instrumentation to locate the source of jankiness.pkasting2015-02-061-0/+5
| | | | | | | | | | | | | | | | | | Mechanical change that adds instrumentation required to locate the source of jankiness (i.e. a long-running fragment of code executed as a part of the task that causes jank) in the code. See the bug for details on what kind of jank we are after. A number of similar CLs were landed, and none of them caused issues. The code of the instrumentation is highly optimized and is not expected to affect performance. The code simply creates a diagnostic task which is identical to ones created by PostTask or IPC message handlers. BUG=455884,455942,455952 TEST=none TBR=mmenke,michaeln,zea Review URL: https://codereview.chromium.org/900793009 Cr-Commit-Position: refs/heads/master@{#314970}
* [GCM] Fixing the initialization of last checkin/fetch time if they arefgorski2015-01-303-8/+81
| | | | | | | | | | | corrupted/missing in GCM store BUG=453018 R=zea@chromium.org,miu@chromium.org Review URL: https://codereview.chromium.org/884783003 Cr-Commit-Position: refs/heads/master@{#313838}
* Standardize usage of virtual/override/final specifiers in google_apis/.dcheng2014-12-239-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. Several formatting edits by clang-format were manually reverted, due to mangling of some of the more complicate IPC macros. BUG=417463 TBR=rogerta@chromoium.org Review URL: https://codereview.chromium.org/802413003 Cr-Commit-Position: refs/heads/master@{#309513}
* Increase HeartbeatManagerTest.UpdateTimerAfterStart test max time check tozhaoqin2014-12-151-1/+1
| | | | | | | | | | | make it less flaky on memory.fyi bots. BUG=441291 R=chirantan@chromium.org Review URL: https://codereview.chromium.org/794303002 Cr-Commit-Position: refs/heads/master@{#308434}
* [GCM] Fix gcm network change handling before connectzea2014-12-114-15/+45
| | | | | | | | | | | | We were listening to network events and trying to reconnect before even being told to do the first connection. Until Connect() has been called, SignalConnectionReset should have no effect. BUG=440455 Review URL: https://codereview.chromium.org/793883003 Cr-Commit-Position: refs/heads/master@{#307965}
* Link GCM heartbeat with wake on wifi preferencechirantan2014-12-066-14/+54
| | | | | | | | | | | | | | | | | | | | | | Currently, the GCM heartbeat manager schedules a timer that will always wake up the system from suspend in order to send a heartbeat message. This is bad for battery life if the user doesn't actually want to use the wake on packet feature. To deal with this problem: - Add a new function, SetWakeFromSuspend, to the AlarmTimer class so that its wake from suspend ability can be changed on the fly. - Drill a hole through GCM's beautiful abstraction layers so that we can get to the HeartbeatManager via the GCMDriver interface. - Hook up the endpoint in the GCMDriver interface to WakeOnWifiManager::OnPreferenceChanged so that the wake from suspend property for all the GCM heartbeat timers is changed along with shill's settings. BUG=397328, chrome-os-partner:34142 Review URL: https://codereview.chromium.org/745123002 Cr-Commit-Position: refs/heads/master@{#307151}
* [GCM] Fixing loading from GCM store after signing out of a profilefgorski2014-11-212-9/+17
| | | | | | | | | | | | | | | | | | | The problem was with how we write and then update the mapping with status removing: * first write happens immediately, without a message ID * second write after we successfully send a message (that one includes a message ID). If GCM is turned off or Chrome gets shut down after the first message, we will not be able to later turn it back on, because reading of the mapping will fail. R=jianli@chromium.org,zea@chromium.org BUG=435401 Review URL: https://codereview.chromium.org/747113002 Cr-Commit-Position: refs/heads/master@{#305300}
* Revert of Fixing all of problems found by vc++ /analyze in GCM code ↵matthewyuan2014-11-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #1 id:1 of https://codereview.chromium.org/713573003/) Reason for revert: Reverting since it's causing a crash on canary. Original issue's description: > Fixing all of problems found by vc++ /analyze in GCM code > > There was only a minor (harmless) case of variable shadowing. > > BUG=427616 > R=zea@chromium.org > > Committed: https://crrev.com/3e021981ccc2be8de7443ff1a18439551b22ea75 > Cr-Commit-Position: refs/heads/master@{#303338} TBR=zea@chromium.org,brucedawson@chromium.org,fgorski@chromium.org NOTREECHECKS=true NOTRY=true BUG=427616 Review URL: https://codereview.chromium.org/712793003 Cr-Commit-Position: refs/heads/master@{#303396}
* Fixing all of problems found by vc++ /analyze in GCM codefgorski2014-11-081-5/+5
| | | | | | | | | | | There was only a minor (harmless) case of variable shadowing. BUG=427616 R=zea@chromium.org Review URL: https://codereview.chromium.org/713573003 Cr-Commit-Position: refs/heads/master@{#303338}
* [GCM] Make heartbeat manager partially resistant to missed heartbeatszea2014-10-283-0/+73
| | | | | | | | | | | | | | | | | | | Chrome does not account for time the machine spends in suspend mode when handling most timers and delayed tasks. As such, a heartbeat with a 15 minute timer might actually run after X + 15 minutes, where X is the time spent in suspend mode (for example when the laptop is in low power mode). This patch attempts to mitigate that by polling every 5 minutes to see if the heartbeat has been missed. 5 minutes is chosen as a conservative number. We have UMA histograms to track how much the heartbeat was missed by, and if 5 minutes is too conservative the delta's will be high, and we can adjust the time. BUG=421725 Review URL: https://codereview.chromium.org/653283010 Cr-Commit-Position: refs/heads/master@{#301724}
* [GCM] Adding last token fetching time handlingfgorski2014-10-285-1/+89
| | | | | | | | | | | | Adding SetLastTokenFetchingTime to GCMStore Adding Get/SetLastTokenFetchingTime to GCMDriver Propagating the last token fetching time up and down the GCM stack BUG=374969 Review URL: https://codereview.chromium.org/681453004 Cr-Commit-Position: refs/heads/master@{#301545}
* components: Introduce AlarmTimer class and use it for GCM heartbeatchirantan2014-10-246-15/+37
| | | | | | | | | | | | | | This adds the AlarmTimer class to components, which is capable of waking up the system from suspend on platforms that support this operation (currently only Chrome OS with linux version 3.11 or higher). On all other platforms, the AlarmTimer behaves exactly the same as a regular Timer. BUG=crosbug.com/p/32272 Review URL: https://codereview.chromium.org/641943002 Cr-Commit-Position: refs/heads/master@{#301175}
* [GCM] Fix crash when size packet splits two socket readszea2014-10-212-11/+123
| | | | | | | | | | | | | | ByteCount(), rather than UnreadByteCount(), was being incorrectly used to determine how to handle a size packet than needed a second byte. ByteCount() includes read bytes, while UnreadByteCount() is the one that does not. UnreadByteCount is the only one that should be used here. Fixed, and added new tests. BUG=424532 Review URL: https://codereview.chromium.org/643133003 Cr-Commit-Position: refs/heads/master@{#300525}
* Standardize usage of virtual/override/final in google_apis/dcheng2014-10-2110-92/+88
| | | | | | | | | | | | This patch was automatically generated by applying clang fixit hints generated by the plugin to the source tree. BUG=417463 TBR=rogerta@chromium.org Review URL: https://codereview.chromium.org/649283003 Cr-Commit-Position: refs/heads/master@{#300495}
* Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>.dcheng2014-10-154-48/+18
| | | | | | | | BUG=423621 Review URL: https://codereview.chromium.org/653323003 Cr-Commit-Position: refs/heads/master@{#299727}
* replace OVERRIDE and FINAL with override and final in google_apis/mostynb2014-10-0710-55/+55
| | | | | | | | | R=rogerta@chromium.org,dcheng@chromium.org BUG=417463 Review URL: https://codereview.chromium.org/625293003 Cr-Commit-Position: refs/heads/master@{#298418}
* [GCM] Investigatory CHECKs for crash in parsing streamzea2014-09-251-3/+3
| | | | | | | | | | | | | The various places where size_t and uint64 were being used have been converted to int, so that we can better check to make sure they're non-negative (they're actually consumed as ints by the protobuf parsing code). Various CHECKS have therefore been added to verify assumptions. BUG=409985 Review URL: https://codereview.chromium.org/600223003 Cr-Commit-Position: refs/heads/master@{#296741}
* Loading the account mappings from store to the driver.fgorski2014-09-243-28/+25
| | | | | | | | | | | | This is to make sure the starting list of account mapping properly reflects the mappings present in the previous Chrome session. BUG=374969 Review URL: https://codereview.chromium.org/600053002 Cr-Commit-Position: refs/heads/master@{#296567}
* Change base/file_utils.h includes to base/files/file_utils.h in gin, ↵thestig2014-09-051-1/+1
| | | | | | | | | | google_apis, printing, sql, ui, and webkit. TBR=jochen@chromium.org,rogerta@chromium.org,shess@chromium.org,ben@chromium.org,jamesr@chromium.org Review URL: https://codereview.chromium.org/529273002 Cr-Commit-Position: refs/heads/master@{#293479}
* [GCM] Adding GCMAccountMapper to link signed in profile to accounts.fgorski2014-09-044-114/+117
| | | | | | | | | | * Addes GCMAccountMapper with tests for adding and removing accoounts. BUG=374969 Review URL: https://codereview.chromium.org/491443004 Cr-Commit-Position: refs/heads/master@{#293308}
* Remove implicit conversions from scoped_refptr to T* in google_apis/Daniel Cheng2014-08-263-4/+4
| | | | | | | | | | | | This patch was generated by running the rewrite_scoped_refptr clang tool on a Linux build. BUG=110610 R=rogerta@chromium.org Review URL: https://codereview.chromium.org/498123003 Cr-Commit-Position: refs/heads/master@{#291821}
* Spelling fixes for 'device' and 'service'.tnagel@chromium.org2014-08-211-3/+3
| | | | | | | | | | TBR=gavinp BUG=none Review URL: https://codereview.chromium.org/469763003 Cr-Commit-Position: refs/heads/master@{#291046} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291046 0039d316-1c4b-4281-b951-d872f2087c98
* Keep track of network error in ProxyRetryInfo.kundaji@chromium.org2014-08-151-1/+1
| | | | | | | | | | | | Use it to log error type in BypassOneNetworkError UMA. This fixes DataReductionProxy.BypassOnNetworkError UMA recording bug. BUG=395769 Review URL: https://codereview.chromium.org/473513002 Cr-Commit-Position: refs/heads/master@{#290054} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290054 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Fixing a bug with old registration ID not being removedfgorski@chromium.org2014-08-152-1/+21
| | | | | | | | | | | | We are suffering from behavior where old registration ID is not really removed from gcm store when unregistered. BUG=384431 Review URL: https://codereview.chromium.org/475813003 Cr-Commit-Position: refs/heads/master@{#289860} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289860 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringToLowerASCII to base namespacebrettw@chromium.org2014-08-071-1/+1
| | | | | | | | TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Adding status to AccountMapping structurefgorski@chromium.org2014-08-0711-328/+395
| | | | | | | | | | | | | | * Renaming AccountInfo to AccountMapping. * Adding status and timestamp of it's last change * Removing last message timestamp, as with introduction of message ack event, it is no longer needed BUG=374969 R=zea@chromium.org Review URL: https://codereview.chromium.org/443573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287919 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Adding the OnSendAcknowledgement eventfgorski@chromium.org2014-08-061-0/+12
| | | | | | | | | | | | Adding the OnSendAcknowledgement event to enable Chrome components to get updates on GCM server receiving the messages. BUG=374969 TBR=kalman@chromium.org Review URL: https://codereview.chromium.org/442123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287831 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Persistence of account mappings.fgorski@chromium.org2014-08-045-17/+217
| | | | | | | | | | | | | | | * Adding ability to add, remove and load account info to device mappings in GCMStore with Tests. * Moving the code resetting load results to LoadResult structure (fixed a bug where last_checkin_accounts where not cleared upon failure to load) R=zea@chromium.org BUG=374969 Review URL: https://codereview.chromium.org/429073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287391 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Adding AccountInfo structure to persist accounts mapped to GCMfgorski@chromium.org2014-07-303-0/+267
| | | | | | | | | R=zea@chromium.org BUG=374969 Review URL: https://codereview.chromium.org/423583004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286420 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Ignore network status when reconnecting againzea@chromium.org2014-07-302-5/+7
| | | | | | | | | | | | | It appears the network change notifications may not be enough to suppress connection attemtps. Clients are getting stuck waiting for a notification, despite being online. Ignore the network status for now until a better solution can be created (this brings things back to their old behavior). BUG=396687 Review URL: https://codereview.chromium.org/427113002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286402 0039d316-1c4b-4281-b951-d872f2087c98
* Leverage profile's http network session HttpAuthCache to support proxy auth.zea@chromium.org2014-07-183-14/+41
| | | | | | | | | | | | | | This allows the connect job to leverage any auth cache credentials the profile has, including those the user gets prompted for as part of loading a page while behind an authenticated proxy. GCM continues to use its own network session for creating the connections, but at connection time the HttpAuthCache is coped over from the profile's http network session (if available). BUG=385748 Review URL: https://codereview.chromium.org/375663002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283973 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Removing cookies from checkin and registration requestsfgorski@chromium.org2014-07-172-0/+6
| | | | | | | | | BUG=394627 R=zea@chromium.org Review URL: https://codereview.chromium.org/395413002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283833 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Add a SelectiveAck test for midstream ackszea@chromium.org2014-07-172-1/+82
| | | | | | | | | | | SelectiveAck was over confirming due to unsigned in misuse. This adds a test that exercises the confirm logic used by SelectiveAck. BUG=392664 Review URL: https://codereview.chromium.org/383993006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283729 0039d316-1c4b-4281-b951-d872f2087c98
* Adding a step to the check-in process that ensures the correct account ↵fgorski@chromium.org2014-07-177-26/+91
| | | | | | | | | | | | | | | | | | | | | information is present before device check-in happen, in order to maintain a relationship between signed in accounts and the device. Behavior of the check-in is not symmetric: * Adding an account converges slowly - newly added account will be associated to device with next periodic check, to avoid checking in too often. * Removing account triggers check-in immediately to ensure users privacy. BUG=374969 Review URL: https://codereview.chromium.org/378643002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283693 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Close the socket on connection factory shutdownzea@chromium.org2014-07-111-0/+1
| | | | | | | | | | | | We don't want to attempt to reuse a socket across shutdowns, and given socket pools any open socket can be reused. Make sure to close the socket on shutdown BUG=392546 Review URL: https://codereview.chromium.org/381273003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282551 0039d316-1c4b-4281-b951-d872f2087c98
* Add Finch experiment for selectively bypassing proxies.rcs@chromium.org2014-07-091-1/+5
| | | | | | | | | | | | | | | Add option to bypass the data compression proxy if the request resource type (as inferred by the renderer process) is not an image. For background, see this design doc: https://docs.google.com/a/google.com/document/d/1Kz92Fmw3lv_R-2aNvLp8jW9lkfKOZciTZtni2qQ_Adc/edit BUG=391836 Review URL: https://codereview.chromium.org/332313003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281951 0039d316-1c4b-4281-b951-d872f2087c98
* [GCM] Suppress connection attempts when there is no valid connection.zea@chromium.org2014-06-203-48/+59
| | | | | | | | | | | | If the local machine's network is unavailable, there's no poin in attempting to make connections. This change simplifies the connection listening logic and drops connection attempts while it is known that the network is unavailable. BUG=376556 Review URL: https://codereview.chromium.org/336473003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278662 0039d316-1c4b-4281-b951-d872f2087c98