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

Side by Side Diff: third_party/WebKit/Source/modules/geolocation/Geolocation.cpp

Issue 2241273005: Ignore mojo connection errors during shutdown in Geolocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. 3 * Copyright (C) 2009 Torch Mobile, Inc.
4 * Copyright 2010, The Android Open Source Project 4 * Copyright 2010, The Android Open Source Project
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 17 matching lines...) Expand all
28 #include "modules/geolocation/Geolocation.h" 28 #include "modules/geolocation/Geolocation.h"
29 29
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/frame/Deprecation.h" 31 #include "core/frame/Deprecation.h"
32 #include "core/frame/HostsUsingFeatures.h" 32 #include "core/frame/HostsUsingFeatures.h"
33 #include "core/frame/Settings.h" 33 #include "core/frame/Settings.h"
34 #include "modules/geolocation/Coordinates.h" 34 #include "modules/geolocation/Coordinates.h"
35 #include "modules/geolocation/GeolocationError.h" 35 #include "modules/geolocation/GeolocationError.h"
36 #include "platform/UserGestureIndicator.h" 36 #include "platform/UserGestureIndicator.h"
37 #include "platform/mojo/MojoHelper.h" 37 #include "platform/mojo/MojoHelper.h"
38 #include "public/platform/Platform.h"
38 #include "public/platform/ServiceRegistry.h" 39 #include "public/platform/ServiceRegistry.h"
39 #include "wtf/Assertions.h" 40 #include "wtf/Assertions.h"
40 #include "wtf/CurrentTime.h" 41 #include "wtf/CurrentTime.h"
41 42
42 namespace blink { 43 namespace blink {
43 namespace { 44 namespace {
44 45
45 static const char permissionDeniedErrorMessage[] = "User denied Geolocation"; 46 static const char permissionDeniedErrorMessage[] = "User denied Geolocation";
46 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocat ion service"; 47 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocat ion service";
47 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents"; 48 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents";
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 queryNextPosition(); 520 queryNextPosition();
520 } 521 }
521 522
522 void Geolocation::pageVisibilityChanged() 523 void Geolocation::pageVisibilityChanged()
523 { 524 {
524 updateGeolocationServiceConnection(); 525 updateGeolocationServiceConnection();
525 } 526 }
526 527
527 void Geolocation::onGeolocationConnectionError() 528 void Geolocation::onGeolocationConnectionError()
528 { 529 {
530 // If a request is outstanding at process shutdown, this error handler will
531 // be called. In that case, blink has already shut down so do nothing.
532 //
533 // TODO(sammc): Remove this once renderer shutdown is no longer graceful.
534 if (!Platform::current())
535 return;
536
529 PositionError* error = PositionError::create(PositionError::POSITION_UNAVAIL ABLE, failedToStartServiceErrorMessage); 537 PositionError* error = PositionError::create(PositionError::POSITION_UNAVAIL ABLE, failedToStartServiceErrorMessage);
530 error->setIsFatal(true); 538 error->setIsFatal(true);
531 handleError(error); 539 handleError(error);
532 } 540 }
533 541
534 void Geolocation::onPermissionConnectionError() 542 void Geolocation::onPermissionConnectionError()
535 { 543 {
544 // If a request is outstanding at process shutdown, this error handler will
545 // be called. In that case, blink has already shut down so do nothing.
546 //
547 // TODO(sammc): Remove this once renderer shutdown is no longer graceful.
548 if (!Platform::current())
549 return;
550
536 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); 551 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED);
537 } 552 }
538 553
539 } // namespace blink 554 } // 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