To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
What does this end up looking like? I don't want to bring in lots of other base/ or std::string related stuff yet. Can we wrap this inside a platform or WTF abstraction? Is this just using macros?
On Thu, Sep 24, 2015 at 2:42 PM, Elliott Sprehn <esp...@chromium.org> wrote:What does this end up looking like? I don't want to bring in lots of other base/ or std::string related stuff yet. Can we wrap this inside a platform or WTF abstraction? Is this just using macros?When do you think Blink should start using base things?
On Thu, Sep 24, 2015 at 2:53 PM, Elliott Sprehn <esp...@chromium.org> wrote:On Thu, Sep 24, 2015 at 2:46 PM, Dana Jansens <dan...@chromium.org> wrote:On Thu, Sep 24, 2015 at 2:42 PM, Elliott Sprehn <esp...@chromium.org> wrote:What does this end up looking like? I don't want to bring in lots of other base/ or std::string related stuff yet. Can we wrap this inside a platform or WTF abstraction? Is this just using macros?When do you think Blink should start using base things?Blink should not be using std:: strings or containers or the associated base libraries, the other base libraries we should discuss separately. For the latter case the answer is "not yet".It's fine to not use std::string and we can even PRESUBMIT enforce that if you're worried that people will start using std::string or base string things to prevent that. But that's really different than a blanket ban on base, which affects any other useful things, such as tracing.If you're looking for discussion about individual things in base (with what granularity) isn't this such a discussion?
I'm just not sure what we are waiting for now that we're merged, what is going to change "not yet" into "yet" that we can watch and work on?
We have the platform wrapper now which is what causes the headache. Unless someone beats me to it I'll try to figure out what tracing pulls in on Monday.
Dan
We do allow passing std::string as a convenience and then pull the c style string out of that. Most other things either require a long-lived c string or using the copy macro on a c string like in your example.
Tracing also uses scoped_refptrs to wrap the convertible objects.
Dan
Doing a quick grep, it looks like most of the trace points are using c-style strings anyway. Those points wouldn't change at all, we'd just need to change the includes to point to base/trace_event/trace_event.h.There is one override in TraceEvent.h which converts WTF::CString& to a string tracing understands by calling .data() on it. Those would have to call .data() at the call site instead of using the wrapper.
> primiano@ would it be possible to use char*'s here? Or have char* variants on these methods?Technically we could add an overload which takes a char* also. My only concern there would be that, right now, in base::TraceValue char* is used to make the "will not copy" contract explicit. Turning everything into char* will make that a bit less obvious probably.> It maybe possible to keep the current TracedValue inside platform, just change it to use the ConvertableToTraceFormat from base instead of the one in platform.Hmm that would leave still lot of problems open. base::TracedValue today is based on a base::Pickle, which in turn is memory-dense, fast and makes easy to estimate (w.r.t. memory overhead).The TracedValue inside blink still handles its own set of dictionary and lists and is really a copy of the old TracedValue that we had in chromium (before the pickle).If we go through the efforts of a refactoring I'd really like to get rid of blink's copy of TracedValue.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Will the rule for using scoped_refptr vs RefPtr be "use scoped_refptr for base:: objects, and RefPtr for everything else"?
Also, will we try to converge the behavior/conventions of the two types at some point?
- base::RefCounted objects start with a refcount of zero and should be immediately be stored in a scoped_refptr, but WTF::RefCounted objects start with one reference that should be immediately adopted.
- scoped_refptr is often passed by copy or const ref, while RefPtr usually tries to move references to avoid refcount churn. Do we care? Will it have a measurable impact where we use trace events? This is largely a hypothetical question for other patches that use scoped_refptr: the draft cl is actually an improvement in this regard. With oysteine@'s patch, the compiler will now use RVO to completely elide the copy, whereas it was forced to use move semantics before.
Daniel
Will the rule for using scoped_refptr vs RefPtr be "use scoped_refptr for base:: objects, and RefPtr for everything else"?
Will the rule for using scoped_refptr vs RefPtr be "use scoped_refptr for base:: objects, and RefPtr for everything else"?
Also, will we try to converge the behavior/conventions of the two types at some point?
- base::RefCounted objects start with a refcount of zero and should be immediately be stored in a scoped_refptr, but WTF::RefCounted objects start with one reference that should be immediately adopted.
- scoped_refptr is often passed by copy or const ref, while RefPtr usually tries to move references to avoid refcount churn. Do we care? Will it have a measurable impact where
On Mon, Oct 5, 2015 at 12:19 PM Daniel Cheng <dch...@chromium.org> wrote:Will the rule for using scoped_refptr vs RefPtr be "use scoped_refptr for base:: objects, and RefPtr for everything else"?
Slightly expanded, we'd also need a rule for what to do about refcounted Blink objects that inherit from something in base::, as with TracedValue in my CL.
At this time I don't think we want base/ to be used outside platform (and WTF). I would suggest moving tracing integration into WTF with wrappers, it'll remove considerable amounts of plumbing and allow tighter integration of WTF types.
At a future time once we've got experience with base in platform and WTF we can consider using it more widely.
What happen to the plan of "[blink-dev] A guideline for introducing Blink => Chromium dependencies" of whitelisting headers on a case-per-case basis? Should we consider that not valid anymore?
The last words there, on Oct 5, were> please be patient, I'm going to share a plan and guidance in the next few days. :)What happened to that?