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

Side by Side Diff: chrome/test/chromedriver/server/http_handler.cc

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/server/http_handler.h" 5 #include "chrome/test/chromedriver/server/http_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 "Driver info: chromedriver=%s,platform=%s %s %s", 694 "Driver info: chromedriver=%s,platform=%s %s %s",
695 kChromeDriverVersion, 695 kChromeDriverVersion,
696 base::SysInfo::OperatingSystemName().c_str(), 696 base::SysInfo::OperatingSystemName().c_str(),
697 base::SysInfo::OperatingSystemVersion().c_str(), 697 base::SysInfo::OperatingSystemVersion().c_str(),
698 base::SysInfo::OperatingSystemArchitecture().c_str())); 698 base::SysInfo::OperatingSystemArchitecture().c_str()));
699 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); 699 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue());
700 error->SetString("message", full_status.message()); 700 error->SetString("message", full_status.message());
701 value.reset(error.release()); 701 value.reset(error.release());
702 } 702 }
703 if (!value) 703 if (!value)
704 value.reset(base::Value::CreateNullValue()); 704 value = base::Value::CreateNullValue();
705 705
706 base::DictionaryValue body_params; 706 base::DictionaryValue body_params;
707 body_params.SetInteger("status", status.code()); 707 body_params.SetInteger("status", status.code());
708 body_params.Set("value", value.release()); 708 body_params.Set("value", value.release());
709 body_params.SetString("sessionId", session_id); 709 body_params.SetString("sessionId", session_id);
710 std::string body; 710 std::string body;
711 base::JSONWriter::WriteWithOptions( 711 base::JSONWriter::WriteWithOptions(
712 &body_params, base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION, 712 &body_params, base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION,
713 &body); 713 &body);
714 scoped_ptr<net::HttpServerResponseInfo> response( 714 scoped_ptr<net::HttpServerResponseInfo> response(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 params.SetString(name, path_parts[i]); 762 params.SetString(name, path_parts[i]);
763 } else if (command_path_parts[i] != path_parts[i]) { 763 } else if (command_path_parts[i] != path_parts[i]) {
764 return false; 764 return false;
765 } 765 }
766 } 766 }
767 out_params->MergeDictionary(&params); 767 out_params->MergeDictionary(&params);
768 return true; 768 return true;
769 } 769 }
770 770
771 } // namespace internal 771 } // namespace internal
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/commands_unittest.cc ('k') | components/dom_distiller/content/distiller_page_web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698