From 1681c420e461342e1e921428bdc8728de12c7b1a Mon Sep 17 00:00:00 2001 From: "ws29.jung" Date: Wed, 11 Jul 2018 11:01:14 +0900 Subject: [PATCH] Check Injected Bundle inject status 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 --- vendor/brightray/browser/browser_context.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vendor/brightray/browser/browser_context.cc b/vendor/brightray/browser/browser_context.cc index 2f709bb..95530bf 100644 --- a/vendor/brightray/browser/browser_context.cc +++ b/vendor/brightray/browser/browser_context.cc @@ -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 -- 2.7.4