Change trampoline algorithm for top level extensions
authorWonYoung Choi <wy80.choi@samsung.com>
Thu, 28 Jan 2016 07:56:56 +0000 (16:56 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Thu, 28 Jan 2016 07:56:56 +0000 (16:56 +0900)
Top level extensions (tizen, xwalk) shouldn't be trampoline module
because of security issues.

extensions/renderer/xwalk_module_system.cc

index f799809..176ab84 100644 (file)
@@ -470,10 +470,14 @@ void XWalkModuleSystem::MarkModulesWithTrampoline() {
 
   ExtensionModules::iterator it = extension_modules_.begin();
   while (it != extension_modules_.end()) {
-    it = std::adjacent_find(it, extension_modules_.end(),
-                            &ExtensionModuleEntry::IsPrefix);
-    if (it == extension_modules_.end())
-      break;
+    const std::string& n = (*it).name;
+    // Top level modules won't be mared with trampoline
+    if (std::find(n.begin(), n.end(), '.') != n.end()) {
+      it = std::adjacent_find(it, extension_modules_.end(),
+                              &ExtensionModuleEntry::IsPrefix);
+      if (it == extension_modules_.end())
+        break;
+    }
     it->use_trampoline = false;
     ++it;
   }