Bug 145252

Summary: [WK2] Fix unused-private-field warning in WebProcess/Plugins/PluginView.<h|cpp>
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Csaba Osztrogonác <ossy>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue, dino, ossy, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 145121, 111932    
Attachments:
Description Flags
Patch
none
Patch none

Description Csaba Osztrogonác 2015-05-21 03:05:57 PDT
In file included from ../../Source/WebKit2/WebProcess/Plugins/PluginView.cpp:27:
../../Source/WebKit2/WebProcess/Plugins/PluginView.h:254:10: warning: private field 'm_didPlugInStartOffScreen' is not used [-Wunused-private-field]
    bool m_didPlugInStartOffScreen;
         ^
../../Source/WebKit2/WebProcess/Plugins/PluginView.h:290:14: warning: private field 'm_countSnapshotRetries' is not used [-Wunused-private-field]
    unsigned m_countSnapshotRetries;
             ^
2 warnings generated.

------

- m_didPlugInStartOffScreen is only used inside ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guard 
- m_countSnapshotRetries in only used once inside ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) 
and once inside PLATFORM(COCOA) guard
Comment 1 Csaba Osztrogonác 2015-05-21 03:12:14 PDT
Created attachment 253514 [details]
Patch
Comment 2 Csaba Osztrogonác 2015-05-21 03:57:05 PDT
OMG, ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC is defined
in Source/WebKit2/WebProcess/WebPage/WebPage.h. But why there? :-/

( This define was added in http://trac.webkit.org/changeset/145332 )
Comment 3 Csaba Osztrogonác 2015-05-21 04:11:32 PDT
Created attachment 253518 [details]
Patch
Comment 4 Csaba Osztrogonác 2015-05-21 04:16:13 PDT
(In reply to comment #3)
> Created attachment 253518 [details]
> Patch

I moved the definition of ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC
from Source/WebKit2/WebProcess/WebPage/WebPage.h to FeatureDefines.h.

It is incorrect to define an ENABLE_* guard in any local header, the 
value of all ENABLE guard must be same everywhere in the codebase. Now
it is true if you include WebPage.h and PLATFORM(COCOA) is true, but
it is false if you don't include WebPage.h.
Comment 5 Csaba Osztrogonác 2015-06-01 04:05:58 PDT
ping?
Comment 6 Csaba Osztrogonác 2015-06-02 01:15:23 PDT
ping?
Comment 7 Csaba Osztrogonác 2015-06-08 04:25:11 PDT
ping?
Comment 8 Csaba Osztrogonác 2015-06-12 03:26:47 PDT
Timothy, Dean, you owned r145332 which added this warning,
so please take a look at the proposed fix. Thanks.
Comment 9 Csaba Osztrogonác 2015-06-18 01:21:01 PDT
ping?
Comment 10 Csaba Osztrogonác 2015-06-19 01:22:55 PDT
Comment on attachment 253518 [details]
Patch

Clearing flags on attachment: 253518

Committed r185742: <http://trac.webkit.org/changeset/185742>
Comment 11 Csaba Osztrogonác 2015-06-19 01:23:04 PDT
All reviewed patches have been landed.  Closing bug.