Check Injected Bundle inject status 73/183773/1
authorws29.jung <ws29.jung@samsung.com>
Wed, 11 Jul 2018 02:01:14 +0000 (11:01 +0900)
committerws29.jung <ws29.jung@samsung.com>
Wed, 11 Jul 2018 02:06:18 +0000 (11:06 +0900)
Before this patch, Injected Bundle was injected everytime
when BrowserContext is constructed.
BrowserContext can be constructed multiple time with webapp
but Bundle Injection should be done only at the first time.
With this patch, Injection will be done only once.

Change-Id: Ia7fc7e0e896cca749182ead287829f99118b03b2
Signed-off-by: ws29.jung <ws29.jung@samsung.com>
vendor/brightray/browser/browser_context.cc

index 2f709bb33ff0e319f73e6bd9fffc6b2a4d9612a4..95530bf449acc030d2943dbaf241cc5bcc409ea7 100644 (file)
@@ -84,6 +84,7 @@ class BrowserContext::ResourceContext : public content::ResourceContext {
 };
 
 // static
+bool did_bundle_injected = false;
 BrowserContext::BrowserContextMap BrowserContext::browser_context_map_;
 
 // static
@@ -144,8 +145,11 @@ BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
 #endif
     //content::ZygoteHandle *handle = content::GetGenericZygote();
     //*handle->LoadInjectedBundlePath(injected_bundle_path);
-    (*content::GetGenericZygote())->
-          LoadInjectedBundlePath(injected_bundle_path);
+    if (!did_bundle_injected) {
+      (*content::GetGenericZygote())->
+            LoadInjectedBundlePath(injected_bundle_path);
+      did_bundle_injected = true;
+    }
 #if defined(OS_TIZEN)
    }
 #endif