Bug 74169

Summary: Upstream PageClientBlackBerry.h into WebCore/platform/blackberry
Product: WebKit Reporter: Mary Wu <mawu>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dbates, japhet, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 73144    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Mary Wu 2011-12-08 23:42:20 PST
Upstream GeolocationService/PageClient into WebCore/platform/blackberry and small style fix of DragDataBlackBerry.cpp
Comment 1 Mary Wu 2011-12-08 23:56:51 PST
Created attachment 118540 [details]
Patch
Comment 2 Leo Yang 2011-12-09 00:33:24 PST
Comment on attachment 118540 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=118540&action=review

Informal review. I only looked at I commented part and feel that you shouldn't mix style fix with you newly upstreamed files.

> Source/WebCore/ChangeLog:35
> +        * platform/blackberry/DragDataBlackBerry.cpp: Small style fix.
> +        (WebCore::DragData::containsURL):
> +        (WebCore::DragData::asFilenames):
> +        (WebCore::DragData::asURL):
> +        (WebCore::DragData::asFragment):
> +        * platform/blackberry/GeolocationServiceBlackBerry.cpp: Added.
> +        (WebCore::GeolocationServiceBlackBerry::create):
> +        (WebCore::GeolocationServiceBlackBerry::GeolocationServiceBlackBerry):
> +        (WebCore::GeolocationServiceBlackBerry::~GeolocationServiceBlackBerry):
> +        (WebCore::GeolocationServiceBlackBerry::startUpdating):
> +        (WebCore::GeolocationServiceBlackBerry::stopUpdating):
> +        (WebCore::GeolocationServiceBlackBerry::suspend):
> +        (WebCore::GeolocationServiceBlackBerry::resume):
> +        (WebCore::GeolocationServiceBlackBerry::lastPosition):
> +        (WebCore::GeolocationServiceBlackBerry::lastError):
> +        (WebCore::GeolocationServiceBlackBerry::onLocationUpdate):
> +        (WebCore::GeolocationServiceBlackBerry::onLocationError):
> +        (WebCore::GeolocationServiceBlackBerry::onPermission):
> +        (WebCore::GeolocationServiceBlackBerry::deferNotifications):
> +        (WebCore::GeolocationServiceBlackBerry::resumeNotifications):
> +        * platform/blackberry/GeolocationServiceBlackBerry.h: Added.
> +        (WebCore::GeolocationServiceBlackBerry::tracker):
> +        (WebCore::GeolocationServiceBlackBerry::hasDeferredNotifications):

Could you remove the information for each function since they are newly added?

> Source/WebCore/platform/blackberry/DragDataBlackBerry.cpp:71
>      return false;
>  }
>  
> -bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const
> +bool DragData::containsURL(Frame*, FilenameConversionPolicy) const
>  {
>      notImplemented();
>      return false;
>  }
>  
> -void DragData::asFilenames(WTF::Vector<String, 0u>& result) const
> +void DragData::asFilenames(Vector<String>&) const
>  {
> -    // FIXME: remove explicit 0 size in result template once this is implemented
>      notImplemented();
>  }
>  

I would use a separate patch to do this.

