WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
101530
[EFL][WK2] Add ewk_context_additional_plugin_path_set API
https://bugs.webkit.org/show_bug.cgi?id=101530
Summary
[EFL][WK2] Add ewk_context_additional_plugin_path_set API
KwangYong Choi
Reported
2012-11-07 17:43:06 PST
Add ewk_context_additional_plugin_path_set() to set additional plugin directory. Currently, get additional plugin directories API is missing. Test can be modified after adding it.
Attachments
Patch
(4.42 KB, patch)
2012-11-07 17:43 PST
,
KwangYong Choi
no flags
Details
Formatted Diff
Diff
Patch
(4.15 KB, patch)
2012-11-08 00:02 PST
,
KwangYong Choi
no flags
Details
Formatted Diff
Diff
Patch
(4.20 KB, patch)
2012-11-08 02:19 PST
,
KwangYong Choi
no flags
Details
Formatted Diff
Diff
Patch
(4.21 KB, patch)
2012-11-08 03:37 PST
,
KwangYong Choi
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
KwangYong Choi
Comment 1
2012-11-07 17:43:52 PST
Created
attachment 172900
[details]
Patch
Jinwoo Song
Comment 2
2012-11-07 22:47:35 PST
Comment on
attachment 172900
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172900&action=review
rebase the patch as the ewk_context has been changed.
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:225 > + WKContextSetAdditionalPluginsDirectory(m_context.get(), WKStringCreateWithUTF8CString(path));
You may use WebContext::setAdditionalPluginsDirectory() instead of WKContextSetAdditionalPluginsDirectory(), as ewk_context uses WebContext now.
Chris Dumez
Comment 3
2012-11-07 23:16:45 PST
Comment on
attachment 172900
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172900&action=review
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:222 > +bool EwkContext::setAdditionalPluginPath(const char* path)
Should take a const String& in argument.
>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:225 >> + WKContextSetAdditionalPluginsDirectory(m_context.get(), WKStringCreateWithUTF8CString(path)); > > You may use WebContext::setAdditionalPluginsDirectory() instead of WKContextSetAdditionalPluginsDirectory(), as ewk_context uses WebContext now.
Yes, please use C++ API instead of C API.
> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:218 > + /* FIXME: Get additional plugin path and compare with the path. */
I'm not sure this comment should be there. There does not seem to be an API to retrieve additional plugin paths at the moment.
KwangYong Choi
Comment 4
2012-11-07 23:42:04 PST
Comment on
attachment 172900
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172900&action=review
>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:222 >> +bool EwkContext::setAdditionalPluginPath(const char* path) > > Should take a const String& in argument.
OK.
>>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:225 >>> + WKContextSetAdditionalPluginsDirectory(m_context.get(), WKStringCreateWithUTF8CString(path)); >> >> You may use WebContext::setAdditionalPluginsDirectory() instead of WKContextSetAdditionalPluginsDirectory(), as ewk_context uses WebContext now. > > Yes, please use C++ API instead of C API.
OK.
>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:218 >> + /* FIXME: Get additional plugin path and compare with the path. */ > > I'm not sure this comment should be there. There does not seem to be an API to retrieve additional plugin paths at the moment.
As you wrote, currently, there is no API to retrieve additional plugin directories. And these TRUE/FALSE tests are not enough for this API, I think. So, I added some comment here.
KwangYong Choi
Comment 5
2012-11-08 00:02:29 PST
Created
attachment 172944
[details]
Patch
Mikhail Pozdnyakov
Comment 6
2012-11-08 00:24:05 PST
Comment on
attachment 172944
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172944&action=review
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:204 > +bool EwkContext::setAdditionalPluginPath(const String& path)
does this method make sense at all if NETSCAPE_PLUGIN_API is not enabled?
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:208 > + return true;
m_webContext->setAdditionalPluginsDirectory does not return bool and we should not do it too.
Chris Dumez
Comment 7
2012-11-08 00:28:12 PST
(In reply to
comment #6
)
> (From update of
attachment 172944
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=172944&action=review
> > > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:204 > > +bool EwkContext::setAdditionalPluginPath(const String& path) > > does this method make sense at all if NETSCAPE_PLUGIN_API is not enabled? > > > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:208 > > + return true; > > m_webContext->setAdditionalPluginsDirectory does not return bool and we should not do it too.
I agree with both comments.
Gyuyoung Kim
Comment 8
2012-11-08 01:10:51 PST
Comment on
attachment 172944
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172944&action=review
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:324 > +Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context* ewkContext, const char* path)
It seems to me ewk_settings.cpp is more proper place for this function. Can't this API be moved to there ?
Chris Dumez
Comment 9
2012-11-08 01:22:01 PST
Comment on
attachment 172944
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172944&action=review
>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:324 >> +Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context* ewkContext, const char* path) > > It seems to me ewk_settings.cpp is more proper place for this function. Can't this API be moved to there ?
Why? It is a WebContext API not a WebPreferences one.
Gyuyoung Kim
Comment 10
2012-11-08 01:37:31 PST
(In reply to
comment #9
)
> (From update of
attachment 172944
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=172944&action=review
> > >> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:324 > >> +Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context* ewkContext, const char* path) > > > > It seems to me ewk_settings.cpp is more proper place for this function. Can't this API be moved to there ? > > Why? It is a WebContext API not a WebPreferences one.
Yes, I know it well. But, I just check this because this functionality just sets plugin path. It looks this is close to global setting, not related to context. Of course, this functionality can only be supported by context for now.
KwangYong Choi
Comment 11
2012-11-08 02:19:04 PST
Created
attachment 172966
[details]
Patch Applied Mikhail mentioned. I'm not sure this API can be moved to settings. I think, it can be handled by another bug if it's possible. :)
Gyuyoung Kim
Comment 12
2012-11-08 02:38:01 PST
(In reply to
comment #11
)
> Created an attachment (id=172966) [details] > Patch > > Applied Mikhail mentioned. > > I'm not sure this API can be moved to settings. I think, it can be handled by another bug if it's possible. :)
Yes, I think so. I just would check if this can be moved.
Mikhail Pozdnyakov
Comment 13
2012-11-08 02:42:00 PST
Comment on
attachment 172966
[details]
Patch LGTM
Gyuyoung Kim
Comment 14
2012-11-08 03:18:13 PST
Comment on
attachment 172966
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172966&action=review
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:326 > + impl->setAdditionalPluginPath(String(path));
I think you need to use filenameToString as gtk port. context->priv->context->setAdditionalPluginsDirectory(WebCore::filenameToString(directory));
Chris Dumez
Comment 15
2012-11-08 03:26:22 PST
Comment on
attachment 172966
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172966&action=review
>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:326 >> + impl->setAdditionalPluginPath(String(path)); > > I think you need to use filenameToString as gtk port. > > context->priv->context->setAdditionalPluginsDirectory(WebCore::filenameToString(directory));
Only GTK port has filenameToString(). In any case, using String(path) is seriously wrong as the path will be processed as ASCII. It should be String::fromUTF8(path).
Gyuyoung Kim
Comment 16
2012-11-08 03:34:37 PST
(In reply to
comment #15
)
> (From update of
attachment 172966
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=172966&action=review
> > >> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:326 > >> + impl->setAdditionalPluginPath(String(path)); > > > > I think you need to use filenameToString as gtk port. > > > > context->priv->context->setAdditionalPluginsDirectory(WebCore::filenameToString(directory)); > > Only GTK port has filenameToString(). > > In any case, using String(path) is seriously wrong as the path will be processed as ASCII. It should be String::fromUTF8(path).
If gtk port only has it, we should use String::fromUTF8() instead.
KwangYong Choi
Comment 17
2012-11-08 03:37:42 PST
Created
attachment 172994
[details]
Patch Changed to String::fromUTF8(path)
Chris Dumez
Comment 18
2012-11-08 03:43:28 PST
Comment on
attachment 172994
[details]
Patch LGTM.
WebKit Review Bot
Comment 19
2012-11-08 04:15:07 PST
Comment on
attachment 172994
[details]
Patch Clearing flags on attachment: 172994 Committed
r133880
: <
http://trac.webkit.org/changeset/133880
>
WebKit Review Bot
Comment 20
2012-11-08 04:15:12 PST
All reviewed patches have been landed. Closing bug.
Raphael Kubo da Costa (:rakuco)
Comment 21
2012-11-08 04:46:25 PST
Build fix landed in
http://trac.webkit.org/changeset/133882
Gyuyoung Kim
Comment 22
2012-11-08 05:13:28 PST
(In reply to
comment #21
)
> Build fix landed in
http://trac.webkit.org/changeset/133882
Oops, thanks.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug