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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create 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 | « ipc/ipc_message_unittest.cc ('k') | no next file » | 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 "ipc/ipc_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/nullable_string16.h" 10 #include "base/nullable_string16.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 LOG(WARNING) << "Max recursion depth hit in ReadValue."; 144 LOG(WARNING) << "Max recursion depth hit in ReadValue.";
145 return false; 145 return false;
146 } 146 }
147 147
148 int type; 148 int type;
149 if (!ReadParam(m, iter, &type)) 149 if (!ReadParam(m, iter, &type))
150 return false; 150 return false;
151 151
152 switch (type) { 152 switch (type) {
153 case Value::TYPE_NULL: 153 case Value::TYPE_NULL:
154 *value = Value::CreateNullValue(); 154 *value = base::NullValue();
155 break; 155 break;
156 case Value::TYPE_BOOLEAN: { 156 case Value::TYPE_BOOLEAN: {
157 bool val; 157 bool val;
158 if (!ReadParam(m, iter, &val)) 158 if (!ReadParam(m, iter, &val))
159 return false; 159 return false;
160 *value = Value::CreateBooleanValue(val); 160 *value = Value::CreateBooleanValue(val);
161 break; 161 break;
162 } 162 }
163 case Value::TYPE_INTEGER: { 163 case Value::TYPE_INTEGER: {
164 int val; 164 int val;
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 ReadParam(m, iter, &r->flags) && 469 ReadParam(m, iter, &r->flags) &&
470 ReadParam(m, iter, &r->sent) && 470 ReadParam(m, iter, &r->sent) &&
471 ReadParam(m, iter, &r->receive) && 471 ReadParam(m, iter, &r->receive) &&
472 ReadParam(m, iter, &r->dispatch) && 472 ReadParam(m, iter, &r->dispatch) &&
473 ReadParam(m, iter, &r->params); 473 ReadParam(m, iter, &r->params);
474 r->type = static_cast<uint16>(type); 474 r->type = static_cast<uint16>(type);
475 return result; 475 return result;
476 } 476 }
477 477
478 } // namespace IPC 478 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_message_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698