// Copyright © 2020 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. namespace CefSharp.DevTools.ApplicationCache { using System.Linq; /// /// ApplicationCache /// public partial class ApplicationCache : DevToolsDomainBase { private CefSharp.DevTools.IDevToolsClient _client; public ApplicationCache(CefSharp.DevTools.IDevToolsClient client) { _client = (client); } /// /// Enables application cache domain notifications. /// /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> public async System.Threading.Tasks.Task EnableAsync() { System.Collections.Generic.Dictionary dict = null; var methodResult = await _client.ExecuteDevToolsMethodAsync("ApplicationCache.enable", dict); return methodResult; } partial void ValidateGetApplicationCacheForFrame(string frameId); /// /// Returns relevant application cache data for the document in given frame. /// /// Identifier of the frame containing document whose application cache is retrieved. /// returns System.Threading.Tasks.Task<GetApplicationCacheForFrameResponse> public async System.Threading.Tasks.Task GetApplicationCacheForFrameAsync(string frameId) { ValidateGetApplicationCacheForFrame(frameId); var dict = new System.Collections.Generic.Dictionary(); dict.Add("frameId", frameId); var methodResult = await _client.ExecuteDevToolsMethodAsync("ApplicationCache.getApplicationCacheForFrame", dict); return methodResult.DeserializeJson(); } /// /// Returns array of frame identifiers with manifest urls for each frame containing a document /// associated with some application cache. /// /// returns System.Threading.Tasks.Task<GetFramesWithManifestsResponse> public async System.Threading.Tasks.Task GetFramesWithManifestsAsync() { System.Collections.Generic.Dictionary dict = null; var methodResult = await _client.ExecuteDevToolsMethodAsync("ApplicationCache.getFramesWithManifests", dict); return methodResult.DeserializeJson(); } partial void ValidateGetManifestForFrame(string frameId); /// /// Returns manifest URL for document in the given frame. /// /// Identifier of the frame containing document whose manifest is retrieved. /// returns System.Threading.Tasks.Task<GetManifestForFrameResponse> public async System.Threading.Tasks.Task GetManifestForFrameAsync(string frameId) { ValidateGetManifestForFrame(frameId); var dict = new System.Collections.Generic.Dictionary(); dict.Add("frameId", frameId); var methodResult = await _client.ExecuteDevToolsMethodAsync("ApplicationCache.getManifestForFrame", dict); return methodResult.DeserializeJson(); } } }