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

Side by Side Diff: ppapi/proxy/serialized_var.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) 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 | « ppapi/proxy/serialized_var.h ('k') | ui/base/clipboard/clipboard_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/proxy/serialized_var.h" 5 #include "ppapi/proxy/serialized_var.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "ipc/ipc_message_utils.h" 9 #include "ipc/ipc_message_utils.h"
10 #include "ppapi/proxy/dispatcher.h" 10 #include "ppapi/proxy/dispatcher.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 m->WriteInt64(var_.value.as_id); 140 m->WriteInt64(var_.value.as_id);
141 break; 141 break;
142 case PP_VARTYPE_ARRAY: 142 case PP_VARTYPE_ARRAY:
143 case PP_VARTYPE_DICTIONARY: 143 case PP_VARTYPE_DICTIONARY:
144 // TODO(brettw) when these are supported, implement this. 144 // TODO(brettw) when these are supported, implement this.
145 NOTIMPLEMENTED(); 145 NOTIMPLEMENTED();
146 break; 146 break;
147 } 147 }
148 } 148 }
149 149
150 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, void** iter) { 150 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m,
151 PickleIterator* iter) {
151 #ifndef NDEBUG 152 #ifndef NDEBUG
152 // We should only deserialize something once or will end up with leaked 153 // We should only deserialize something once or will end up with leaked
153 // references. 154 // references.
154 // 155 //
155 // One place this has happened in the past is using 156 // One place this has happened in the past is using
156 // std::vector<SerializedVar>.resize(). If you're doing this manually instead 157 // std::vector<SerializedVar>.resize(). If you're doing this manually instead
157 // of using the helper classes for handling in/out vectors of vars, be 158 // of using the helper classes for handling in/out vectors of vars, be
158 // sure you use the same pattern as the SerializedVarVector classes. 159 // sure you use the same pattern as the SerializedVarVector classes.
159 DCHECK(!has_been_deserialized_); 160 DCHECK(!has_been_deserialized_);
160 has_been_deserialized_ = true; 161 has_been_deserialized_ = true;
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); 515 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str));
515 } 516 }
516 517
517 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) 518 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var)
518 : SerializedVar(var) { 519 : SerializedVar(var) {
519 } 520 }
520 521
521 } // namespace proxy 522 } // namespace proxy
522 } // namespace ppapi 523 } // namespace ppapi
523 524
OLDNEW
« no previous file with comments | « ppapi/proxy/serialized_var.h ('k') | ui/base/clipboard/clipboard_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698