<?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>85330</bug_id>
          
          <creation_ts>2012-05-01 17:53:56 -0700</creation_ts>
          <short_desc>[meta][V8] Remove V8Proxy</short_desc>
          <delta_ts>2013-09-12 22:33:36 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          <dependson>86831</dependson>
    
    <dependson>87079</dependson>
    
    <dependson>87083</dependson>
    
    <dependson>87102</dependson>
    
    <dependson>87106</dependson>
    
    <dependson>93101</dependson>
    
    <dependson>93103</dependson>
    
    <dependson>93105</dependson>
    
    <dependson>93106</dependson>
    
    <dependson>93115</dependson>
    
    <dependson>93209</dependson>
    
    <dependson>93605</dependson>
    
    <dependson>93610</dependson>
    
    <dependson>93679</dependson>
    
    <dependson>93682</dependson>
    
    <dependson>93792</dependson>
    
    <dependson>93830</dependson>
    
    <dependson>93834</dependson>
    
    <dependson>94437</dependson>
    
    <dependson>94438</dependson>
    
    <dependson>94443</dependson>
    
    <dependson>94444</dependson>
    
    <dependson>94445</dependson>
    
    <dependson>94446</dependson>
    
    <dependson>94450</dependson>
    
    <dependson>94453</dependson>
    
    <dependson>94455</dependson>
    
    <dependson>94456</dependson>
    
    <dependson>94459</dependson>
    
    <dependson>94460</dependson>
    
    <dependson>94561</dependson>
    
    <dependson>94563</dependson>
    
    <dependson>94593</dependson>
    
    <dependson>94596</dependson>
    
    <dependson>94597</dependson>
    
    <dependson>94598</dependson>
    
    <dependson>94701</dependson>
    
    <dependson>94706</dependson>
    
    <dependson>94713</dependson>
    
    <dependson>94715</dependson>
    
    <dependson>94768</dependson>
    
    <dependson>94770</dependson>
    
    <dependson>94773</dependson>
    
    <dependson>94777</dependson>
    
    <dependson>94794</dependson>
          <blocked>93095</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Kentaro Hara">haraken</reporter>
          <assigned_to name="Kentaro Hara">haraken</assigned_to>
          <cc>abarth</cc>
    
    <cc>andersca</cc>
    
    <cc>arv</cc>
    
    <cc>dglazkov</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>613837</commentid>
    <comment_count>0</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-05-01 17:53:56 -0700</bug_when>
    <thetext>V8Proxy is one-to-one with ScriptController. The methods in V8Proxy should be moved to ScriptController or other appropriate classes. The objective is to remove V8Proxy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627327</commentid>
    <comment_count>1</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-05-17 22:01:07 -0700</bug_when>
    <thetext>How should we refactor V8Proxy::notHandledByInterceptor()?

V8Proxy::notHandledByInterceptor() is used to return &quot;early&quot; from the custom binding callbacks. V8Proxy::notHandledByInterceptor() just returns v8::Local&lt;v8::Object&gt;(). However, as far as I look over all custom bindings, the following three patterns are mixed to accomplish the early return:

- Use V8Proxy::notHandledByInterceptor().
- Hard-code &apos;return v8::Handle&lt;v8::Value&gt;()&apos;.
- Hard code &apos;return v8::Handle&lt;v8::Object&gt;()&apos;.

Possible refactoring approaches:

(A) Remove V8Proxy::notHandledByInterceptor(). Unify all of them into &apos;return v8::Handle&lt;v8::Value&gt;()&apos;.

(B) Replace hard-coded &apos;return v8::Handle&lt;v8::Value&gt;()&apos; and &apos;return v8::Handle&lt;v8::Object&gt;()&apos; with V8Proxy::notHandledByInterceptor().

I would prefer (A), but WDYT? (The reason why I do not like notHandledByInterceptor() is that notHandledByInterceptor() is not general in a sense that it can be used for callbacks that return v8::Handle&lt;v8::Value&gt;() or v8::Local&lt;v8::Object&gt;(). We cannot use notHandledByInterceptor() for callbacks that return v8::Local&lt;v8::Boolean&gt;() and thus need to hard-code it anyway).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627331</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2012-05-17 22:06:25 -0700</bug_when>
    <thetext>I invented notHandledByInterceptor a while back as a way to clearly indicate that we are falling through the interceptor (that&apos;s named property handlers). I now see that it has been cargo-culted all over the place. I am ok with just removing it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627336</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2012-05-17 22:26:02 -0700</bug_when>
    <thetext>Here&apos;s where it all started: http://codereview.chromium.org/21370</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>627784</commentid>
    <comment_count>4</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2012-05-18 10:13:41 -0700</bug_when>
    <thetext>I actually think we should keep notHandledByInterceptor. It is a lot clearer than returning an empty v8::Value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>628669</commentid>
    <comment_count>5</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-05-20 17:23:41 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; I actually think we should keep notHandledByInterceptor. It is a lot clearer than returning an empty v8::Value.

arv: I&apos;ve not yet landed the patch (https://bugs.webkit.org/show_bug.cgi?id=86831). Waiting for your opinion.

In most cases, notHandledByInterceptor() had been used in this pattern:

    throwError(...);
    return notHandledByInterceptor();

The patch replaces it with:

    throwError(...);
    return v8::Handle&lt;v8::Value&gt;();

Then I will land a follow-up patch that replaces it with:

    return throwError(...);

Some custom bindings are already using &apos;return throwError(...)&apos;. This pattern seems to be cleanest. WDYH?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629166</commentid>
    <comment_count>6</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2012-05-21 09:16:44 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; I actually think we should keep notHandledByInterceptor. It is a lot clearer than returning an empty v8::Value.
&gt; 
&gt; arv: I&apos;ve not yet landed the patch (https://bugs.webkit.org/show_bug.cgi?id=86831). Waiting for your opinion.
&gt; 
&gt; In most cases, notHandledByInterceptor() had been used in this pattern:
&gt; 
&gt;     throwError(...);
&gt;     return notHandledByInterceptor();
&gt; 
&gt; The patch replaces it with:
&gt; 
&gt;     throwError(...);
&gt;     return v8::Handle&lt;v8::Value&gt;();
&gt; 
&gt; Then I will land a follow-up patch that replaces it with:
&gt; 
&gt;     return throwError(...);
&gt; 
&gt; Some custom bindings are already using &apos;return throwError(...)&apos;. This pattern seems to be cleanest. WDYH?

The return throwError(...) case is clearly the winner.

I looked at the patch and there seems to be a lot of cases where removing notHandledByInterceptor makes the code more obscure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>629745</commentid>
    <comment_count>7</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-05-21 17:19:22 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; The return throwError(...) case is clearly the winner.

Sure, I&apos;ll unify them into &apos;return throwError(...)&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>928646</commentid>
    <comment_count>8</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2013-09-12 22:33:36 -0700</bug_when>
    <thetext>V8Proxy has been removed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>