Bug 27997 - [V8] Style cleaning for WorkerContextExecutionProxy.
Summary: [V8] Style cleaning for WorkerContextExecutionProxy.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jian Li
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-04 14:36 PDT by Jian Li
Modified: 2009-08-06 14:32 PDT (History)
2 users (show)

See Also:


Attachments
Proposed Patch (23.64 KB, patch)
2009-08-04 15:13 PDT, Jian Li
no flags Details | Formatted Diff | Diff
Add info to ChangeLog (24.17 KB, patch)
2009-08-04 21:32 PDT, Jian Li
dglazkov: review-
Details | Formatted Diff | Diff
Proposed Patch (24.32 KB, patch)
2009-08-06 13:18 PDT, Jian Li
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jian Li 2009-08-04 14:36:35 PDT
Style cleaning for WorkerContextExecutionProxy.
Comment 1 Jian Li 2009-08-04 15:13:57 PDT
Created attachment 34092 [details]
Proposed Patch
Comment 2 Eric Seidel (no email) 2009-08-04 18:59:11 PDT
Comment on attachment 34092 [details]
Proposed Patch

More ChangeLog information would help me understand what all you're changing here.
Comment 3 Jian Li 2009-08-04 21:32:00 PDT
Created attachment 34116 [details]
Add info to ChangeLog
Comment 4 Dimitri Glazkov (Google) 2009-08-06 11:34:50 PDT
Comment on attachment 34116 [details]
Add info to ChangeLog

This looks good overall. A couple of comments:

> diff --git a/WebCore/bindings/v8/ScheduledAction.cpp b/WebCore/bindings/v8/ScheduledAction.cpp
> index 298f6b1..ce4ecf1 100644
> --- a/WebCore/bindings/v8/ScheduledAction.cpp
> +++ b/WebCore/bindings/v8/ScheduledAction.cpp
> @@ -134,7 +134,7 @@ void ScheduledAction::execute(WorkerContext* workerContext)
>  
>      if (!m_function.IsEmpty() && m_function->IsFunction()) {
>          v8::HandleScope handleScope;
> -        v8::Local<v8::Context> v8Context = scriptController->proxy()->GetContext();
> +        v8::Local<v8::Context> v8Context = scriptController->proxy()->context();

Be careful, abarth is working on change to remove V8Proxy::context(), talk w/him.


> +v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Context> context)
> +{
> +    // Enter the scope for this context to get the correct constructor.
> +    v8::Context::Scope scope(context);
> +
> +    return getConstructor(type, V8Proxy::getHiddenObjectPrototype(context));
> +}

Can we have a better, more specific name for this method and perhaps make it private? It shouldn't be used outside of this class.
Comment 5 Adam Barth 2009-08-06 11:52:31 PDT
(In reply to comment #4)
> > -        v8::Local<v8::Context> v8Context = scriptController->proxy()->GetContext();
> > +        v8::Local<v8::Context> v8Context = scriptController->proxy()->context();

V8Proxy::context() must die.  It's not worth renaming it at this point.
Comment 6 Jian Li 2009-08-06 13:18:18 PDT
Created attachment 34221 [details]
Proposed Patch
Comment 7 Jian Li 2009-08-06 13:19:48 PDT
(In reply to comment #4)
> (From update of attachment 34116 [details])
> This looks good overall. A couple of comments:
> 
> > diff --git a/WebCore/bindings/v8/ScheduledAction.cpp b/WebCore/bindings/v8/ScheduledAction.cpp
> > index 298f6b1..ce4ecf1 100644
> > --- a/WebCore/bindings/v8/ScheduledAction.cpp
> > +++ b/WebCore/bindings/v8/ScheduledAction.cpp
> > @@ -134,7 +134,7 @@ void ScheduledAction::execute(WorkerContext* workerContext)
> >  
> >      if (!m_function.IsEmpty() && m_function->IsFunction()) {
> >          v8::HandleScope handleScope;
> > -        v8::Local<v8::Context> v8Context = scriptController->proxy()->GetContext();
> > +        v8::Local<v8::Context> v8Context = scriptController->proxy()->context();
> 
> Be careful, abarth is working on change to remove V8Proxy::context(), talk
> w/him.
> 
Per discussion, we keep it as context() since this is for WorkerContextExecutionProxy.
> 
> > +v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Context> context)
> > +{
> > +    // Enter the scope for this context to get the correct constructor.
> > +    v8::Context::Scope scope(context);
> > +
> > +    return getConstructor(type, V8Proxy::getHiddenObjectPrototype(context));
> > +}
> 
> Can we have a better, more specific name for this method and perhaps make it
> private? It shouldn't be used outside of this class.

Fixed.
Comment 8 Dimitri Glazkov (Google) 2009-08-06 13:19:59 PDT
Comment on attachment 34221 [details]
Proposed Patch

r=me.
Comment 9 Jian Li 2009-08-06 14:32:17 PDT
Committed as http://trac.webkit.org/changeset/46859.