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

Unified Diff: chrome/browser/media/router/create_session_request.cc

Issue 1224093004: [Media Router] 2nd take on fix route response callback lifetime in UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/create_session_request.cc
diff --git a/chrome/browser/media/router/create_session_request.cc b/chrome/browser/media/router/create_session_request.cc
deleted file mode 100644
index c9516cd7e0b43cbea6420fc3e2a98fd9bb0a93f4..0000000000000000000000000000000000000000
--- a/chrome/browser/media/router/create_session_request.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015 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.
-
-#include "chrome/browser/media/router/create_session_request.h"
-
-#include "chrome/browser/media/router/media_source_helper.h"
-
-using content::PresentationSessionInfo;
-using content::PresentationError;
-
-namespace media_router {
-
-CreateSessionRequest::CreateSessionRequest(
- const std::string& presentation_url,
- const std::string& presentation_id,
- const GURL& frame_url,
- const PresentationSessionSuccessCallback& success_cb,
- const PresentationSessionErrorCallback& error_cb)
- : presentation_info_(presentation_url, presentation_id),
- media_source_(presentation_url),
- frame_url_(frame_url),
- success_cb_(success_cb),
- error_cb_(error_cb),
- cb_invoked_(false) {
-}
-
-CreateSessionRequest::~CreateSessionRequest() {
-}
-
-void CreateSessionRequest::MaybeInvokeSuccessCallback(
- const MediaRoute::Id& route_id) {
- if (!cb_invoked_) {
- // Overwrite presentation ID.
- success_cb_.Run(content::PresentationSessionInfo(
- presentation_info_.presentation_url,
- GetPresentationIdAndUrl(route_id).first),
- route_id);
- cb_invoked_ = true;
- }
-}
-
-void CreateSessionRequest::MaybeInvokeErrorCallback(
- const content::PresentationError& error) {
- if (!cb_invoked_) {
- error_cb_.Run(error);
- cb_invoked_ = true;
- }
-}
-
-} // namespace media_router
« no previous file with comments | « chrome/browser/media/router/create_session_request.h ('k') | chrome/browser/media/router/create_session_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698