OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 void Geolocation::resume() | 435 void Geolocation::resume() |
436 { | 436 { |
437 #if !ENABLE(CLIENT_BASED_GEOLOCATION) | 437 #if !ENABLE(CLIENT_BASED_GEOLOCATION) |
438 if (hasListeners()) | 438 if (hasListeners()) |
439 m_service->resume(); | 439 m_service->resume(); |
440 #endif | 440 #endif |
441 } | 441 } |
442 | 442 |
443 void Geolocation::setIsAllowed(bool allowed) | 443 void Geolocation::setIsAllowed(bool allowed) |
444 { | 444 { |
| 445 // Protect the Geolocation object from garbage collection during a callback. |
| 446 RefPtr<Geolocation> protect(this); |
| 447 |
445 // This may be due to either a new position from the service, or a cached | 448 // This may be due to either a new position from the service, or a cached |
446 // position. | 449 // position. |
447 m_allowGeolocation = allowed ? Yes : No; | 450 m_allowGeolocation = allowed ? Yes : No; |
448 | 451 |
449 #if USE(PREEMPT_GEOLOCATION_PERMISSION) | 452 #if USE(PREEMPT_GEOLOCATION_PERMISSION) |
450 // Permission request was made during the startRequest process | 453 // Permission request was made during the startRequest process |
451 if (!m_pendingForPermissionNotifiers.isEmpty()) { | 454 if (!m_pendingForPermissionNotifiers.isEmpty()) { |
452 handlePendingPermissionNotifiers(); | 455 handlePendingPermissionNotifiers(); |
453 m_pendingForPermissionNotifiers.clear(); | 456 m_pendingForPermissionNotifiers.clear(); |
454 return; | 457 return; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 764 |
762 Geolocation::Geolocation(Frame*) {} | 765 Geolocation::Geolocation(Frame*) {} |
763 | 766 |
764 Geolocation::~Geolocation() {} | 767 Geolocation::~Geolocation() {} |
765 | 768 |
766 void Geolocation::setIsAllowed(bool) {} | 769 void Geolocation::setIsAllowed(bool) {} |
767 | 770 |
768 } | 771 } |
769 | 772 |
770 #endif // ENABLE(GEOLOCATION) | 773 #endif // ENABLE(GEOLOCATION) |
OLD | NEW |