Work-around failures when retrieving blink component list (#713)

* Hard-code blink components to work around errors when requesting them.

* Added cached-buster param.

* fixed typo
This commit is contained in:
Jason Robbins 2020-01-08 10:11:52 -08:00 коммит произвёл GitHub
Родитель 57c0e44f1e
Коммит e2ce06c4d5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 6083 добавлений и 2 удалений

591
hack_components.py Normal file
Просмотреть файл

@ -0,0 +1,591 @@
HACK_BLINK_COMPONENTS = [
"A-N/A",
"Blink",
"Blink>Accessibility",
"Blink>Animation",
"Blink>AppManifest",
"Blink>BackgroundFetch",
"Blink>BackgroundSync",
"Blink>BackgroundSync(Android)",
"Blink>Bindings",
"Blink>Bluetooth",
"Blink>CSS",
"Blink>CSS>3D",
"Blink>CSS>Filters",
"Blink>Canvas",
"Blink>Compositing",
"Blink>Contacts",
"Blink>ContentIndexing",
"Blink>DOM",
"Blink>DOM>ShadowDOM",
"Blink>DataTransfer",
"Blink>Editing",
"Blink>Editing>Selection",
"Blink>FeaturePolicy",
"Blink>FileAPI",
"Blink>Fonts",
"Blink>Fonts>Emoji",
"Blink>Forms",
"Blink>Fullscreen",
"Blink>GamepadAPI",
"Blink>Geolocation",
"Blink>Geometry",
"Blink>GetUserMedia",
"Blink>GetUserMedia>*",
"Blink>GetUserMedia>Desktop",
"Blink>GetUserMedia>Tab",
"Blink>GetUserMedia>WebCam",
"Blink>GetUserMedia>Webcam",
"Blink>HID",
"Blink>HTML",
"Blink>HTML>CustomElements",
"Blink>HTML>CustomHandlers",
"Blink>HTML>Focus",
"Blink>HTML>Parser",
"Blink>HTML>Portal",
"Blink>HTML>Script",
"Blink>HitTesting",
"Blink>Image",
"Blink>ImageCapture",
"Blink>Infra",
"Blink>Infra>Ecosystem",
"Blink>Input",
"Blink>Input>PointerLock",
"Blink>Internal",
"Blink>Internals",
"Blink>Internals>Frames",
"Blink>Internals>Modularization",
"Blink>Internals>WTF",
"Blink>JavaScript",
"Blink>JavaScript>API",
"Blink>JavaScript>Compiler",
"Blink>JavaScript>GC",
"Blink>JavaScript>Internationalization",
"Blink>JavaScript>Interpreter",
"Blink>JavaScript>Language",
"Blink>JavaScript>Parser",
"Blink>JavaScript>Runtime",
"Blink>JavaScript>WebAssembly",
"Blink>Layout",
"Blink>Layout(Android)",
"Blink>Layout>Flexbox",
"Blink>Layout>Fullscreen",
"Blink>Layout>Grid",
"Blink>Layout>MultiCol",
"Blink>Layout>Ruby",
"Blink>Layout>Scrollbars",
"Blink>Layout>Shape",
"Blink>Layout>Subpixel",
"Blink>Layout>Table",
"Blink>Layout>WritingMode",
"Blink>Loader",
"Blink>Loader>Preload",
"Blink>Loader>WebPackaging",
"Blink>Location",
"Blink>Media",
"Blink>Media>Audio",
"Blink>Media>Capabilities",
"Blink>Media>Controls",
"Blink>Media>PictureInPicture",
"Blink>Media>RemotePlayback",
"Blink>Media>Session",
"Blink>Media>Track",
"Blink>MediaRecording",
"Blink>MediaStream",
"Blink>MediaStream>*",
"Blink>MediaStream>CaptureFromElement",
"Blink>MemoryAllocator",
"Blink>MemoryAllocator>GarbageCollection",
"Blink>MemoryAllocator>Partition",
"Blink>Messaging",
"Blink>NFC",
"Blink>Network",
"Blink>Network>FetchAPI",
"Blink>Network>StreamsAPI",
"Blink>Network>WebSockets",
"Blink>Network>WebTransport",
"Blink>Network>XHR",
"Blink>Paint",
"Blink>Paint>Invalidation",
"Blink>Payments",
"Blink>PerformanceAPIs",
"Blink>PerformanceAPIs>NavigationTiming",
"Blink>PerformanceAPIs>ResourceTiming",
"Blink>PerformanceAPIs>ServerTiming",
"Blink>PermissionsAPI",
"Blink>PresentationAPI",
"Blink>Previews",
"Blink>PushAPI",
"Blink>PushAPI(Android)",
"Blink>SMS",
"Blink>SMS(Android)",
"Blink>SVG",
"Blink>SavePage",
"Blink>Scheduler",
"Blink>Scheduling",
"Blink>ScreenOrientation",
"Blink>Scroll",
"Blink>SecurityFeature",
"Blink>SecurityFeature>CORS",
"Blink>SecurityFeature>ContentSecurityPolicy",
"Blink>SecurityFeature>CredentialManagement",
"Blink>SecurityFeature>Referrer",
"Blink>SecurityFeature>SecureContexts",
"Blink>SecurityFeature>XFrameOptions",
"Blink>Sensor",
"Blink>Sensor>DeviceOrientation",
"Blink>Serial",
"Blink>ServiceWorker",
"Blink>ShapeDetection",
"Blink>Speech",
"Blink>SpeechRecognition?",
"Blink>Storage",
"Blink>Storage>AppCache",
"Blink>Storage>CacheStorage",
"Blink>Storage>CookiesAPI",
"Blink>Storage>DOMStorage",
"Blink>Storage>DataTransfer",
"Blink>Storage>FileAPI",
"Blink>Storage>FileSystem",
"Blink>Storage>IndexedDB",
"Blink>Storage>Quota",
"Blink>Storage>WebSQL",
"Blink>TextAutosize",
"Blink>TextEncoding",
"Blink>Transforms",
"Blink>USB",
"Blink>UseCounter",
"Blink>Vibration",
"Blink>ViewSource",
"Blink>WakeLock",
"Blink>WebAudio",
"Blink>WebAuthentication",
"Blink>WebAuthentication(Android)",
"Blink>WebCrypto",
"Blink>WebFonts",
"Blink>WebGL",
"Blink>WebGPU",
"Blink>WebMIDI",
"Blink>WebRTC",
"Blink>WebRTC>Audio",
"Blink>WebRTC>Network",
"Blink>WebRTC>PeerConnection",
"Blink>WebRTC>Tools",
"Blink>WebRTC>Video",
"Blink>WebShare",
"Blink>WebShare(Android)",
"Blink>WebVR",
"Blink>WebXR",
"Blink>WebXR>AR(Android)",
"Blink>WindowDialog",
"Blink>Worker",
"Blink>Workers",
"Blink>XML",
"Build",
"Chromecast",
"Content>Core",
"Content>Core(Android)",
"Content>WebApps",
"Content>WebApps(Android)",
"Documentation",
"Enterprise",
"Enterprise>ActiveDirectory",
"Enterprise>BrowserSwitcher",
"Enterprise>CloudPolicy",
"Enterprise>Enrollment",
"EnterpriseRetailMode",
"Fake>ShouldNeverBeInSymbol",
"FamilyLink",
"Fuchsia",
"Fuchsia(Fuchsia)",
"IO>Bluetooth",
"IO>Gamepad",
"IO>Keyboard",
"IO>PointerLock",
"IO>USB",
"Infra",
"Infra>ChromeOS>Build",
"Infra>Client>Android",
"Infra>Client>Chrome",
"Infra>Client>Chrome(iOS)",
"Infra>Client>WebRTC",
"Infra>Platform",
"Infra>SDK",
"Infra>Test>CodeCoverage",
"Internal>Android",
"Internal>Exosphere",
"Internal>Input",
"Internal>Installer",
"Internal>Services",
"Internals",
"Internals>Accessibility",
"Internals>BackgroundTaskScheduler",
"Internals>Cast",
"Internals>Cast(Android)",
"Internals>Cast>API",
"Internals>Cast>Providers",
"Internals>Cast>Streaming",
"Internals>Cast>UI",
"Internals>CertAnalysis",
"Internals>Compositing",
"Internals>Compositing>*",
"Internals>Compositing>Animation",
"Internals>Compositing>Rasterization",
"Internals>ContentCapture",
"Internals>Core",
"Internals>Core(Android)",
"Internals>CrashReporting",
"Internals>EarlyLoadingFramework",
"Internals>Exosphere",
"Internals>FeatureEngagement",
"Internals>FreezeDriedTabs",
"Internals>GPU",
"Internals>GPU>ANGLE",
"Internals>GPU>Dawn",
"Internals>GPU>Internals",
"Internals>GPU>SwiftShader",
"Internals>GPU>Video",
"Internals>Headless",
"Internals>Images",
"Internals>Images>Codecs",
"Internals>Input",
"Internals>Installer",
"Internals>Installer>Components",
"Internals>Installer>Components(iOS)",
"Internals>Installer>Diff",
"Internals>Instrumentation",
"Internals>Instrumentation>Memory",
"Internals>LocalDataEncryption",
"Internals>Logging",
"Internals>Media",
"Internals>Media>Audio",
"Internals>Media>Codecs",
"Internals>Media>Encrypted",
"Internals>Media>FFmpeg",
"Internals>Media>History",
"Internals>Media>ScreenCapture",
"Internals>Media>Session",
"Internals>Media>Source",
"Internals>Media>UI",
"Internals>Media>UI(Android)",
"Internals>Media>Video",
"Internals>Metrics",
"Internals>Metrics(Android)",
"Internals>Metrics>SamplingProfiler",
"Internals>Metrics>UKM",
"Internals>Metrics>Variations",
"Internals>Mojo",
"Internals>Mojo>Bindings",
"Internals>Network",
"Internals>Network(iOS)",
"Internals>Network>Auth",
"Internals>Network>Cache",
"Internals>Network>Cache>Simple",
"Internals>Network>CertTrans",
"Internals>Network>Certificate",
"Internals>Network>Cookies",
"Internals>Network>Cookies(iOS)",
"Internals>Network>DNS",
"Internals>Network>DataProxy",
"Internals>Network>DataProxy(Android)",
"Internals>Network>DataUse",
"Internals>Network>FTP",
"Internals>Network>Filters",
"Internals>Network>HTTP2",
"Internals>Network>Library",
"Internals>Network>Logging",
"Internals>Network>Logging(iOS)",
"Internals>Network>NetInfo",
"Internals>Network>NetworkQuality",
"Internals>Network>NetworkQuality(Android)",
"Internals>Network>Proxy",
"Internals>Network>QUIC",
"Internals>Network>ReportingAndNEL",
"Internals>Network>SSL",
"Internals>Networking",
"Internals>OptimizationGuide",
"Internals>OriginTrials",
"Internals>Ozone",
"Internals>PageSecurityState",
"Internals>Permissions",
"Internals>Permissions>Model",
"Internals>Permissions>SiteEngagement",
"Internals>PlatformIntegration",
"Internals>PlatformIntegration(Android)",
"Internals>Plugins",
"Internals>Plugins>Flash",
"Internals>Plugins>PDF",
"Internals>Plugins>Pepper",
"Internals>Preferences",
"Internals>Preferences>Service",
"Internals>Preload",
"Internals>Printing",
"Internals>Printing>CUPS",
"Internals>ResourceCoordinator",
"Internals>Sandbox",
"Internals>Sandbox>SiteIsolation",
"Internals>Services",
"Internals>Services>Ash",
"Internals>Services>Content",
"Internals>Services>Device",
"Internals>Services>File",
"Internals>Services>Identity",
"Internals>Services>Network",
"Internals>Services>Network(iOS)",
"Internals>Services>ServiceManager",
"Internals>Services>Viz",
"Internals>Skia",
"Internals>SpeechSynthesis",
"Internals>Storage",
"Internals>Storage>LevelDBProto",
"Internals>TaskScheduler",
"Internals>ThreadPool",
"Internals>Views",
"Internals>Views>Desktop",
"Internals>WebLayer",
"Internals>WebRTC",
"Internals>XR",
"Internals>XR>AR(Android)",
"Internals>XR>VR",
"Internals>XR>VR(Android)",
"Manifest",
"Mobile(Android)",
"Mobile>FeatureModules",
"Mobile>WebAPKs",
"Mobile>WebAPKs(Android)",
"Mobile>WebView",
"Mobile>iOSWeb",
"Mobile>iOSWeb(iOS)",
"Mobile>iOSWeb>ScriptInjections(iOS)",
"Mobile>iOSWebView(iOS)",
"OS>Kernel>Audio",
"OS>Kernel>Camera",
"OS>Kernel>Graphics",
"OS>Kernel>Power",
"OS>Kernel>Video",
"OS>Systems",
"OS>Systems>Bluetooth",
"OS>Systems>Input>Keyboard",
"OS>Systems>Multidevice",
"OS>Systems>Multidevice>SmartLock",
"OS>Systems>Multidevice>Tethering",
"OS>Systems>Network",
"OS>Systems>Network>Bluetooth",
"OS>Systems>Network>WiFi",
"OS>Systems>Security",
"OS>Systems>Settings",
"OS>Systems>Wallpaper",
"Platform",
"Platform>Apps",
"Platform>Apps>API>Windows",
"Platform>Apps>ARC",
"Platform>Apps>AppLauncher>Install",
"Platform>Apps>AppLauncher>Install(Android)",
"Platform>Apps>BackgroundPage",
"Platform>Apps>BrowserTag",
"Platform>Apps>Draw",
"Platform>Apps>Feedback",
"Platform>Apps>FileManager",
"Platform>Apps>Foundation",
"Platform>Apps>GetHelp",
"Platform>Apps>MediaGalleries",
"Platform>Apps>PhotoEditor",
"Platform>Apps>Shell",
"Platform>Apps>SystemWebApps",
"Platform>DevTools",
"Platform>DevTools>JavaScript",
"Platform>Extensions",
"Platform>Extensions>API",
"Platform>Extensions>Documentation",
"Platform>NaCl",
"Privacy",
"Security",
"Services>Chromoting",
"Services>CloudMessaging",
"Services>CloudMessaging(Android)",
"Services>CloudMessaging(iOS)",
"Services>CloudPrint",
"Services>Invalidation",
"Services>Invalidation(Android)",
"Services>Invalidation(iOS)",
"Services>SafeBrowsing",
"Services>Safebrowsing",
"Services>SignIn",
"Services>SignIn(Android)",
"Services>SignIn(iOS)",
"Services>Signin(Android)",
"Services>SupervisedUser",
"Services>Sync",
"Services>Sync(Android)",
"Services>Sync(iOS)",
"Speed",
"Speed>Benchmark",
"Speed>Benchmarks",
"Speed>Benchmarks>Waterfall",
"Speed>Bisection",
"Speed>Dashboard",
"Speed>Metrics",
"Speed>Release",
"Speed>Tracing",
"Speed>Tracing(Android)",
"Test",
"Test(iOS)",
"Test>Android",
"Test>Android(Android)",
"Test>Devil",
"Test>Layout",
"Test>Pixel",
"Test>Telemetry",
"Test>Typ",
"Test>WebDriver",
"Test>gTest",
"Test>iOS(iOS)",
"Tests",
"Tools",
"Tools(Android)",
"Tools(iOS)",
"Tools>ChromeOS-Toolchain",
"Tools>CodeCoverage",
"Tools>Stability>AFL",
"Tools>Stability>ClusterFuzz",
"Tools>Stability>Clusterfuzz",
"Tools>Stability>Libfuzzer",
"Tools>Stability>libFuzzer",
"UI",
"UI(Android)",
"UI->Browser->WebAppInstalls",
"UI>Accessibility",
"UI>Accessibility(Android)",
"UI>Accessibility>ChromeVox",
"UI>Accessibility>Compatibility",
"UI>Assets>Images",
"UI>Aura",
"UI>Browser",
"UI>Browser>AdFilter",
"UI>Browser>Autofill",
"UI>Browser>Autofill(Android)",
"UI>Browser>Autofill>UI",
"UI>Browser>Bookmarks",
"UI>Browser>Bookmarks(Android)",
"UI>Browser>Bubbles",
"UI>Browser>Bubbles>PageInfo",
"UI>Browser>ContentSuggestions",
"UI>Browser>ContentSuggestions>Feed",
"UI>Browser>ContentSuggestions>Feed(Android)",
"UI>Browser>ContentSuggestions>History",
"UI>Browser>Core",
"UI>Browser>Downloads",
"UI>Browser>Downloads(Android)",
"UI>Browser>FirstRun",
"UI>Browser>FirstRun(iOS)",
"UI>Browser>FullScreen",
"UI>Browser>History",
"UI>Browser>Import",
"UI>Browser>Infobars",
"UI>Browser>Infobars(Android)",
"UI>Browser>Interstitials",
"UI>Browser>Joy",
"UI>Browser>Language",
"UI>Browser>Language>Translate",
"UI>Browser>Mobile",
"UI>Browser>Mobile(Android)",
"UI>Browser>Mobile(iOS)",
"UI>Browser>Mobile>CompositedUI(Android)",
"UI>Browser>Mobile>CustomTabs",
"UI>Browser>Mobile>CustomTabs(Android)",
"UI>Browser>Mobile>Messages(Android)",
"UI>Browser>Mobile>NavPanel(Android)",
"UI>Browser>Mobile>SearchWidget(Android)",
"UI>Browser>Mobile>Settings(Android)",
"UI>Browser>Mobile>Settings>DataSaver(Android)",
"UI>Browser>Mobile>Share(Android)",
"UI>Browser>Mobile>TabSwitcher(Android)",
"UI>Browser>Mobile>TodayView(iOS)",
"UI>Browser>Mobile>TrustedWebActivities(Android)",
"UI>Browser>Navigation",
"UI>Browser>Navigation(iOS)",
"UI>Browser>NewTabPage",
"UI>Browser>NewTabPage(Android)",
"UI>Browser>NewTabPage(iOS)",
"UI>Browser>Offline",
"UI>Browser>Offline(Android)",
"UI>Browser>Omnibox",
"UI>Browser>Omnibox(Android)",
"UI>Browser>Omnibox(iOS)",
"UI>Browser>Omnibox>ZeroSuggest",
"UI>Browser>Passwords",
"UI>Browser>Passwords(Android)",
"UI>Browser>Payments",
"UI>Browser>Payments(Android)",
"UI>Browser>Permissions>Prompts",
"UI>Browser>Permissions>Prompts(Android)",
"UI>Browser>PopupBlocker",
"UI>Browser>Preferences",
"UI>Browser>Preferences>Protector",
"UI>Browser>PrintPreview",
"UI>Browser>Profiles",
"UI>Browser>Profiles(iOS)",
"UI>Browser>ReaderMode",
"UI>Browser>ReaderMode(Android)",
"UI>Browser>Safebrowsing",
"UI>Browser>Search",
"UI>Browser>Search(Android)",
"UI>Browser>Search>ContextualSearch",
"UI>Browser>Search>ContextualSearch(Android)",
"UI>Browser>Selection",
"UI>Browser>Sessions",
"UI>Browser>Sessions(iOS)",
"UI>Browser>Sharing",
"UI>Browser>Sharing(Android)",
"UI>Browser>Sharing(iOS)",
"UI>Browser>Spellcheck",
"UI>Browser>TabContents",
"UI>Browser>TabStrip",
"UI>Browser>Themes",
"UI>Browser>Toolbar",
"UI>Browser>Toolbar(Android)",
"UI>Browser>UsageStats(Android)",
"UI>Browser>VR",
"UI>Browser>VR(Android)",
"UI>Browser>WebAppInstalls",
"UI>Browser>WebAppInstalls(Android)",
"UI>Browser>WebAppinstalls",
"UI>Browser>WebUI",
"UI>Browser>WebUI(iOS)",
"UI>Browser>Zoom",
"UI>GFX",
"UI>GFX(Android)",
"UI>Input",
"UI>Input>KeyboardShortcuts",
"UI>Input>Text>IME",
"UI>Input>Text>IME(Android)",
"UI>Input>VirtualKeyboard",
"UI>Internationalization",
"UI>Localization",
"UI>ML",
"UI>ML>Service",
"UI>NightLight",
"UI>Notifications",
"UI>Notifications(Android)",
"UI>Security>UrlFormatting",
"UI>Settings",
"UI>Shell",
"UI>Shell>Assistant",
"UI>Shell>Containers",
"UI>Shell>Display",
"UI>Shell>GestureNav",
"UI>Shell>Kiosk",
"UI>Shell>Launcher",
"UI>Shell>LockScreen",
"UI>Shell>Networking",
"UI>Shell>Notifications",
"UI>Shell>OOBE",
"UI>Shell>OverviewMode",
"UI>Shell>Shelf",
"UI>Shell>StatusArea",
"UI>Shell>TouchView",
"UI>Shell>WindowManager",
"UI>Shell>WindowManager>Splitscreen",
"UI>TaskManager",
"Webstore"
]

5474
hack_wf_components.py Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -15,6 +15,10 @@ from google.appengine.api import users
import settings
import util
import hack_components
import hack_wf_components
#from django.forms import ModelForm
from collections import OrderedDict
from django import forms
@ -274,12 +278,18 @@ class BlinkComponent(DictModel):
components = memcache.get(key)
if components is None or update_cache:
components = []
result = urlfetch.fetch(self.COMPONENTS_ENDPOINT, deadline=60)
url = self.COMPONENTS_ENDPOINT + '?cache-buster=%s' % time.time()
result = urlfetch.fetch(url, deadline=60)
if result.status_code == 200:
components = sorted(json.loads(result.content))
memcache.set(key, components)
else:
logging.error('Fetching blink components returned: %s' % result.status_code)
if not components:
components = sorted(hack_components.HACK_BLINK_COMPONENTS)
logging.info('using hard-coded blink components')
return components
@classmethod
@ -290,12 +300,18 @@ class BlinkComponent(DictModel):
components = memcache.get(key)
if components is None or update_cache:
components = {}
result = urlfetch.fetch(self.WF_CONTENT_ENDPOINT, deadline=60)
url = self.WF_CONTENT_ENDPOINT + '?cache-buster=%s' % time.time()
result = urlfetch.fetch(url, deadline=60)
if result.status_code == 200:
components = json.loads(result.content)
memcache.set(key, components)
else:
logging.error('Fetching /web blink components content returned: %s' % result.status_code)
if not components:
components = hack_wf_components.HACK_WF_COMPONENTS
logging.info('using hard-coded WF components')
return components
@classmethod