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

Side by Side Diff: chrome/browser/extensions/api/serial/serial_api.h

Issue 10392181: Implement serial API for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: From -> At. Created 8 years, 6 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_EXTENSIONS_API_SERIAL_SERIAL_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 protected: 42 protected:
43 virtual ~SerialOpenFunction() {} 43 virtual ~SerialOpenFunction() {}
44 44
45 // AsyncAPIFunction: 45 // AsyncAPIFunction:
46 virtual bool Prepare() OVERRIDE; 46 virtual bool Prepare() OVERRIDE;
47 virtual void AsyncWorkStart() OVERRIDE; 47 virtual void AsyncWorkStart() OVERRIDE;
48 virtual void Work() OVERRIDE; 48 virtual void Work() OVERRIDE;
49 virtual bool Respond() OVERRIDE; 49 virtual bool Respond() OVERRIDE;
50 50
51 private: 51 private:
52 void OpenPortOnIOThread();
53
54 int src_id_; 52 int src_id_;
55 std::string port_; 53 std::string port_;
56 54
57 // SerialConnection will take ownership. 55 // SerialConnection will take ownership.
58 APIResourceEventNotifier* event_notifier_; 56 APIResourceEventNotifier* event_notifier_;
59 }; 57 };
60 58
61 class SerialCloseFunction : public AsyncAPIFunction { 59 class SerialCloseFunction : public AsyncAPIFunction {
62 public: 60 public:
63 DECLARE_EXTENSION_FUNCTION_NAME("experimental.serial.close") 61 DECLARE_EXTENSION_FUNCTION_NAME("experimental.serial.close")
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 protected: 97 protected:
100 virtual ~SerialWriteFunction(); 98 virtual ~SerialWriteFunction();
101 99
102 // AsyncAPIFunction: 100 // AsyncAPIFunction:
103 virtual bool Prepare() OVERRIDE; 101 virtual bool Prepare() OVERRIDE;
104 virtual void Work() OVERRIDE; 102 virtual void Work() OVERRIDE;
105 virtual bool Respond() OVERRIDE; 103 virtual bool Respond() OVERRIDE;
106 104
107 private: 105 private:
108 int connection_id_; 106 int connection_id_;
109 scoped_refptr<net::IOBufferWithSize> io_buffer_; 107 scoped_refptr<net::IOBuffer> io_buffer_;
108 size_t io_buffer_size_;
110 }; 109 };
111 110
112 } // namespace extensions 111 } // namespace extensions
113 112
114 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_ 113 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/api_resource_controller.cc ('k') | chrome/browser/extensions/api/serial/serial_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698