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

Side by Side Diff: cc/resources/picture.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/image_layer_updater.cc ('k') | cc/resources/prioritized_resource_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/picture.h" 5 #include "cc/resources/picture.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); 405 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
406 res->Set("params.layer_rect", MathUtil::AsValue(layer_rect_).release()); 406 res->Set("params.layer_rect", MathUtil::AsValue(layer_rect_).release());
407 407
408 size_t serialized_size = stream.bytesWritten(); 408 size_t serialized_size = stream.bytesWritten();
409 scoped_ptr<char[]> serialized_picture(new char[serialized_size]); 409 scoped_ptr<char[]> serialized_picture(new char[serialized_size]);
410 stream.copyTo(serialized_picture.get()); 410 stream.copyTo(serialized_picture.get());
411 std::string b64_picture; 411 std::string b64_picture;
412 base::Base64Encode(std::string(serialized_picture.get(), serialized_size), 412 base::Base64Encode(std::string(serialized_picture.get(), serialized_size),
413 &b64_picture); 413 &b64_picture);
414 res->SetString("skp64", b64_picture); 414 res->SetString("skp64", b64_picture);
415 return res.PassAs<base::Value>(); 415 return res.Pass();
416 } 416 }
417 417
418 void Picture::EmitTraceSnapshot() const { 418 void Picture::EmitTraceSnapshot() const {
419 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( 419 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
420 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( 420 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT(
421 "devtools.timeline.picture"), 421 "devtools.timeline.picture"),
422 "cc::Picture", 422 "cc::Picture",
423 this, 423 this,
424 TracedPicture::AsTraceablePicture(this)); 424 TracedPicture::AsTraceablePicture(this));
425 } 425 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 scoped_refptr<base::debug::TracedValue> record_data = 547 scoped_refptr<base::debug::TracedValue> record_data =
548 new base::debug::TracedValue(); 548 new base::debug::TracedValue();
549 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); 549 TracedValue::SetIDRef(this, record_data.get(), "picture_id");
550 record_data->BeginArray("layer_rect"); 550 record_data->BeginArray("layer_rect");
551 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); 551 MathUtil::AddToTracedValue(layer_rect_, record_data.get());
552 record_data->EndArray(); 552 record_data->EndArray();
553 return record_data; 553 return record_data;
554 } 554 }
555 555
556 } // namespace cc 556 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/image_layer_updater.cc ('k') | cc/resources/prioritized_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698