> Source/WebCore/platform/blackberry/DragDataBlackBerry.cpp:91
> -String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const
> +String DragData::asURL(Frame*, FilenameConversionPolicy, String*) const
>  {
>      notImplemented();
>      return String();
>  }
>  
> -WTF::PassRefPtr<DocumentFragment> DragData::asFragment(Frame*, PassRefPtr<Range> context,
> -                                            bool allowPlainText, bool& chosePlainText) const
> +PassRefPtr<DocumentFragment> DragData::asFragment(Frame*, PassRefPtr<Range>, bool, bool&) const
>  {

Ditto.
Comment 3 Mary Wu 2011-12-09 00:51:01 PST
ok, I will split another bug then...
Comment 4 Mary Wu 2011-12-09 00:53:09 PST
Created attachment 118544 [details]
Patch
Comment 5 Mary Wu 2011-12-09 01:02:27 PST
(In reply to comment #3)
> ok, I will split another bug then...

https://bugs.webkit.org/show_bug.cgi?id=74171
Comment 6 Leo Yang 2011-12-09 01:56:01 PST
Comment on attachment 118544 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=118544&action=review

Informal review.

> Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.h:74
> +#endif

You could add ' // GeolocationServiceBlackBerry_h' after '#endif'.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:65
> +#endif

You could add ' // PageClientBlackBerry_h' after '#endif'.
Comment 7 Mary Wu 2011-12-09 02:33:13 PST
Created attachment 118553 [details]
Patch
Comment 8 Rob Buis 2011-12-09 07:02:28 PST
Comment on attachment 118553 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=118553&action=review

Mostly just some nits left.

> Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.cpp:106
> +                                                          true, // providesAltititude

providesAltititude?

> Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.cpp:112
> +                                                          0.0, // heading

0.0 -> 0

> Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.cpp:114
> +                                                          0.0); // speed

0.0 -> 0

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:45
> +    virtual void setPreventsScreenDimming(bool preventDimming) = 0;

preventDimming is obvious, can be removed.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:46
> +    virtual void showVirtualKeyboard(bool showKeyboard) = 0;

showKeyboard is obvious, can be removed.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:61
> +    virtual int showAlertDialog(BlackBerry::WebKit::WebPageClient::AlertType atype) = 0;

Remove atype
Comment 9 Mary Wu 2011-12-11 18:47:23 PST
All accepts excepte the first one:


> > Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.cpp:106
> > +                                                          true, // providesAltititude
> 
> providesAltititude?
> 

that follows interface naming in the header file page/Coordinates.h
Comment 10 Mary Wu 2011-12-11 18:52:37 PST
Created attachment 118722 [details]
Patch
Comment 11 Rob Buis 2011-12-12 07:14:22 PST
Comment on attachment 118722 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=118722&action=review

Some nits left, nearly there :)

> Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.cpp:48
> +    m_geolocation->frame()->loader()->client()->didCreateGeolocation(m_geolocation);

It seems safer to test for m_geolocation->frame() being not null, like in GeolocationServiceBlackBerry::startUpdating.

> Source/WebCore/platform/blackberry/GeolocationServiceBlackBerry.cpp:106
> +                                                          true, // providesAltititude

This is not a valid word, it should be "providesAltitude".

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:51
> +    virtual bool shouldPluginEnterFullScreen(WebCore::PluginView*, const char*) = 0;

The second param name should be provided, I can't tell what it is doing without the name.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:52
> +    virtual void didPluginEnterFullScreen(WebCore::PluginView*, const char*) = 0;

Ditto.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:53
> +    virtual void didPluginExitFullScreen(WebCore::PluginView*, const char*) = 0;

Ditto.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:54
> +    virtual void onPluginStartBackgroundPlay(WebCore::PluginView*, const char*) = 0;

Ditto.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:55
> +    virtual void onPluginStopBackgroundPlay(WebCore::PluginView*, const char*) = 0;

Ditto.
Comment 12 Mary Wu 2011-12-13 18:17:55 PST
remove GeolocationServiceBlackBerry.cpp/h from the patch since they're dead code and we used different geo location client as confirmed with David Tapuska.
Comment 13 Mary Wu 2011-12-13 18:34:05 PST
Created attachment 119132 [details]
Patch
Comment 14 Rob Buis 2011-12-13 19:07:43 PST
Comment on attachment 119132 [details]
Patch

