diff options
author | khushalsagar <khushalsagar@chromium.org> | 2016-01-15 12:46:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-15 20:48:00 +0000 |
commit | 376942135fb8ad3d33340c506ff251f3c3afba3d (patch) | |
tree | d65d8ccbee3ffb1555508b03035f8fa65f8746e8 /cc/trees/proxy_common.cc | |
parent | 272ad4a2612601ae1c7cd8aca68bf8ada4f5a494 (diff) | |
download | chromium_src-376942135fb8ad3d33340c506ff251f3c3afba3d.zip chromium_src-376942135fb8ad3d33340c506ff251f3c3afba3d.tar.gz chromium_src-376942135fb8ad3d33340c506ff251f3c3afba3d.tar.bz2 |
(De)-serialize BeginMainFrameAndCommitState to protobuf.
BUG=550687
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1581773002
Cr-Commit-Position: refs/heads/master@{#369836}
Diffstat (limited to 'cc/trees/proxy_common.cc')
-rw-r--r-- | cc/trees/proxy_common.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cc/trees/proxy_common.cc b/cc/trees/proxy_common.cc index f047e8e..c96af7b 100644 --- a/cc/trees/proxy_common.cc +++ b/cc/trees/proxy_common.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "cc/trees/proxy_common.h" + +#include "cc/proto/begin_main_frame_and_commit_state.pb.h" #include "cc/trees/layer_tree_host.h" namespace cc { @@ -12,4 +14,23 @@ BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {} +void BeginMainFrameAndCommitState::ToProtobuf( + proto::BeginMainFrameAndCommitState* proto) const { + proto->set_begin_frame_id(begin_frame_id); + begin_frame_args.ToProtobuf(proto->mutable_begin_frame_args()); + scroll_info->ToProtobuf(proto->mutable_scroll_info()); + proto->set_memory_allocation_limit_bytes(memory_allocation_limit_bytes); + proto->set_evicted_ui_resources(evicted_ui_resources); +} + +void BeginMainFrameAndCommitState::FromProtobuf( + const proto::BeginMainFrameAndCommitState& proto) { + begin_frame_id = proto.begin_frame_id(); + begin_frame_args.FromProtobuf(proto.begin_frame_args()); + scroll_info.reset(new ScrollAndScaleSet()); + scroll_info->FromProtobuf(proto.scroll_info()); + memory_allocation_limit_bytes = proto.memory_allocation_limit_bytes(); + evicted_ui_resources = proto.evicted_ui_resources(); +} + } // namespace cc |