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

Side by Side Diff: chrome/test/webdriver/commands/response.cc

Issue 7753020: Revert recent changes to base::Value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « chrome/test/webdriver/commands/response.h ('k') | chrome/test/webdriver/webdriver_dispatch.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 "chrome/test/webdriver/commands/response.h" 5 #include "chrome/test/webdriver/commands/response.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 28 matching lines...) Expand all
39 int status; 39 int status;
40 if (!data_.GetInteger(kStatusKey, &status)) 40 if (!data_.GetInteger(kStatusKey, &status))
41 NOTREACHED(); 41 NOTREACHED();
42 return static_cast<ErrorCode>(status); 42 return static_cast<ErrorCode>(status);
43 } 43 }
44 44
45 void Response::SetStatus(ErrorCode status) { 45 void Response::SetStatus(ErrorCode status) {
46 data_.SetInteger(kStatusKey, status); 46 data_.SetInteger(kStatusKey, status);
47 } 47 }
48 48
49 Value* Response::GetValue() const { 49 const Value* Response::GetValue() const {
50 Value* out = NULL; 50 Value* out = NULL;
51 LOG_IF(WARNING, !data_.Get(kValueKey, &out)) 51 LOG_IF(WARNING, !data_.Get(kValueKey, &out))
52 << "Accessing unset response value."; // Should never happen. 52 << "Accessing unset response value."; // Should never happen.
53 return out; 53 return out;
54 } 54 }
55 55
56 void Response::SetValue(Value* value) { 56 void Response::SetValue(Value* value) {
57 data_.Set(kValueKey, value); 57 data_.Set(kValueKey, value);
58 } 58 }
59 59
(...skipping 10 matching lines...) Expand all
70 data_.Set(key, value); 70 data_.Set(key, value);
71 } 71 }
72 72
73 std::string Response::ToJSON() const { 73 std::string Response::ToJSON() const {
74 std::string json; 74 std::string json;
75 base::JSONWriter::Write(&data_, false, &json); 75 base::JSONWriter::Write(&data_, false, &json);
76 return json; 76 return json;
77 } 77 }
78 78
79 } // namespace webdriver 79 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/response.h ('k') | chrome/test/webdriver/webdriver_dispatch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698