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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 441008: Many changes to DictionaryValues:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 11
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 break; 54 break;
55 } 55 }
56 case Value::TYPE_BINARY: { 56 case Value::TYPE_BINARY: {
57 const BinaryValue* binary = static_cast<const BinaryValue*>(value); 57 const BinaryValue* binary = static_cast<const BinaryValue*>(value);
58 m->WriteData(binary->GetBuffer(), binary->GetSize()); 58 m->WriteData(binary->GetBuffer(), binary->GetSize());
59 break; 59 break;
60 } 60 }
61 case Value::TYPE_DICTIONARY: { 61 case Value::TYPE_DICTIONARY: {
62 const DictionaryValue* dict = static_cast<const DictionaryValue*>(value); 62 const DictionaryValue* dict = static_cast<const DictionaryValue*>(value);
63 63
64 WriteParam(m, static_cast<int>(dict->GetSize())); 64 WriteParam(m, static_cast<int>(dict->size()));
65 65
66 for (DictionaryValue::key_iterator it = dict->begin_keys(); 66 for (DictionaryValue::key_iterator it = dict->begin_keys();
67 it != dict->end_keys(); ++it) { 67 it != dict->end_keys(); ++it) {
68 Value* subval; 68 Value* subval;
69 if (dict->Get(*it, &subval)) { 69 if (dict->GetWithoutPathExpansion(*it, &subval)) {
70 WriteParam(m, *it); 70 WriteParam(m, *it);
71 WriteValue(m, subval, recursion + 1); 71 WriteValue(m, subval, recursion + 1);
72 } else { 72 } else {
73 NOTREACHED() << "DictionaryValue iterators are filthy liars."; 73 NOTREACHED() << "DictionaryValue iterators are filthy liars.";
74 } 74 }
75 } 75 }
76 break; 76 break;
77 } 77 }
78 case Value::TYPE_LIST: { 78 case Value::TYPE_LIST: {
79 const ListValue* list = static_cast<const ListValue*>(value); 79 const ListValue* list = static_cast<const ListValue*>(value);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 return ReadListValue(m, iter, r, 0); 233 return ReadListValue(m, iter, r, 0);
234 } 234 }
235 235
236 void ParamTraits<ListValue>::Log(const param_type& p, std::wstring* l) { 236 void ParamTraits<ListValue>::Log(const param_type& p, std::wstring* l) {
237 std::string json; 237 std::string json;
238 base::JSONWriter::Write(&p, false, &json); 238 base::JSONWriter::Write(&p, false, &json);
239 l->append(UTF8ToWide(json)); 239 l->append(UTF8ToWide(json));
240 } 240 }
241 } // namespace IPC 241 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698