[GCM] Fixing loading from GCM store after signing out of a profile
commitd5a5ed9c6b2d1ba262902ffde72462d3ca0001a3
authorfgorski <fgorski@chromium.org>
Fri, 21 Nov 2014 22:14:40 +0000 (21 14:14 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 21 Nov 2014 22:15:32 +0000 (21 22:15 +0000)
tree6e0f7f6e33e72e82a08bf7e2c5291d3b71a939f6
parent86b3a6e09c9c9dcf5b9319a589cdcdad0a029550
[GCM] Fixing loading from GCM store after signing out of a profile

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}
google_apis/gcm/engine/account_mapping.cc
google_apis/gcm/engine/account_mapping_unittest.cc