Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 #include "modules/geolocation/GeolocationInspectorAgent.h" | 34 #include "modules/geolocation/GeolocationInspectorAgent.h" |
| 35 #include "modules/geolocation/GeolocationPosition.h" | 35 #include "modules/geolocation/GeolocationPosition.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 GeolocationController::GeolocationController(LocalFrame& frame, GeolocationClien t* client) | 39 GeolocationController::GeolocationController(LocalFrame& frame, GeolocationClien t* client) |
| 40 : PageLifecycleObserver(frame.page()) | 40 : PageLifecycleObserver(frame.page()) |
| 41 , m_client(client) | 41 , m_client(client) |
| 42 , m_hasClientForTest(false) | 42 , m_hasClientForTest(false) |
| 43 , m_isClientUpdating(false) | 43 , m_isClientUpdating(false) |
| 44 , m_inspectorAgent() | 44 , m_inspectorAgent(nullptr) |
|
eseidel
2014/07/28 17:51:08
I'm confused why this change is needed?
This is a
kenrb
2014/07/28 18:06:20
In release builds yes, but in debug it RawPtr gets
| |
| 45 { | 45 { |
| 46 // FIXME: Once GeolocationInspectorAgent is per frame, there will be a 1:1 r elationship between | 46 // FIXME: Once GeolocationInspectorAgent is per frame, there will be a 1:1 r elationship between |
| 47 // it and this class. Until then, there's one GeolocationInspectorAgent per page that the main | 47 // it and this class. Until then, there's one GeolocationInspectorAgent per page that the main |
| 48 // frame is responsible for creating. | 48 // frame is responsible for creating. |
| 49 if (frame.isMainFrame()) { | 49 if (frame.isMainFrame()) { |
| 50 OwnPtrWillBeRawPtr<GeolocationInspectorAgent> geolocationAgent(Geolocati onInspectorAgent::create()); | 50 OwnPtrWillBeRawPtr<GeolocationInspectorAgent> geolocationAgent(Geolocati onInspectorAgent::create()); |
| 51 m_inspectorAgent = geolocationAgent.get(); | 51 m_inspectorAgent = geolocationAgent.get(); |
| 52 frame.page()->inspectorController().registerModuleAgent(geolocationAgent .release()); | 52 frame.page()->inspectorController().registerModuleAgent(geolocationAgent .release()); |
| 53 } else if (frame.page()->mainFrame()->isLocalFrame()) { | 53 } else if (frame.page()->mainFrame()->isLocalFrame()) { |
| 54 m_inspectorAgent = GeolocationController::from(frame.page()->deprecatedL ocalMainFrame())->m_inspectorAgent; | 54 m_inspectorAgent = GeolocationController::from(frame.page()->deprecatedL ocalMainFrame())->m_inspectorAgent; |
| 55 } | 55 } |
| 56 | 56 |
| 57 m_inspectorAgent->addController(this); | 57 // m_inspectorAgent is 0 for out of process iframe instantiations, since ins pector is currently unable |
| 58 // to handle that scenario. | |
| 59 if (m_inspectorAgent) | |
| 60 m_inspectorAgent->addController(this); | |
| 58 | 61 |
| 59 if (!frame.isMainFrame() && frame.page()->mainFrame()->isLocalFrame()) { | 62 if (!frame.isMainFrame() && frame.page()->mainFrame()->isLocalFrame()) { |
| 60 // internals.setGeolocationClientMock is per page. | 63 // internals.setGeolocationClientMock is per page. |
| 61 GeolocationController* mainController = GeolocationController::from(fram e.page()->deprecatedLocalMainFrame()); | 64 GeolocationController* mainController = GeolocationController::from(fram e.page()->deprecatedLocalMainFrame()); |
| 62 if (mainController->hasClientForTest()) | 65 if (mainController->hasClientForTest()) |
| 63 setClientForTest(mainController->client()); | 66 setClientForTest(mainController->client()); |
| 64 } | 67 } |
| 65 } | 68 } |
| 66 | 69 |
| 67 void GeolocationController::startUpdatingIfNeeded() | 70 void GeolocationController::startUpdatingIfNeeded() |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 visitor->trace(m_inspectorAgent); | 237 visitor->trace(m_inspectorAgent); |
| 235 WillBeHeapSupplement<LocalFrame>::trace(visitor); | 238 WillBeHeapSupplement<LocalFrame>::trace(visitor); |
| 236 } | 239 } |
| 237 | 240 |
| 238 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) | 241 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) |
| 239 { | 242 { |
| 240 WillBeHeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::su pplementName(), GeolocationController::create(frame, client)); | 243 WillBeHeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::su pplementName(), GeolocationController::create(frame, client)); |
| 241 } | 244 } |
| 242 | 245 |
| 243 } // namespace blink | 246 } // namespace blink |
| OLD | NEW |