summaryrefslogtreecommitdiffstats
path: root/mojo/shell/data_pipe_peek.h
diff options
context:
space:
mode:
authorben <ben@chromium.org>2015-04-27 14:52:57 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-27 21:52:56 +0000
commitee05293936b654dfbc42889ba374bba21bd5c453 (patch)
treede694f31a0a2f21e60750a9b92902127f08293fc /mojo/shell/data_pipe_peek.h
parent9cfdfc07ef3042e059d5a51a91cbe4f13cfca341 (diff)
downloadchromium_src-ee05293936b654dfbc42889ba374bba21bd5c453.zip
chromium_src-ee05293936b654dfbc42889ba374bba21bd5c453.tar.gz
chromium_src-ee05293936b654dfbc42889ba374bba21bd5c453.tar.bz2
Separate mojo/shell into a runner and the application manager (shell)
R=sky@chromium.org BUG= Review URL: https://codereview.chromium.org/1091513005 Cr-Commit-Position: refs/heads/master@{#327148}
Diffstat (limited to 'mojo/shell/data_pipe_peek.h')
-rw-r--r--mojo/shell/data_pipe_peek.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/mojo/shell/data_pipe_peek.h b/mojo/shell/data_pipe_peek.h
new file mode 100644
index 0000000..0bcf1dd
--- /dev/null
+++ b/mojo/shell/data_pipe_peek.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SHELL_DATA_PIPE_PEEK_H_
+#define MOJO_SHELL_DATA_PIPE_PEEK_H_
+
+#include <string>
+
+#include "mojo/public/cpp/system/core.h"
+
+namespace mojo {
+namespace shell {
+
+// The Peek functions are only intended to be used by the
+// DyanmicApplicationLoader class for discovering the type of a
+// URL response. They are a stopgap to be replaced by real support
+// in the DataPipe classes.
+
+// Return true and the first newline terminated line from source. Return false
+// if more than max_line_length bytes are scanned without seeing a newline, or
+// if the timeout is exceeded.
+bool BlockingPeekLine(DataPipeConsumerHandle source,
+ std::string* line,
+ size_t max_line_length,
+ MojoDeadline timeout);
+
+// Return true and the first bytes_length bytes from source. Return false
+// if the timeout is exceeded.
+bool BlockingPeekNBytes(DataPipeConsumerHandle source,
+ std::string* bytes,
+ size_t bytes_length,
+ MojoDeadline timeout);
+
+} // namespace shell
+} // namespace mojo
+
+#endif // MOJO_SHELL_DATA_PIPE_PEEK_H_