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

Side by Side Diff: chrome/browser/sessions/compress_data_helper.h

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
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 #ifndef CHROME_BROWSER_SESSIONS_COMPRESS_DATA_HELPER_H_ 5 #ifndef CHROME_BROWSER_SESSIONS_COMPRESS_DATA_HELPER_H_
6 #define CHROME_BROWSER_SESSIONS_COMPRESS_DATA_HELPER_H_ 6 #define CHROME_BROWSER_SESSIONS_COMPRESS_DATA_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
11 #include <string> 11 #include <string>
12 12
13 class Pickle; 13 class Pickle;
14 class PickleIterator;
14 15
15 class CompressDataHelper { 16 class CompressDataHelper {
16 public: 17 public:
17 // Compresses and writes |str| into |pickle|. |str| may contain NULL 18 // Compresses and writes |str| into |pickle|. |str| may contain NULL
18 // charaters. 19 // charaters.
19 static void CompressAndWriteStringToPickle(const std::string& str, 20 static void CompressAndWriteStringToPickle(const std::string& str,
20 int max_bytes, 21 int max_bytes,
21 Pickle* pickle, 22 Pickle* pickle,
22 int* bytes_written); 23 int* bytes_written);
23 24
24 // Reads and decompresses a string from |pickle| and saves it to |str|. |iter| 25 // Reads and decompresses a string from |pickle| and saves it to |str|. |iter|
25 // indicates the position of the data. The same iterator is used by 26 // indicates the position of the data. The same iterator is used by
26 // Pickle::Read* functions. 27 // Pickle::Read* functions.
27 static bool ReadAndDecompressStringFromPickle(const Pickle& pickle, 28 static bool ReadAndDecompressStringFromPickle(const Pickle& pickle,
28 void** iter, 29 PickleIterator* iter,
29 std::string* str); 30 std::string* str);
30 private: 31 private:
31 DISALLOW_IMPLICIT_CONSTRUCTORS(CompressDataHelper); 32 DISALLOW_IMPLICIT_CONSTRUCTORS(CompressDataHelper);
32 }; 33 };
33 34
34 #endif // CHROME_BROWSER_SESSIONS_COMPRESS_DATA_HELPER_H_ 35 #endif // CHROME_BROWSER_SESSIONS_COMPRESS_DATA_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/base_session_service.cc ('k') | chrome/browser/sessions/compress_data_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698