Introduce ProfileBuilder interface

Now the profiler accepts an instance of a ProfileBuilder's subclass
at construction. Therefore, the profiler is agnostic of the profile
representation. Samples would not be stored by the profiler but
instead provided to the ProfileBuilder's subclass to do with them as
it chooses.

This CL also changes CallStackProfileBuilder (originally named
SamplingProfileBuilder) to implement this interface and moves it to
call_stack_profile_builder.{h,cc}. Unit tests are added for this new
class.

In stack_sampling_profiler_unittest.cc, we introduce TestProfileBuilder
which implements the interface. We also removed the CallStackProfile
related operations from this test the StackSamplingProfiler no longer
operates on CallStackProfiles.

Bug: 851163
Change-Id: Ie044b65abb085012a2c25fef7744366aec5a1103
Reviewed-on: https://chromium-review.googlesource.com/1115509
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Mike Wittman <wittman@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Xi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572033}
12 files changed