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

Side by Side Diff: content/browser/presentation/presentation_service_impl.cc

Issue 2647723002: [Presentation API] reject request.start() with OperationError instead of UnknownError if previous s… (Closed)
Patch Set: add layout test for PREVIOUS_START_IN_PROGRESS error Created 3 years, 11 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 | « no previous file | content/browser/presentation/presentation_type_converters.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/browser/presentation/presentation_service_impl.h" 5 #include "content/browser/presentation/presentation_service_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 NOTREACHED() << "Invalid presentation message type " << input->type; 104 NOTREACHED() << "Invalid presentation message type " << input->type;
105 return output; 105 return output;
106 } 106 }
107 107
108 void InvokeNewSessionCallbackWithError( 108 void InvokeNewSessionCallbackWithError(
109 const PresentationServiceImpl::NewSessionCallback& callback) { 109 const PresentationServiceImpl::NewSessionCallback& callback) {
110 callback.Run(blink::mojom::PresentationSessionInfoPtr(), 110 callback.Run(blink::mojom::PresentationSessionInfoPtr(),
111 blink::mojom::PresentationError::From(PresentationError( 111 blink::mojom::PresentationError::From(PresentationError(
112 PRESENTATION_ERROR_UNKNOWN, "Internal error"))); 112 PRESENTATION_ERROR_PREVIOUS_START_IN_PROGRESS,
113 "There is already an unsettled Promise from a previous call "
114 "to start.")));
113 } 115 }
114 116
115 } // namespace 117 } // namespace
116 118
117 PresentationServiceImpl::PresentationServiceImpl( 119 PresentationServiceImpl::PresentationServiceImpl(
118 RenderFrameHost* render_frame_host, 120 RenderFrameHost* render_frame_host,
119 WebContents* web_contents, 121 WebContents* web_contents,
120 ControllerPresentationServiceDelegate* controller_delegate, 122 ControllerPresentationServiceDelegate* controller_delegate,
121 ReceiverPresentationServiceDelegate* receiver_delegate) 123 ReceiverPresentationServiceDelegate* receiver_delegate)
122 : WebContentsObserver(web_contents), 124 : WebContentsObserver(web_contents),
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 659
658 void PresentationServiceImpl::NewSessionCallbackWrapper::Run( 660 void PresentationServiceImpl::NewSessionCallbackWrapper::Run(
659 blink::mojom::PresentationSessionInfoPtr session, 661 blink::mojom::PresentationSessionInfoPtr session,
660 blink::mojom::PresentationErrorPtr error) { 662 blink::mojom::PresentationErrorPtr error) {
661 DCHECK(!callback_.is_null()); 663 DCHECK(!callback_.is_null());
662 callback_.Run(std::move(session), std::move(error)); 664 callback_.Run(std::move(session), std::move(error));
663 callback_.Reset(); 665 callback_.Reset();
664 } 666 }
665 667
666 } // namespace content 668 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/presentation/presentation_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698