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

Side by Side Diff: mojo/dart/embedder/io/filter.h

Issue 1786473004: Rolls Dart runtime forward. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: whitespace Created 4 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
« no previous file with comments | « mojo/dart/embedder/common.cc ('k') | mojo/dart/embedder/io/filter.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 MOJO_DART_EMBEDDER_IO_FILTER_H_ 5 #ifndef MOJO_DART_EMBEDDER_IO_FILTER_H_
6 #define MOJO_DART_EMBEDDER_IO_FILTER_H_ 6 #define MOJO_DART_EMBEDDER_IO_FILTER_H_
7 7
8 #include "dart/runtime/include/dart_api.h" 8 #include "dart/runtime/include/dart_api.h"
9 #include "mojo/public/cpp/system/macros.h" 9 #include "mojo/public/cpp/system/macros.h"
10 #include "third_party/zlib/zlib.h" 10 #include "third_party/zlib/zlib.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 namespace dart { 13 namespace dart {
14 14
15 class Filter { 15 class Filter {
16 public: 16 public:
17 virtual ~Filter() {} 17 virtual ~Filter() {}
18 18
19 virtual bool Init() = 0; 19 virtual bool Init() = 0;
20 20
21 /** 21 /**
22 * On a successful call to Process, Process will take ownership of data. On 22 * On a successful call to Process, Process will take ownership of data. On
23 * successive calls to either Processed or ~Filter, data will be freed with 23 * successive calls to either Processed or ~Filter, data will be freed with
24 * a delete[] call. 24 * a delete[] call.
25 */ 25 */
26 virtual bool Process(uint8_t* data, intptr_t length) = 0; 26 virtual bool Process(uint8_t* data, intptr_t length) = 0;
27 virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish, 27 virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
28 bool end) = 0; 28 bool end) = 0;
29 29
30 static Dart_Handle SetFilterPointerNativeField(Dart_Handle filter, 30 static Dart_Handle SetFilterAndCreateFinalizer(Dart_Handle filter,
31 Filter* filter_pointer); 31 Filter* filter_pointer,
32 static Dart_Handle GetFilterPointerNativeField(Dart_Handle filter, 32 intptr_t filter_size);
33 Filter** filter_pointer); 33 static Dart_Handle GetFilterNativeField(Dart_Handle filter,
34 Filter** filter_pointer);
34 35
35 bool initialized() const { return initialized_; } 36 bool initialized() const { return initialized_; }
36 void set_initialized(bool value) { initialized_ = value; } 37 void set_initialized(bool value) { initialized_ = value; }
37 uint8_t* processed_buffer() { return processed_buffer_; } 38 uint8_t* processed_buffer() { return processed_buffer_; }
38 intptr_t processed_buffer_size() const { return kFilterBufferSize; } 39 intptr_t processed_buffer_size() const { return kFilterBufferSize; }
39 40
40 protected: 41 protected:
41 Filter() : initialized_(false) {} 42 Filter() : initialized_(false) {}
42 43
43 private: 44 private:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 uint8_t* current_buffer_; 102 uint8_t* current_buffer_;
102 z_stream stream_; 103 z_stream stream_;
103 104
104 MOJO_DISALLOW_COPY_AND_ASSIGN(ZLibInflateFilter); 105 MOJO_DISALLOW_COPY_AND_ASSIGN(ZLibInflateFilter);
105 }; 106 };
106 107
107 } // namespace dart 108 } // namespace dart
108 } // namespace mojo 109 } // namespace mojo
109 110
110 #endif // MOJO_DART_EMBEDDER_IO_FILTER_H_ 111 #endif // MOJO_DART_EMBEDDER_IO_FILTER_H_
OLDNEW
« no previous file with comments | « mojo/dart/embedder/common.cc ('k') | mojo/dart/embedder/io/filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698