Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Issue 157063002: Add helpers for CGL types. (Closed)

Created:
6 years, 10 months ago by ccameron
Modified:
6 years, 10 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add helpers for CGL types. Add base::ScopedTypeRef, which is similar to ScopedCFTypeRef, but allows for parameterized retain and release functions. This is necessary for types such as CGLContextObj, which have their own retain and release methods (and for which calling CFRelease will result in crashes). Add some common typedefs of ScopedTypeRef to cgl_util in ui, along with a scoped CGLContextObj make-current class. BUG=245900 R=thakis@chromium.org,mark@chromium.org TBR=garykac@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250077

Patch Set 1 : Trim down #

Patch Set 2 : No defaults #

Total comments: 8

Patch Set 3 : Incorporate review feedback #

Total comments: 4

Patch Set 4 : Use Traits #

Patch Set 5 : & cleanup #

Total comments: 23

Patch Set 6 : Incorporate review feedback #

Total comments: 4

Patch Set 7 : s/cgl_util/scoped_cgl/ #

Total comments: 1

Patch Set 8 : Remove unused include #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -67 lines) Patch
M base/base.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M base/mac/scoped_cftyperef.h View 1 2 3 4 5 2 chunks +19 lines, -66 lines 0 comments Download
A base/mac/scoped_typeref.h View 1 2 3 4 5 1 chunk +132 lines, -0 lines 0 comments Download
M remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M ui/gl/gl.gyp View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
A ui/gl/scoped_cgl.h View 1 2 3 4 5 6 1 chunk +56 lines, -0 lines 0 comments Download
A ui/gl/scoped_cgl.cc View 1 2 3 4 5 6 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
ccameron
I had made some remarks about doing this, and they where not enthusiastically received. The ...
6 years, 10 months ago (2014-02-07 01:09:38 UTC) #1
Avi (use Gerrit)
+mark https://codereview.chromium.org/157063002/diff/110001/base/mac/scoped_typeref.h File base/mac/scoped_typeref.h (right): https://codereview.chromium.org/157063002/diff/110001/base/mac/scoped_typeref.h#newcode1 base/mac/scoped_typeref.h:1: // Copyright (c) 2014 The Chromium Authors. All ...
6 years, 10 months ago (2014-02-07 01:45:29 UTC) #2
Ken Russell (switch to Gerrit)
I think this is a good idea in general and agree with Avi's assessment to ...
6 years, 10 months ago (2014-02-07 03:24:04 UTC) #3
ccameron
Thanks. I've updated this to avoid the duplication and formally make ScopedCFTypeRef be a specialization ...
6 years, 10 months ago (2014-02-07 06:57:49 UTC) #4
Mark Mentovai
The sucky thing about this is that every time you want to use a smart ...
6 years, 10 months ago (2014-02-07 17:22:07 UTC) #5
ccameron
Okay, the idea of using a Traits structure was really the way to go. I've ...
6 years, 10 months ago (2014-02-07 19:23:56 UTC) #6
Avi (use Gerrit)
https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_typeref.h File base/mac/scoped_typeref.h (right): https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_typeref.h#newcode15 base/mac/scoped_typeref.h:15: // ScopedTypeRef<> is patterend after scoped_ptr<>, but maintains a ...
6 years, 10 months ago (2014-02-07 19:29:30 UTC) #7
Mark Mentovai
This is pretty good. Much, much better with the traits. https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_cftyperef.h File base/mac/scoped_cftyperef.h (right): https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_cftyperef.h#newcode28 ...
6 years, 10 months ago (2014-02-07 19:53:40 UTC) #8
Avi (use Gerrit)
https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_cftyperef.h File base/mac/scoped_cftyperef.h (right): https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_cftyperef.h#newcode40 base/mac/scoped_cftyperef.h:40: : public ScopedTypeRef<CFT, ScopedCFTypeRefTraits<CFT> > { Does the compiler ...
6 years, 10 months ago (2014-02-07 19:59:23 UTC) #9
ccameron
Thanks! https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_cftyperef.h File base/mac/scoped_cftyperef.h (right): https://codereview.chromium.org/157063002/diff/310001/base/mac/scoped_cftyperef.h#newcode28 base/mac/scoped_cftyperef.h:28: template<typename CFT> On 2014/02/07 19:53:40, Mark Mentovai wrote: ...
6 years, 10 months ago (2014-02-07 20:58:03 UTC) #10
Mark Mentovai
Great. LGTMark@chromium.org.
6 years, 10 months ago (2014-02-07 21:10:22 UTC) #11
ccameron
Thanks! kbr/thakis, can you do a quick ui/gl OWNER review? If there aren't any objections, ...
6 years, 10 months ago (2014-02-08 01:22:15 UTC) #12
Avi (use Gerrit)
FYI https://codereview.chromium.org/157063002/diff/500001/base/mac/scoped_typeref.h File base/mac/scoped_typeref.h (right): https://codereview.chromium.org/157063002/diff/500001/base/mac/scoped_typeref.h#newcode35 base/mac/scoped_typeref.h:35: // CGLCreateContext(pixel_format, share_group, context.InitializeInto()); yes yes yes yes ...
6 years, 10 months ago (2014-02-08 01:29:23 UTC) #13
Nico
https://codereview.chromium.org/157063002/diff/500001/ui/gl/cgl_util.h File ui/gl/cgl_util.h (right): https://codereview.chromium.org/157063002/diff/500001/ui/gl/cgl_util.h#newcode6 ui/gl/cgl_util.h:6: #define UI_GL_CGL_UTIL_H_ We don't like _util files as they ...
6 years, 10 months ago (2014-02-08 02:52:27 UTC) #14
ccameron
https://codereview.chromium.org/157063002/diff/500001/ui/gl/cgl_util.h File ui/gl/cgl_util.h (right): https://codereview.chromium.org/157063002/diff/500001/ui/gl/cgl_util.h#newcode6 ui/gl/cgl_util.h:6: #define UI_GL_CGL_UTIL_H_ On 2014/02/08 02:52:27, Nico wrote: > We ...
6 years, 10 months ago (2014-02-10 00:10:45 UTC) #15
Nico
https://codereview.chromium.org/157063002/diff/500001/ui/gl/cgl_util.h File ui/gl/cgl_util.h (right): https://codereview.chromium.org/157063002/diff/500001/ui/gl/cgl_util.h#newcode6 ui/gl/cgl_util.h:6: #define UI_GL_CGL_UTIL_H_ On 2014/02/10 00:10:45, ccameron1 wrote: > On ...
6 years, 10 months ago (2014-02-10 00:14:08 UTC) #16
Nico
Oh, I meant to say "lgtm" in my comment from friday too, looks like I ...
6 years, 10 months ago (2014-02-10 00:14:29 UTC) #17
ccameron
Thanks! Changed to scoped_cgl (makes sense). There's also a scoped_make_current (but it only applies to ...
6 years, 10 months ago (2014-02-10 01:43:03 UTC) #18
ccameron
The CQ bit was checked by ccameron@chromium.org
6 years, 10 months ago (2014-02-10 01:43:14 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ccameron@chromium.org/157063002/670001
6 years, 10 months ago (2014-02-10 01:43:19 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-10 02:32:56 UTC) #21
commit-bot: I haz the power
Retried try job too often on mac for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac&number=123036
6 years, 10 months ago (2014-02-10 02:32:57 UTC) #22
Mark Mentovai
https://codereview.chromium.org/157063002/diff/670001/ui/gl/gl.gyp File ui/gl/gl.gyp (right): https://codereview.chromium.org/157063002/diff/670001/ui/gl/gl.gyp#newcode253 ui/gl/gl.gyp:253: 'scoped_cgl.cc', Sort. s > g.
6 years, 10 months ago (2014-02-10 03:10:28 UTC) #23
ccameron
Thanks -- fixed. Btw, it looks like the mac build failure was legit -- including ...
6 years, 10 months ago (2014-02-10 08:07:22 UTC) #24
ccameron
The CQ bit was checked by ccameron@chromium.org
6 years, 10 months ago (2014-02-10 08:08:51 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ccameron@chromium.org/157063002/960001
6 years, 10 months ago (2014-02-10 08:09:01 UTC) #26
commit-bot: I haz the power
Change committed as 250077
6 years, 10 months ago (2014-02-10 13:07:43 UTC) #27
Mark Mentovai
LGTM
6 years, 10 months ago (2014-02-10 14:00:08 UTC) #28
Ken Russell (switch to Gerrit)
6 years, 10 months ago (2014-02-10 18:38:37 UTC) #29
Message was sent while issue was closed.
Sorry for the late review, but LGTM. Nice generalization.

Powered by Google App Engine
This is Rietveld 408576698