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

Side by Side Diff: chrome/browser/password_manager/proxy/message_reader.h

Issue 8509038: Linux: split GNOME Keyring integration into a separate process. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: everything works Created 9 years, 1 month 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PROXY_MESSAGE_READER_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PROXY_MESSAGE_READER_H_
7 #pragma once
8
9 #include <string>
10 #include <vector>
11
12 // This class handles reading bits and pieces of input data and assembling them
13 // into a set of newline-delimited lines. Each message is terminated by a blank
14 // line. (Think HTTP, SMTP, etc.)
15 // It is used in the (tiny) helper binary as well as the browser process, so it
16 // must not have any dependencies beyond standard libraries.
17 class MessageReader {
18 public:
19 MessageReader() : is_complete_(false) { lines_.resize(1); }
vandebo (ex-Chrome) 2011/12/01 19:57:30 Put this in the implementation file.
20
21 // Returns the number of characters actually used; on end-of-message,
22 // this may be smaller than |size|, but should otherwise be equal.
23 // It is an error to call HandleData() if is_complete() would return true.
24 size_t HandleData(const char* data, size_t size);
25
26 bool is_complete() const { return is_complete_; }
27 const std::vector<std::string>& lines() const { return lines_; }
28
29 // Resets internal state so the reader will be ready for another message.
30 void Reset() {
vandebo (ex-Chrome) 2011/12/01 19:57:30 Put this in the implementation file.
31 lines_.clear();
32 lines_.resize(1);
33 is_complete_ = false;
34 }
35
36 private:
37 bool is_complete_;
38 std::vector<std::string> lines_;
39 };
40
41 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PROXY_MESSAGE_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698