fixup! Make text selection feature available on desktop builds.
authorAntonio Gomes <a1.gomes@samsung.com>
Wed, 23 Sep 2015 20:05:49 +0000 (16:05 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
"theme_path" was getting a corrupted value as a result of
the snippet below:

const char* theme_path = selection_handles_edj.AsUTF8Unsafe().c_str();

My theory is that the temporary shadow std::string variable
resulting of the call to AsUTF8Unsafe was getting unpredictably
deleted, and the c_str pointer held in "theme_path" gets its
content corrupted.

As theme_path is passed as a path to edje_xxx APIs, this was
causing selection handles to randomly fail to show.
Bug reproduces on both desktop and mobile builds.

Original beta/m42 patch:
- http://165.213.202.130/gerrit/#/c/88401/ , reviewed by
DONGJUN KiM, arno renevier.

Reviewed by: a.renevier

Change-Id: I34024d7341d29de6c1ad778747fb348c240e998c
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc

index 038d1f2..775221b 100644 (file)
@@ -52,10 +52,10 @@ SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, Handl
   base::FilePath selection_handles_edj =
       edj_dir.Append(FILE_PATH_LITERAL("SelectionHandles.edj"));
 
-  const char* theme_path = selection_handles_edj.AsUTF8Unsafe().c_str();
+  std::string theme_path = selection_handles_edj.AsUTF8Unsafe();
   const char* group = GetEdjeObjectGroupPath(type);
-  if (edje_file_group_exists(theme_path, group)) {
-    edje_object_file_set(handle_, theme_path, group);
+  if (edje_file_group_exists(theme_path.c_str(), group)) {
+    edje_object_file_set(handle_, theme_path.c_str(), group);
   }
 
   edje_object_signal_emit(handle_, "edje,focus,in", "edje");