QUIC - cleanup changes to sync chromium tree with internal source.
[chromium-blink-merge.git] / ios / web / public / test / response_providers / file_based_response_provider_impl.h
blob95853653dc77020cbb4e0b5ba1209b8e00a69e06
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_
8 #include "base/files/file_path.h"
9 #include "ios/web/public/test/response_providers/response_provider.h"
11 class GURL;
13 namespace web {
15 // FileBasedMockResponseProvider tries to resolve URL as if it were a path
16 // relative to |path| on the filesystem. Use |BuildTargetPath| to resolve URLs
17 // to paths on the filesystem.
18 class FileBasedResponseProviderImpl {
19 public:
20 explicit FileBasedResponseProviderImpl(const base::FilePath& path);
21 virtual ~FileBasedResponseProviderImpl();
23 // Returns true if the request's URL when converted to a path on the app
24 // bundle has a file present.
25 bool CanHandleRequest(const ResponseProvider::Request& request);
26 // Converts |url| to a path on the app bundle. Used to resolve URLs on to the
27 // app bundle.
28 base::FilePath BuildTargetPath(const GURL& url);
30 private:
31 // The path according to which URLs are resolved from.
32 base::FilePath path_;
36 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_