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

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

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/webui/web_ui_impl.cc ('k') | ipc/ipc_message_utils.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_path.h" 10 #include "base/file_path.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 return InterpretContentLayer(node); 434 return InterpretContentLayer(node);
435 if (type == "CanvasLayer") 435 if (type == "CanvasLayer")
436 return InterpretCanvasLayer(node); 436 return InterpretCanvasLayer(node);
437 if (type == "VideoLayer") 437 if (type == "VideoLayer")
438 return InterpretVideoLayer(node); 438 return InterpretVideoLayer(node);
439 if (type == "ImageLayer") 439 if (type == "ImageLayer")
440 return InterpretImageLayer(node); 440 return InterpretImageLayer(node);
441 441
442 442
443 string outjson; 443 string outjson;
444 JSONWriter::Write(node, true, &outjson); 444 JSONWriter::WriteWithOptions(node, base::JSONWriter::OPTIONS_PRETTY_PRINT,
445 &outjson);
445 LOG(ERROR) << "Unrecognized node type! JSON:\n\n" 446 LOG(ERROR) << "Unrecognized node type! JSON:\n\n"
446 "-----------------------\n" << 447 "-----------------------\n" <<
447 outjson << 448 outjson <<
448 "-----------------------"; 449 "-----------------------";
449 450
450 return NULL; 451 return NULL;
451 } 452 }
452 453
453 RenderNode* BuildRenderTreeFromFile(const FilePath& path) { 454 RenderNode* BuildRenderTreeFromFile(const FilePath& path) {
454 LOG(INFO) << "Reading " << path.LossyDisplayName(); 455 LOG(INFO) << "Reading " << path.LossyDisplayName();
(...skipping 18 matching lines...) Expand all
473 DictionaryValue* v = static_cast<DictionaryValue*>(root.get()); 474 DictionaryValue* v = static_cast<DictionaryValue*>(root.get());
474 RenderNode* tree = InterpretContentLayer(v); 475 RenderNode* tree = InterpretContentLayer(v);
475 return tree; 476 return tree;
476 } else { 477 } else {
477 LOG(ERROR) << path.LossyDisplayName() << 478 LOG(ERROR) << path.LossyDisplayName() <<
478 " doesn not encode a JSON dictionary."; 479 " doesn not encode a JSON dictionary.";
479 return NULL; 480 return NULL;
480 } 481 }
481 } 482 }
482 483
OLDNEW
« no previous file with comments | « content/browser/webui/web_ui_impl.cc ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698