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

Side by Side Diff: third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp

Issue 2839053002: Image Capture: don't set PhotoCapabilities width/height if min/max are both zero (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/imagecapture/ImageCapture.h" 5 #include "modules/imagecapture/ImageCapture.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } else { 489 } else {
490 // Update the local capabilities cache. 490 // Update the local capabilities cache.
491 OnCapabilitiesUpdateInternal(*capabilities); 491 OnCapabilitiesUpdateInternal(*capabilities);
492 492
493 PhotoCapabilities* caps = PhotoCapabilities::Create(); 493 PhotoCapabilities* caps = PhotoCapabilities::Create();
494 494
495 caps->SetRedEyeReduction(capabilities->red_eye_reduction); 495 caps->SetRedEyeReduction(capabilities->red_eye_reduction);
496 // TODO(mcasas): Remove the explicit MediaSettingsRange::create() when 496 // TODO(mcasas): Remove the explicit MediaSettingsRange::create() when
497 // mojo::StructTraits supports garbage-collected mappings, 497 // mojo::StructTraits supports garbage-collected mappings,
498 // https://crbug.com/700180. 498 // https://crbug.com/700180.
499 caps->SetImageHeight( 499 if (capabilities->height->min != 0 || capabilities->height->max != 0) {
500 MediaSettingsRange::Create(std::move(capabilities->height))); 500 caps->SetImageHeight(
501 caps->SetImageWidth( 501 MediaSettingsRange::Create(std::move(capabilities->height)));
502 MediaSettingsRange::Create(std::move(capabilities->width))); 502 }
503 if (capabilities->width->min != 0 || capabilities->width->max != 0) {
504 caps->SetImageWidth(
505 MediaSettingsRange::Create(std::move(capabilities->width)));
506 }
503 caps->SetFillLightMode(capabilities->fill_light_mode); 507 caps->SetFillLightMode(capabilities->fill_light_mode);
504 508
505 resolver->Resolve(caps); 509 resolver->Resolve(caps);
506 } 510 }
507 service_requests_.erase(resolver); 511 service_requests_.erase(resolver);
508 } 512 }
509 513
510 void ImageCapture::OnSetOptions(ScriptPromiseResolver* resolver, bool result) { 514 void ImageCapture::OnSetOptions(ScriptPromiseResolver* resolver, bool result) {
511 if (!service_requests_.Contains(resolver)) 515 if (!service_requests_.Contains(resolver))
512 return; 516 return;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 visitor->Trace(stream_track_); 657 visitor->Trace(stream_track_);
654 visitor->Trace(capabilities_); 658 visitor->Trace(capabilities_);
655 visitor->Trace(settings_); 659 visitor->Trace(settings_);
656 visitor->Trace(current_constraints_); 660 visitor->Trace(current_constraints_);
657 visitor->Trace(service_requests_); 661 visitor->Trace(service_requests_);
658 EventTargetWithInlineData::Trace(visitor); 662 EventTargetWithInlineData::Trace(visitor);
659 ContextLifecycleObserver::Trace(visitor); 663 ContextLifecycleObserver::Trace(visitor);
660 } 664 }
661 665
662 } // namespace blink 666 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698