Changeset 24955 in webkit


Ignore:
Timestamp:
Aug 9, 2007 8:28:07 AM (17 years ago)
Author:
spadma
Message:

2007-08-09 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>

Reviewed by Sachin.
DESC: [S60] Problem with CPluginSkin::PluginScriptableObject
http://bugs.webkit.org/show_bug.cgi?id=14383

  • WebKit\Plugin\inc\PluginWin.h: Added CPluginWin::GetPluginUid()
  • WebKit\Plugin\inc\PluginHandler.h: Added CPluginInfo::Uid()
  • WebKit\Plugin\inc\PluginSkin.h: Added CPluginSkin::IsPluginScriptableL()
  • WebKit\Plugin\src\PluginSkin.cpp: (CPluginSkin::IsPluginScriptableL())
  • WebKit\Plugin\src\PluginWin.cpp: (CPluginWin::GetPluginUid())
Location:
S60/branches/3.1m
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • S60/branches/3.1m/S60WebUi/ChangeLog

    r16036 r24955  
     109-08-2007 Mahesh Kulkarni <mahesh.kulkarni@Nokia.com>
     2        Reviewed by Sachin Padma
     3       
     4        DESC: [S60] Problem with CPluginSkin::PluginScriptableObject
     5        http://bugs.webkit.org/show_bug.cgi?id=14383
     6       
     7        * WebUi/inc/WebUiCRKeys.h: Added CRKey KPluginScriptabilityAllowed
     8
     9 
    1102006-08-25  w3liu  <wei.liu@nokia.com>
    211
  • S60/branches/3.1m/S60WebUi/WebUi/inc/WebUiCRKeys.h

    r14549 r24955  
    1010*    All rights reserved.
    1111
    12      Redistribution and use in source and binary forms, with or without
    13      modification, are permitted provided that the following conditions
    14      are met:
     12 Redistribution and use in source and binary forms, with or without
     13 modification, are permitted provided that the following conditions
     14 are met:
    1515
    1616*      * Redistributions of source code must retain the above copyright
     
    2424*        from this software without specific prior written permission.
    2525
    26      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    27      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    28      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    29      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    30      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    31      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    32      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    33      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    34      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    35      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
    36      USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
    37      DAMAGE.
     26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
     36 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
     37 DAMAGE.
    3838
    3939*    Please see file patentlicense.txt for further grants.
     
    5959// Images enabled.
    6060// Valid values: 0 = off 1 = on
    61 const TUint32 KBrowserNGImagesEnabled =         0x00000001;
     61const TUint32 KBrowserNGImagesEnabled =         0x00000001;
    6262
    6363// Browser font size.
    6464// Valid values:any positive 32-bit integer value
    65 const TUint32 KBrowserNGFontSize =              0x00000002;
     65const TUint32 KBrowserNGFontSize =              0x00000002;
    6666
    6767// Browser encoding setting.
    6868// Valid values: any positive 32-bit integer value
    6969// 0 = automatic
    70 const TUint32 KBrowserNGEncoding =              0x00000003;
     70const TUint32 KBrowserNGEncoding =              0x00000003;
    7171
    7272// Browser uses cookies.
    7373// Valid values: 0 = reject 1 = allow
    74 const TUint32 KBrowserNGCookiesEnabled =        0x00000004;
     74const TUint32 KBrowserNGCookiesEnabled =        0x00000004;
    7575
    7676// Boolean value which determines whether ECMA Script
    7777// setting is enabled or disabled in Browser.
    7878// Valid values: 0 = disabled 1 = enabled
    79 const TUint32 KBrowserNGECMAScriptSupport =     0x00000005;
     79const TUint32 KBrowserNGECMAScriptSupport =     0x00000005;
    8080
    8181// Show HTTP security warnings.
    8282// Valid values: 0 = off 1 = on
    83 const TUint32 KBrowserNGShowSecurityWarnings=   0x00000006;
     83const TUint32 KBrowserNGShowSecurityWarnings=   0x00000006;
    8484
    8585// Show Page Overview.
    8686// Valid values: 0 = off 1 = on
    87 const TUint32 KBrowserNGPageOverview =                  0x00000007;
     87const TUint32 KBrowserNGPageOverview =        0x00000007;
    8888
    8989// Mime types for HTTP accept header.
    9090// Any String value
    91 const TUint32 KBrowserNGMimeTypes =                     0x00000008;
     91const TUint32 KBrowserNGMimeTypes =         0x00000008;
    9292
    9393// Show History view on back softkey press.
    9494// Valid values: 0 = off 1 = on
    95 const TUint32 KBrowserNGBackList =                              0x00000009;
     95const TUint32 KBrowserNGBackList =          0x00000009;
    9696
    9797// Auto refresh.
    9898// Valid values: 0 = off 1 = on
    99 const TUint32 KBrowserNGAutoRefresh =                   0x0000000A;
     99const TUint32 KBrowserNGAutoRefresh =         0x0000000A;
    100100
    101101// BrowserNG engine cache size in KBytes
    102102// Valid values: any positive 32-bit integer value
    103 const TUint32 KBrowserNGMemoryCacheSize =               0x0000000B;
     103const TUint32 KBrowserNGMemoryCacheSize =       0x0000000B;
    104104
    105105// The setting for encoding a URL with UTF-8 or the original encoding.
    106106// Valid values: 0 = off 1 = on
    107 const TUint32 KBrowserNGUtf8Encoding =                  0x0000000C;
     107const TUint32 KBrowserNGUtf8Encoding =        0x0000000C;
    108108
    109109// Browser Adaptive Bookmarks mode setting.
     
    144144// The flag that's set if Browser build is to be used in United States (USA)
    145145// Valid values: 0 = not set (non-US build)  1 = set (US build)
    146 const TUint32 KBrowserUsBuild =                 0x00000014;
     146const TUint32 KBrowserUsBuild =               0x00000014;
     147
     148// This Interger type will have UID's of plugins that can access scriptability
     149// Valid values: TUid's
     150const TUint32 KPluginScriptabilityAllowed = 0x00000015;
    147151
    148152#endif      // WEBUICRKEYS_H
  • S60/branches/3.1m/WebKit/ChangeLog

    r24941 r24955  
     12007-08-09 Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2        Reviewed by Sachin.
     3        DESC: [S60] Problem with CPluginSkin::PluginScriptableObject
     4        http://bugs.webkit.org/show_bug.cgi?id=14383
     5
     6        * WebKit\Plugin\inc\PluginWin.h: Added CPluginWin::GetPluginUid()
     7        * WebKit\Plugin\inc\PluginHandler.h: Added CPluginInfo::Uid()
     8        * WebKit\Plugin\inc\PluginSkin.h: Added CPluginSkin::IsPluginScriptableL()
     9        * WebKit\Plugin\src\PluginSkin.cpp:
     10        (CPluginSkin::IsPluginScriptableL())
     11        * WebKit\Plugin\src\PluginWin.cpp:
     12        (CPluginWin::GetPluginUid())
     13
    1142007-08-08  yadavall  <sriram.yadavalli>
    215
  • S60/branches/3.1m/WebKit/Plugin/inc/PluginHandler.h

    r20908 r24955  
    474474        void ParseDefaultDataL(const TDesC8& aMIMEDescription);
    475475        void ParseDisplayNameL(const TDesC& aPluginDescription);
    476 
     476        TInt32 Uid() { return iUid.iUid; }
    477477    private:  // Private Methods
    478478
  • S60/branches/3.1m/WebKit/Plugin/inc/PluginSkin.h

    r24940 r24955  
    388388        void *PluginScriptableObject();
    389389
     390        /**
     391        * Checks if plugin UID is present in the repository
     392        * Checks if Plugin is scriptable
     393        * @since 3.1
     394        * @returns True if plugin is scriptable, Flase otherwise
     395        */       
     396        TInt IsPluginScriptableL();
     397
    390398  public: // Functions from MViewFocusObserver
    391399
  • S60/branches/3.1m/WebKit/Plugin/inc/PluginWin.h

    r21537 r24955  
    502502        void *PluginScriptableObject();
    503503
     504        /**
     505        * Get plugin UID
     506        * @since 3.1
     507        * @return
     508        */
     509       TInt32 CPluginWin::GetPluginUid();
     510
    504511    protected: // New functions
    505512
  • S60/branches/3.1m/WebKit/Plugin/src/PluginSkin.cpp

    r24940 r24955  
    7979_LIT(KContentTypeFlash, "flash");
    8080
     81const TUint KOrigBufSize = 512;
    8182// The default placeholder width, matches the value set in html4.css
    8283const TUint KPlaceholderWidth( 100 );
     
    702703#endif
    703704
     705// -----------------------------------------------------------------------------
     706// CPluginSkin::IsPluginScriptableL
     707// -----------------------------------------------------------------------------
     708//       
     709TInt CPluginSkin::IsPluginScriptableL()
     710    {
     711    // If the plugin content hasnt arrived yet or plugin is invalid, then return immediately
     712    if ( !iPluginWin )
     713        {
     714        return KErrNotFound;
     715        }
     716
     717    // Allocate wide buffer for data types
     718    HBufC* uid = HBufC::NewLC( KOrigBufSize );
     719    TPtr uidPtr( uid->Des() );
     720    TInt error;
     721   
     722#ifndef __BROWSER_SDK
     723    CRepository* rep = CRepository::NewL( KCRUidBrowser );
     724#else
     725    CRepository* rep = CRepository::NewL( KCRUidWebUi );
     726#endif
     727    CleanupStack::PushL( rep );
     728   
     729    // Read the data types from repository, increase the buffer
     730    // if the initial size not enough.
     731    error = rep->Get( KPluginScriptabilityAllowed, uidPtr );
     732
     733    if( error == KErrOverflow )
     734        {
     735        // retry with a bigger buffer
     736        do
     737            {
     738            uid->ReAllocL( uidPtr.MaxLength() + KOrigBufSize );
     739            uidPtr.Set( uid->Des() );
     740
     741            error = rep->Get( KPluginScriptabilityAllowed, uidPtr );
     742            }
     743        while( error == KErrOverflow );
     744        }
     745 
     746    //Integer to String;
     747    TBuf16 <12> uidString;
     748    uidString.Num(iPluginWin->GetPluginUid(), EHex);
     749    error = uid->FindC(uidString);
     750   
     751    CleanupStack::PopAndDestroy( 2 ); // uidPtr, rep
     752   
     753    return error;
     754    }
     755   
    704756void* CPluginSkin::PluginScriptableObject()
    705757    {
     758    TInt isScriptable;
     759   
    706760    CWidgetExtension* wdgtExt = iWebKitFrame->WebKitView().WebKitControl().WidgetExtension();
    707     if (wdgtExt)
    708         {
     761
     762    if (!wdgtExt)
     763        TRAPD(err, (isScriptable = IsPluginScriptableL()));
     764   
     765    if(wdgtExt || (!err && !isScriptable))        {
    709766        return iPluginWin?iPluginWin->PluginScriptableObject():0;
    710767        }
  • S60/branches/3.1m/WebKit/Plugin/src/PluginWin.cpp

    r21537 r24955  
    12541254    iTopUrl = aUrl.AllocL();
    12551255    }
     1256
     1257// -----------------------------------------------------------------------------
     1258// CPluginWin::GetPluginUid
     1259// -----------------------------------------------------------------------------
     1260//       
     1261TInt32 CPluginWin::GetPluginUid()
     1262    {
     1263    RPointerArray<CPluginInfo> pluginInfoArray = iPluginHandler->PluginInfoArray();
     1264    TInt index = iPluginHandler->GetIndexFromHandle(iHandle);
     1265    CPluginInfo* plugin = pluginInfoArray[index];
     1266    return plugin->Uid();
     1267    }
     1268   
    12561269// -----------------------------------------------------------------------------
    12571270// CPluginData::CPluginData
Note: See TracChangeset for help on using the changeset viewer.