LGTM!
Comment 15 Daniel Bates 2011-12-13 19:14:10 PST
Comment on attachment 119132 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=119132&action=review

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:28
> +namespace Graphics {

Maybe adding an empty line about this line will make this namespace directive stand out a bit more from the forward declaration of the class.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:29
> +class Window;

This should be indented per (3) of Indentation of <http://www.webkit.org/coding/coding-style.html>.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:56
> +    virtual bool shouldPluginEnterFullScreen(WebCore::PluginView*, const char* pluginUniquePrefix) = 0;
> +    virtual void didPluginEnterFullScreen(WebCore::PluginView*, const char* pluginUniquePrefix) = 0;
> +    virtual void didPluginExitFullScreen(WebCore::PluginView*, const char* pluginUniquePrefix) = 0;
> +    virtual void onPluginStartBackgroundPlay(WebCore::PluginView*, const char* pluginUniquePrefix) = 0;
> +    virtual void onPluginStopBackgroundPlay(WebCore::PluginView*, const char* pluginUniquePrefix) = 0;
> +    virtual bool lockOrientation(bool landscape) = 0;

pluginUniquePrefix => uniquePluginPrefix

We tend to place the adjective/verb before the noun in names. This follows from (8) of section Names of <http://www.webkit.org/coding/coding-style.html>.
Comment 16 Daniel Bates 2011-12-13 19:15:01 PST
Comment on attachment 119132 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=119132&action=review

>> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:28
>> +namespace Graphics {
> 
> Maybe adding an empty line about this line will make this namespace directive stand out a bit more from the forward declaration of the class.

*above
Comment 17 Mary Wu 2011-12-13 20:23:42 PST
> 
> > Source/WebCore/platform/blackberry/PageClientBlackBerry.h:29
> > +class Window;
> 
> This should be indented per (3) of Indentation of <http://www.webkit.org/coding/coding-style.html>.
> 

it can't pass style check script if indent. As per coding-style, it means the content inside class Window should be indent. "class Window" belongs to "The contents of an outermost namespace block", so needn't indent?
Comment 18 Mary Wu 2011-12-13 20:26:39 PST
Created attachment 119145 [details]
Patch
Comment 19 Leo Yang 2011-12-14 19:27:03 PST
Comment on attachment 119145 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=119145&action=review

> Source/WebCore/ChangeLog:3
> +        Upstream PageClientBlackBerry.h into WebCore/platform/blackberry

This doesn't match the bug title.
Comment 20 Mary Wu 2011-12-14 19:28:08 PST
change title since the content changed now.
Comment 21 Daniel Bates 2011-12-15 16:14:42 PST
Comment on attachment 119145 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=119145&action=review

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:34
> +namespace BlackBerry {
> +namespace Platform {
> +class NetworkStreamFactory;
> +
> +namespace Graphics {
> +class Window;
> +}
> +
> +}
> +}

From talking with Dave Levin today on IRC, this should be written as:

namespace BlackBerry {
    namespace Platform {
        class NetworkStreamFactory;
        namespace Graphics {
            class Window;
        }
    }
}

This formatting makes the forward declarations stand out since they are indented. Some additional remarks on this formatting are mentioned in the description and comments of bug #36760. The comments in bug #36760 and the discussion from Dave Levin seemed to imply that the remarks on namespace indentation in <http://www.webkit.org/coding/coding-style.html> pertain to a namespace that contains class/struct definitions. That is, the code style guidelines don't pertain to a namespace that only lists forward declarations (as is the case here).

We should look to clarify this on webkit-dev.

> Source/WebCore/platform/blackberry/PageClientBlackBerry.h:40
> +namespace WebCore {
> +class IntRect;
> +class IntSize;
> +class PluginView;
> +}

Similarly, since this namespace only lists forward declarations it should be written as:

namespace WebCore {
    class IntRect;
    class IntSize;
    class PluginView;
}
Comment 22 Mary Wu 2011-12-15 20:11:56 PST
Thanks for your clear explain, Daniel. yes, I strongly suggest webkit coding-style page be updated to add this rule. 
update package loaded again...
Comment 23 Mary Wu 2011-12-15 20:33:57 PST
(In reply to comment #22)
> Thanks for your clear explain, Daniel. yes, I strongly suggest webkit coding-style page be updated to add this rule. 
> update package loaded again...

Just found bug #36760 was very old and still in "NEW" status, so can't pass style-check script if change the patch...I prefer to let it be and change the style after the bug #36760 be resolved.
Comment 24 Mary Wu 2011-12-20 22:12:30 PST
Created attachment 120143 [details]
Patch
Comment 25 WebKit Review Bot 2011-12-20 22:14:11 PST
Attachment 120143 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/platform/blackberry/PageClientBlackBerry.h:26:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 26 Daniel Bates 2011-12-20 22:22:16 PST
Comment on attachment 120143 [details]
Patch

Thank you Mary.
Comment 27 WebKit Review Bot 2011-12-20 23:44:57 PST
Comment on attachment 120143 [details]
Patch

Clearing flags on attachment: 120143

Committed r103393: <http://trac.webkit.org/changeset/103393>
Comment 28 WebKit Review Bot 2011-12-20 23:45:04 PST
All reviewed patches have been landed.  Closing bug.