summaryrefslogtreecommitdiffstats
path: root/content/browser/presentation/presentation_service_impl.h
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2015-04-10 15:53:32 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-10 22:53:53 +0000
commitc4010b0b30bb37e0a6916c3fb8eb97d44b024292 (patch)
treed1a6a6d53a98c81c80137c34c28a34c0312bf808 /content/browser/presentation/presentation_service_impl.h
parentf67e4665f60197fa7aa06b3213eea5fbe716d8dd (diff)
downloadchromium_src-c4010b0b30bb37e0a6916c3fb8eb97d44b024292.zip
chromium_src-c4010b0b30bb37e0a6916c3fb8eb97d44b024292.tar.gz
chromium_src-c4010b0b30bb37e0a6916c3fb8eb97d44b024292.tar.bz2
Update mojo sdk to rev d459e688a608f6eda850a23bb5e308a76ea51a47
BUG=None TBR=jamesr@chromium.org Review URL: https://codereview.chromium.org/1051303002 Cr-Commit-Position: refs/heads/master@{#324704}
Diffstat (limited to 'content/browser/presentation/presentation_service_impl.h')
-rw-r--r--content/browser/presentation/presentation_service_impl.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/content/browser/presentation/presentation_service_impl.h b/content/browser/presentation/presentation_service_impl.h
index 5b4972d..84962e7 100644
--- a/content/browser/presentation/presentation_service_impl.h
+++ b/content/browser/presentation/presentation_service_impl.h
@@ -110,15 +110,24 @@ class CONTENT_EXPORT PresentationServiceImpl
};
// Context for a StartSession request.
- struct CONTENT_EXPORT StartSessionRequest {
+ class CONTENT_EXPORT StartSessionRequest {
+ public:
StartSessionRequest(const std::string& presentation_url,
const std::string& presentation_id,
const NewSessionMojoCallback& callback);
~StartSessionRequest();
- const std::string presentation_url;
- const std::string presentation_id;
- const NewSessionMojoCallback callback;
+ // Retrieves the pending callback from this request, transferring ownership
+ // to the caller.
+ NewSessionMojoCallback PassCallback();
+
+ const std::string& presentation_url() const { return presentation_url_; }
+ const std::string& presentation_id() const { return presentation_id_; }
+
+ private:
+ const std::string presentation_url_;
+ const std::string presentation_id_;
+ NewSessionMojoCallback callback_;
};
friend class PresentationServiceImplTest;
@@ -235,8 +244,11 @@ class CONTENT_EXPORT PresentationServiceImpl
int RegisterNewSessionCallback(
const NewSessionMojoCallback& callback);
+ // Flushes all pending new session callbacks with error responses.
+ void FlushNewSessionCallbacks();
+
// Invokes |callback| with an error.
- void InvokeNewSessionMojoCallbackWithError(
+ static void InvokeNewSessionMojoCallbackWithError(
const NewSessionMojoCallback& callback);
// Gets the ScreenAvailabilityContext for |presentation_url|, or creates one
@@ -259,6 +271,9 @@ class CONTENT_EXPORT PresentationServiceImpl
// it is removed from head of the queue.
std::deque<linked_ptr<StartSessionRequest>> queued_start_session_requests_;
+ // Indicates that a StartSession request is currently being processed.
+ bool is_start_session_pending_;
+
int next_request_session_id_;
base::hash_map<int, linked_ptr<NewSessionMojoCallback>> pending_session_cbs_;