Bug 79387 - Limit WebGL Errors in Console to 10 per context
Summary: Limit WebGL Errors in Console to 10 per context
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Gregg Tavares
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-23 12:13 PST by Gregg Tavares
Modified: 2012-02-24 16:03 PST (History)
2 users (show)

See Also:


Attachments
Patch (4.87 KB, patch)
2012-02-23 12:15 PST, Gregg Tavares
no flags Details | Formatted Diff | Diff
Patch (5.09 KB, patch)
2012-02-24 11:58 PST, Gregg Tavares
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregg Tavares 2012-02-23 12:13:07 PST
Limit WebGL Errors in Console to 10 per context
Comment 1 Gregg Tavares 2012-02-23 12:15:03 PST
Created attachment 128529 [details]
Patch
Comment 2 Kenneth Russell 2012-02-23 17:37:14 PST
Comment on attachment 128529 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128529&action=review

Looks good but would you mind doing one small refactoring to make maintenance easier?

> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:429
> +    , m_numGLErrorsToConsoleAllowed(10)

Could you define a const int maxGLErrorsAllowedToConsole at the top of the file and initialize this to that?

> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:470
> +    m_numGLErrorsToConsoleAllowed = 10;

Same here.
Comment 3 Gregg Tavares 2012-02-24 11:58:09 PST
Created attachment 128779 [details]
Patch
Comment 4 Gregg Tavares 2012-02-24 12:00:37 PST
Comment on attachment 128779 [details]
Patch

added constant.

Just fyi though, It's frustrating to be held to a different standard than the existing code. The reason I didn't use a constant is because the code just a few lines above is not using a constant. The #1 rule I've been taught is to be consistent and follow the style of the code being modified which is what I did.

The point is, if you want a certain style, make sure the code is already following that style and people will follow by example.
Comment 5 Kenneth Russell 2012-02-24 14:57:52 PST
Comment on attachment 128779 [details]
Patch

Looks good. r=me
Comment 6 Kenneth Russell 2012-02-24 15:01:04 PST
(In reply to comment #4)
> (From update of attachment 128779 [details])
> added constant.
> 
> Just fyi though, It's frustrating to be held to a different standard than the existing code. The reason I didn't use a constant is because the code just a few lines above is not using a constant. The #1 rule I've been taught is to be consistent and follow the style of the code being modified which is what I did.
> 
> The point is, if you want a certain style, make sure the code is already following that style and people will follow by example.

I don't mean to hold you to a different standard. I'm probably personally responsible for many style issues in that file. The issue I saw during the review was a constant replicated twice. If you're referring to the 4 that's passed to the initializer of m_videoCache, note that it is only present in that one location. If you see other cleanups that should be made please file a bug and assign it to me, and I'll clean them up.
Comment 7 WebKit Review Bot 2012-02-24 16:03:33 PST
Comment on attachment 128779 [details]
Patch

Clearing flags on attachment: 128779

Committed r108861: <http://trac.webkit.org/changeset/108861>
Comment 8 WebKit Review Bot 2012-02-24 16:03:37 PST
All reviewed patches have been landed.  Closing bug.