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

Side by Side Diff: content/renderer/presentation/presentation_dispatcher.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
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/renderer/presentation/presentation_dispatcher.h" 5 #include "content/renderer/presentation/presentation_dispatcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 blink::WebPresentationError::ErrorType GetWebPresentationErrorTypeFromMojo( 48 blink::WebPresentationError::ErrorType GetWebPresentationErrorTypeFromMojo(
49 blink::mojom::PresentationErrorType mojoErrorType) { 49 blink::mojom::PresentationErrorType mojoErrorType) {
50 switch (mojoErrorType) { 50 switch (mojoErrorType) {
51 case blink::mojom::PresentationErrorType::NO_AVAILABLE_SCREENS: 51 case blink::mojom::PresentationErrorType::NO_AVAILABLE_SCREENS:
52 return blink::WebPresentationError::ErrorTypeNoAvailableScreens; 52 return blink::WebPresentationError::ErrorTypeNoAvailableScreens;
53 case blink::mojom::PresentationErrorType::SESSION_REQUEST_CANCELLED: 53 case blink::mojom::PresentationErrorType::SESSION_REQUEST_CANCELLED:
54 return blink::WebPresentationError::ErrorTypeSessionRequestCancelled; 54 return blink::WebPresentationError::ErrorTypeSessionRequestCancelled;
55 case blink::mojom::PresentationErrorType::NO_PRESENTATION_FOUND: 55 case blink::mojom::PresentationErrorType::NO_PRESENTATION_FOUND:
56 return blink::WebPresentationError::ErrorTypeNoPresentationFound; 56 return blink::WebPresentationError::ErrorTypeNoPresentationFound;
57 case blink::mojom::PresentationErrorType::PREVIOUS_START_IN_PROGRESS:
58 return blink::WebPresentationError::ErrorTypePreviousStartInProgress;
57 case blink::mojom::PresentationErrorType::UNKNOWN: 59 case blink::mojom::PresentationErrorType::UNKNOWN:
58 default: 60 default:
59 return blink::WebPresentationError::ErrorTypeUnknown; 61 return blink::WebPresentationError::ErrorTypeUnknown;
60 } 62 }
61 } 63 }
62 64
63 blink::WebPresentationConnectionState GetWebPresentationConnectionStateFromMojo( 65 blink::WebPresentationConnectionState GetWebPresentationConnectionStateFromMojo(
64 blink::mojom::PresentationConnectionState mojoSessionState) { 66 blink::mojom::PresentationConnectionState mojoSessionState) {
65 switch (mojoSessionState) { 67 switch (mojoSessionState) {
66 case blink::mojom::PresentationConnectionState::CONNECTING: 68 case blink::mojom::PresentationConnectionState::CONNECTING:
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( 571 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus(
570 const GURL& availability_url) 572 const GURL& availability_url)
571 : url(availability_url), 573 : url(availability_url),
572 last_known_availability(false), 574 last_known_availability(false),
573 listening_state(ListeningState::INACTIVE) {} 575 listening_state(ListeningState::INACTIVE) {}
574 576
575 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { 577 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() {
576 } 578 }
577 579
578 } // namespace content 580 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/presentation_session.h ('k') | third_party/WebKit/LayoutTests/presentation/presentation-start.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698