Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1363)

Issue 1321041: Cleaning WebKitDriver code (HLWK).

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by sauta
Modified:
13 years, 11 months ago
CC:
webdriver-mobile-eng_google.com
Base URL:
http://webkitdriver.googlecode.com/svn/trunk/
Visibility:
Public.

Patch Set 1 #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -235 lines) Patch
M hlwk/Rakefile View 1 chunk +1 line, -1 line 0 comments Download
M hlwk/WebKit/hl/JavaBindings.h View 2 chunks +3 lines, -3 lines 0 comments Download
M hlwk/WebKit/hl/JavaBindings.cpp View 62 chunks +352 lines, -231 lines 16 comments Download

Messages

Total messages: 2
sauta
13 years, 11 months ago (2010-05-26 13:50:37 UTC) #1
Eran
13 years, 11 months ago (2010-05-26 15:41:23 UTC) #2
I've outlined several things which do not conform to the Google and general Java
style guide. I am sure I have not caught all instances, please review the code
and fix all of the instances.

http://codereview.appspot.com/1321041/diff/1/3
File hlwk/WebKit/hl/JavaBindings.cpp (right):

http://codereview.appspot.com/1321041/diff/1/3#newcode121
hlwk/WebKit/hl/JavaBindings.cpp:121: FrameLoaderClientHl *client =
(FrameLoaderClientHl*)frame->loader()->client();
Keep the braces - it makes the code easier to read by *not* forcing the reader
to look up the operator precedence rules and in this case, also explains what's
being casted.

http://codereview.appspot.com/1321041/diff/1/3#newcode194
hlwk/WebKit/hl/JavaBindings.cpp:194: if (element == NULL ||
!element->isStyledElement())
Leave the curly braces, even if there's one line of code. This is error prone
(and I've seen bugs arising from this more than once). This is an official
recommendation of Java which Google embraced:
http://java.sun.com/docs/codeconv/html/CodeConventions.doc6.html#449

http://codereview.appspot.com/1321041/diff/1/3#newcode200
hlwk/WebKit/hl/JavaBindings.cpp:200: if (style)
Same here.

http://codereview.appspot.com/1321041/diff/1/3#newcode244
hlwk/WebKit/hl/JavaBindings.cpp:244: if (node->nodeName() == "TITLE")
Same here.

http://codereview.appspot.com/1321041/diff/1/3#newcode254
hlwk/WebKit/hl/JavaBindings.cpp:254: else if (getProperty((Element*)node,
String("visibility")) == "visible")
Same here.

http://codereview.appspot.com/1321041/diff/1/3#newcode257
hlwk/WebKit/hl/JavaBindings.cpp:257: visible = false;
And here.

http://codereview.appspot.com/1321041/diff/1/3#newcode259
hlwk/WebKit/hl/JavaBindings.cpp:259: if (!start && !isNone)
and here.

http://codereview.appspot.com/1321041/diff/1/3#newcode360
hlwk/WebKit/hl/JavaBindings.cpp:360: else
Same here, for both if and else statements.

http://codereview.appspot.com/1321041/diff/1/3#newcode405
hlwk/WebKit/hl/JavaBindings.cpp:405: if (*cycle)
Here as well.

http://codereview.appspot.com/1321041/diff/1/3#newcode456
hlwk/WebKit/hl/JavaBindings.cpp:456: env->CallBooleanMethod(result, adding,
arrayObj);
And here.

http://codereview.appspot.com/1321041/diff/1/3#newcode462
hlwk/WebKit/hl/JavaBindings.cpp:462: if (!objClass || !cid)
Here as well.

http://codereview.appspot.com/1321041/diff/1/3#newcode526
hlwk/WebKit/hl/JavaBindings.cpp:526: if (!exec->hadException())
Here.

http://codereview.appspot.com/1321041/diff/1/3#newcode617
hlwk/WebKit/hl/JavaBindings.cpp:617: if ((drv != NULL) && (drv->GetFrame() !=
NULL))
Here for both statements.

http://codereview.appspot.com/1321041/diff/1/3#newcode674
hlwk/WebKit/hl/JavaBindings.cpp:674: if(doc == NULL)
Here.

http://codereview.appspot.com/1321041/diff/1/3#newcode754
hlwk/WebKit/hl/JavaBindings.cpp:754: if (output.right(1) == " ")
And here.

http://codereview.appspot.com/1321041/diff/1/3#newcode771
hlwk/WebKit/hl/JavaBindings.cpp:771: if (output.right(1) == " ")
Here.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b