Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / component_updater / widevine_cdm_component_installer.cc
index f8c494a..1445247 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <string.h>
 
+#include <string>
 #include <vector>
 
 #include "base/base_paths.h"
@@ -34,7 +35,7 @@
 #include "media/cdm/ppapi/supported_cdm_versions.h"
 #include "third_party/widevine/cdm/widevine_cdm_common.h"
 
-#include "widevine_cdm_version.h"  // In SHARED_INTERMEDIATE_DIR.
+#include "widevine_cdm_version.h"  // In SHARED_INTERMEDIATE_DIR. NOLINT
 
 using content::BrowserThread;
 using content::PluginService;
@@ -46,10 +47,10 @@ namespace component_updater {
 namespace {
 
 // CRX hash. The extension id is: oimompecagnajdejgnnjijobebaeigek.
-const uint8 kSha2Hash[] = { 0xe8, 0xce, 0xcf, 0x42, 0x06, 0xd0, 0x93, 0x49,
-                            0x6d, 0xd9, 0x89, 0xe1, 0x41, 0x04, 0x86, 0x4a,
-                            0x8f, 0xbd, 0x86, 0x12, 0xb9, 0x58, 0x9b, 0xfb,
-                            0x4f, 0xbb, 0x1b, 0xa9, 0xd3, 0x85, 0x37, 0xef };
+const uint8 kSha2Hash[] = {0xe8, 0xce, 0xcf, 0x42, 0x06, 0xd0, 0x93, 0x49,
+                           0x6d, 0xd9, 0x89, 0xe1, 0x41, 0x04, 0x86, 0x4a,
+                           0x8f, 0xbd, 0x86, 0x12, 0xb9, 0x58, 0x9b, 0xfb,
+                           0x4f, 0xbb, 0x1b, 0xa9, 0xd3, 0x85, 0x37, 0xef};
 
 // File name of the Widevine CDM component manifest on different platforms.
 const char kWidevineCdmManifestName[] = "WidevineCdm";
@@ -155,9 +156,7 @@ bool CheckForCompatibleVersion(const base::DictionaryValue& manifest,
       << "Widevine CDM component manifest has empty " << version_name;
 
   std::vector<std::string> versions;
-  base::SplitString(versions_string,
-                    kCdmValueDelimiter,
-                    &versions);
+  base::SplitString(versions_string, kCdmValueDelimiter, &versions);
 
   for (size_t i = 0; i < versions.size(); ++i) {
     int version = 0;
@@ -177,16 +176,15 @@ bool CheckForCompatibleVersion(const base::DictionaryValue& manifest,
 // This should never fail except in rare cases where the component has not been
 // updated recently or the user downgrades Chrome.
 bool IsCompatibleWithChrome(const base::DictionaryValue& manifest) {
-  return
-      CheckForCompatibleVersion(manifest,
-                                kCdmModuleVersionsName,
-                                media::IsSupportedCdmModuleVersion) &&
-      CheckForCompatibleVersion(manifest,
-                                kCdmInterfaceVersionsName,
-                                media::IsSupportedCdmInterfaceVersion) &&
-      CheckForCompatibleVersion(manifest,
-                                kCdmHostVersionsName,
-                                media::IsSupportedCdmHostVersion);
+  return CheckForCompatibleVersion(manifest,
+                                   kCdmModuleVersionsName,
+                                   media::IsSupportedCdmModuleVersion) &&
+         CheckForCompatibleVersion(manifest,
+                                   kCdmInterfaceVersionsName,
+                                   media::IsSupportedCdmInterfaceVersion) &&
+         CheckForCompatibleVersion(manifest,
+                                   kCdmHostVersionsName,
+                                   media::IsSupportedCdmHostVersion);
 }
 
 void GetAdditionalParams(const base::DictionaryValue& manifest,
@@ -288,7 +286,9 @@ void WidevineCdmComponentInstallerTraits::ComponentReady(
       FROM_HERE,
       base::Bind(&WidevineCdmComponentInstallerTraits::UpdateCdmAdapter,
                  base::Unretained(this),
-                 version, path, base::Passed(&manifest)));
+                 version,
+                 path,
+                 base::Passed(&manifest)));
 }
 
 bool WidevineCdmComponentInstallerTraits::VerifyInstallation(
@@ -365,8 +365,8 @@ void RegisterWidevineCdmComponent(ComponentUpdateService* cus) {
   scoped_ptr<ComponentInstallerTraits> traits(
       new WidevineCdmComponentInstallerTraits);
   // |cus| will take ownership of |installer| during installer->Register(cus).
-  DefaultComponentInstaller* installer
-      new DefaultComponentInstaller(traits.Pass());
+  DefaultComponentInstaller* installer =
+      new DefaultComponentInstaller(traits.Pass());
   installer->Register(cus);
 #else
   return;
@@ -374,4 +374,3 @@ void RegisterWidevineCdmComponent(ComponentUpdateService* cus) {
 }
 
 }  // namespace component_updater
-