| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_sync_data.h" | 5 #include "chrome/browser/extensions/extension_sync_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 bool ExtensionSyncData::PopulateFromExtensionSpecifics( | 230 bool ExtensionSyncData::PopulateFromExtensionSpecifics( |
| 231 const sync_pb::ExtensionSpecifics& specifics) { | 231 const sync_pb::ExtensionSpecifics& specifics) { |
| 232 if (!crx_file::id_util::IdIsValid(specifics.id())) { | 232 if (!crx_file::id_util::IdIsValid(specifics.id())) { |
| 233 LOG(ERROR) << "Attempt to sync bad ExtensionSpecifics (bad ID):\n" | 233 LOG(ERROR) << "Attempt to sync bad ExtensionSpecifics (bad ID):\n" |
| 234 << GetExtensionSpecificsLogMessage(specifics); | 234 << GetExtensionSpecificsLogMessage(specifics); |
| 235 RecordBadSyncData(BAD_EXTENSION_ID); | 235 RecordBadSyncData(BAD_EXTENSION_ID); |
| 236 return false; | 236 return false; |
| 237 } | 237 } |
| 238 | 238 |
| 239 base::Version specifics_version(specifics.version()); | 239 Version specifics_version(specifics.version()); |
| 240 if (!specifics_version.IsValid()) { | 240 if (!specifics_version.IsValid()) { |
| 241 LOG(ERROR) << "Attempt to sync bad ExtensionSpecifics (bad version):\n" | 241 LOG(ERROR) << "Attempt to sync bad ExtensionSpecifics (bad version):\n" |
| 242 << GetExtensionSpecificsLogMessage(specifics); | 242 << GetExtensionSpecificsLogMessage(specifics); |
| 243 RecordBadSyncData(BAD_VERSION); | 243 RecordBadSyncData(BAD_VERSION); |
| 244 return false; | 244 return false; |
| 245 } | 245 } |
| 246 | 246 |
| 247 // The update URL must be either empty or valid. | 247 // The update URL must be either empty or valid. |
| 248 GURL specifics_update_url(specifics.update_url()); | 248 GURL specifics_update_url(specifics.update_url()); |
| 249 if (!specifics_update_url.is_empty() && !specifics_update_url.is_valid()) { | 249 if (!specifics_update_url.is_empty() && !specifics_update_url.is_valid()) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 if (entity_specifics.has_extension()) | 331 if (entity_specifics.has_extension()) |
| 332 return PopulateFromExtensionSpecifics(entity_specifics.extension()); | 332 return PopulateFromExtensionSpecifics(entity_specifics.extension()); |
| 333 | 333 |
| 334 LOG(ERROR) << "Attempt to sync bad EntitySpecifics: no extension data."; | 334 LOG(ERROR) << "Attempt to sync bad EntitySpecifics: no extension data."; |
| 335 RecordBadSyncData(NO_EXTENSION_SPECIFICS); | 335 RecordBadSyncData(NO_EXTENSION_SPECIFICS); |
| 336 return false; | 336 return false; |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace extensions | 339 } // namespace extensions |
| OLD | NEW |