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

Unified Diff: content/browser/webui/i18n_source_stream.h

Issue 2601313002: [MD settings] stream i18n replacement without large accumulation buffer (Closed)
Patch Set: sacrificing 0.9 msec for simplicity (vs. Patch Set 2) Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/webui/i18n_source_stream.h
diff --git a/content/browser/webui/i18n_source_stream.h b/content/browser/webui/i18n_source_stream.h
index 0f37d874869a2f6e9737af88fa193d8266a89b0e..08b5fe7ac0ed69de2195b5cb800463614f3d6c07 100644
--- a/content/browser/webui/i18n_source_stream.h
+++ b/content/browser/webui/i18n_source_stream.h
@@ -40,15 +40,16 @@ class CONTENT_EXPORT I18nSourceStream : public net::FilterSourceStream {
int* consumed_bytes,
bool upstream_end_reached) override;
- // Accumulated from upstream.
+ // Keep split $i18n tags until we have the whole tag. This is expected to vary
mmenke 2017/01/03 16:47:16 nit: Should avoid "we" in comments, since it's of
dschuyler 2017/01/03 20:37:34 Done.
+ // in size from 0 to a few KB and should never be larger than the input file
+ // (in the worst case).
std::string input_;
- // To send downstream.
+ // Keep excess that didn't fit in the output buffer. This is expected to vary
+ // in size from 0 to a few KB and should never get much larger than the input
+ // file (in the worst case).
std::string output_;
- // How much of the |output_| has been sent.
- size_t drain_offset_;
-
// A map of i18n replacement keys and translations.
const ui::TemplateReplacements* replacements_; // weak
« no previous file with comments | « no previous file | content/browser/webui/i18n_source_stream.cc » ('j') | content/browser/webui/i18n_source_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698