Fixed silent crash, when viewer/composer opens
authorr.karu <r.karu@samsung.com>
Mon, 22 Apr 2013 08:30:11 +0000 (14:00 +0530)
committerGerrit Code Review <gerrit2@kim11>
Mon, 22 Apr 2013 08:55:22 +0000 (17:55 +0900)
[Title] When viewer/composer open, silent crash occurs
[Issue#] TD-9621
[Problem] When user tries to open a mail with html page in email application, silent crash occurs
[Cause] Since html content of email contains a sub resource url with path not having file read permissions,
message becomes invalid, hence UI process terminates.
[Solution] Given universal file read permissions in case of ewk_view_contents_set called from the application
as the same thing happening in loading file:///<url path> type of urls in browser application.
[Developer] Raveendra Karu (r.karu@samsung.com)

Source/WTF/wtf/Platform.h
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 58034bd..0e69fd1 100644 (file)
 #define ENABLE_TIZEN_REDIRECTED_LOCATION_IS_NOT_UTF_8 1 /* Raveendra Karu(r.karu@samsung.com) : If redirected url is not utf-8 encoded, String:fromUTF8 (url) returns NULL. This patch is to avoid this problem*/
 #define ENABLE_TIZEN_CLEAR_HTTPBODY_IN_POST_TO_GET_REDIRECTION 1 /* Raveendra Karu(r.karu@samsung.com) : Clear request http body if redirection happens from POST/PUT to GET */
 #define ENABLE_TIZEN_AUTHENTICATION_CHALLENGE_ENABLED_IN_ALL_FRAMES 1 /* Raveendra Karu(r.karu@samsung.com) : Authentication challenge is enabled even if the frame is not a main frame*/
+#define ENABLE_TIZEN_UNIVERSAL_FILE_READ_ACCESS 1 /* Raveendra Karu(r.karu@samsung.com) : Enabling universal file read access for file: type urls */
 #define ENABLE_TIZEN_FIX_SHOULD_AA_LINES_CONDITION 1 /*Younghwan Cho(yhwan.cho@samsung.com) : Add some conditions for AA to draw box-lines */
 #define ENABLE_TIZEN_JPEGIMAGE_DECODING_THREAD 0 /* Keunyong Lee(ky07.lee@samsung.com) : Make new thread for Jpeg image decoding */
 #define ENABLE_TIZEN_CLEAR_MEMORY_CACHE_BUG_FIX 1 /* Keunyong Lee(ky07.lee@samsung.com) : Fix decoded data contolling problem after memory cache clearing */
index 45d078f..82b1771 100755 (executable)
@@ -613,6 +613,12 @@ void WebPageProxy::loadContentsbyMimeType(const WebData* contents, const String&
         reattachToWebProcess();
 
     process()->assumeReadAccessToBaseURL(baseURL);
+#if ENABLE(TIZEN_UNIVERSAL_FILE_READ_ACCESS)
+    SandboxExtension::Handle sandboxExtensionHandleEmail;
+    bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), baseURL), sandboxExtensionHandleEmail);
+    if (createdExtension)
+        process()->willAcquireUniversalFileReadSandboxExtension();
+#endif
     process()->send(Messages::WebPage::LoadContentsbyMimeType(contents->dataReference(), mimeType, encoding, baseURL), m_pageID);
     process()->responsivenessTimer()->start();
 }