Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/availability_finder.py |
| diff --git a/chrome/common/extensions/docs/server2/availability_finder.py b/chrome/common/extensions/docs/server2/availability_finder.py |
| index 31564d1c30a3ac10a22342af25ec60befff70760..547150c3a66d3686a7dbc3e91775e59b76a4ddf7 100644 |
| --- a/chrome/common/extensions/docs/server2/availability_finder.py |
| +++ b/chrome/common/extensions/docs/server2/availability_finder.py |
| @@ -208,6 +208,24 @@ class AvailabilityFinder(object): |
| file_system, |
| channel_info) |
| + def _FindScheduled(self, api_name): |
| + '''Determines the earliest version of Chrome where the API is stable. |
| + Unlike the code in GetApiAvailability, this checks if the API is stable |
| + even when Chrome is in dev or beta, which shows that the API is scheduled |
| + to be stable in that verison of Chrome. |
| + ''' |
| + def check_scheduled(file_system, channel_info): |
| + return self._CheckStableAvailability(api_name, |
|
jshumway
2014/04/25 21:34:43
When arguments go past the end of the line but are
danielj41
2014/04/25 22:24:49
Done.
|
| + file_system, |
| + channel_info.version) |
| + stable_availability = self._file_system_iterator.Descending( |
| + self._branch_utility.GetChannelInfo('dev'), |
| + check_scheduled) |
|
jshumway
2014/04/25 21:34:43
These two arguments can be on the same line under
danielj41
2014/04/25 22:24:49
Done.
|
| + if stable_availability: |
| + return stable_availability.version |
| + else: |
| + return None |
|
jshumway
2014/04/25 21:34:43
The above if else can be
return stable_availabili
danielj41
2014/04/25 22:24:49
Done.
|
| + |
| def GetApiAvailability(self, api_name): |
| '''Performs a search for an API's top-level availability by using a |
| HostFileSystemIterator instance to traverse multiple version of the |
| @@ -232,6 +250,12 @@ class AvailabilityFinder(object): |
| if availability is None: |
| # The API wasn't available on 'dev', so it must be a 'trunk'-only API. |
| availability = self._branch_utility.GetChannelInfo('trunk') |
| + |
| + # If the API is not stable, check if it is stable in the dev or beta |
| + # versions of Chrome. This means that the API is scheduled to be stable. |
| + if availability.channel != 'stable': |
| + availability.scheduled = self._FindScheduled(api_name) |
| + |
| self._top_level_object_store.Set(api_name, availability) |
| return availability |