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

Side by Side Diff: gpu/tools/compositor_model_bench/render_tree.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "gpu/tools/compositor_model_bench/render_tree.h" 5 #include "gpu/tools/compositor_model_bench/render_tree.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 return InterpretContentLayer(node); 435 return InterpretContentLayer(node);
436 if (type == "CanvasLayer") 436 if (type == "CanvasLayer")
437 return InterpretCanvasLayer(node); 437 return InterpretCanvasLayer(node);
438 if (type == "VideoLayer") 438 if (type == "VideoLayer")
439 return InterpretVideoLayer(node); 439 return InterpretVideoLayer(node);
440 if (type == "ImageLayer") 440 if (type == "ImageLayer")
441 return InterpretImageLayer(node); 441 return InterpretImageLayer(node);
442 442
443 443
444 string outjson; 444 string outjson;
445 JSONWriter::WriteWithOptions(node, base::JSONWriter::OPTIONS_PRETTY_PRINT, 445 JSONWriter::WriteWithOptions(*node, base::JSONWriter::OPTIONS_PRETTY_PRINT,
446 &outjson); 446 &outjson);
447 LOG(ERROR) << "Unrecognized node type! JSON:\n\n" 447 LOG(ERROR) << "Unrecognized node type! JSON:\n\n"
448 "-----------------------\n" << 448 "-----------------------\n" <<
449 outjson << 449 outjson <<
450 "-----------------------"; 450 "-----------------------";
451 451
452 return NULL; 452 return NULL;
453 } 453 }
454 454
455 RenderNode* BuildRenderTreeFromFile(const base::FilePath& path) { 455 RenderNode* BuildRenderTreeFromFile(const base::FilePath& path) {
(...skipping 19 matching lines...) Expand all
475 base::DictionaryValue* v = static_cast<base::DictionaryValue*>(root.get()); 475 base::DictionaryValue* v = static_cast<base::DictionaryValue*>(root.get());
476 RenderNode* tree = InterpretContentLayer(v); 476 RenderNode* tree = InterpretContentLayer(v);
477 return tree; 477 return tree;
478 } else { 478 } else {
479 LOG(ERROR) << path.LossyDisplayName() << 479 LOG(ERROR) << path.LossyDisplayName() <<
480 " doesn not encode a JSON dictionary."; 480 " doesn not encode a JSON dictionary.";
481 return NULL; 481 return NULL;
482 } 482 }
483 } 483 }
484 484
OLDNEW
« no previous file with comments | « google_apis/gaia/fake_gaia.cc ('k') | ios/web/web_state/ui/crw_web_controller_observer_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698