<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>178893</bug_id>
          
          <creation_ts>2017-10-26 16:26:07 -0700</creation_ts>
          <short_desc>Revisit WebKit api pattern where Page owns the client.</short_desc>
          <delta_ts>2017-10-26 16:26:25 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeremy Jones">jeremyj-wk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1365086</commentid>
    <comment_count>0</comment_count>
    <who name="Jeremy Jones">jeremyj-wk</who>
    <bug_when>2017-10-26 16:26:07 -0700</bug_when>
    <thetext>&gt; This API seems a bit weird. Normally you don&apos;t pass ownership of a client to
&gt; the thing that it&apos;s a client of. You hold ownership, and the client
&gt; relationship is weak.

Search for &apos;_page-&gt;set[a-zA-Z]*Client\(&apos; shows this pattern in lots of places:

    _page-&gt;setFindClient(std::make_unique&lt;WebKit::FindClient&gt;(self));
    _page-&gt;setDiagnosticLoggingClient(std::make_unique&lt;WebKit::DiagnosticLoggingClient&gt;(self));
    _page-&gt;setNavigationClient(_navigationState-&gt;createNavigationClient());
    _page-&gt;setContextMenuClient(_uiDelegate-&gt;createContextMenuClient());
    _page-&gt;setUIClient(_uiDelegate-&gt;createUIClient());
    _page-&gt;setIconLoadingClient(_iconLoadingDelegate-&gt;createIconLoadingClient());
    _page-&gt;setHistoryClient(_navigationState-&gt;createHistoryClient());
        _page-&gt;setFormClient(std::make_unique&lt;FormClient&gt;(self));
    m_page-&gt;setFullscreenClient(std::make_unique&lt;WebKit::FullscreenClient&gt;(view));
    _page-&gt;setFindMatchesClient(std::make_unique&lt;TextFinderFindClient&gt;(self));

Maybe this should be revisited</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1365087</commentid>
    <comment_count>1</comment_count>
    <who name="Jeremy Jones">jeremyj-wk</who>
    <bug_when>2017-10-26 16:26:25 -0700</bug_when>
    <thetext>From comments on https://bugs.webkit.org/show_bug.cgi?id=178089</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>