Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 10068021: Fix file access on Chrome for ChromeOS on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang problem Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains an implementation of the ResourceLoaderBridge class. 5 // This file contains an implementation of the ResourceLoaderBridge class.
6 // The class is implemented using net::URLRequest, meaning it is a "simple" 6 // The class is implemented using net::URLRequest, meaning it is a "simple"
7 // version that directly issues requests. The more complicated one used in the 7 // version that directly issues requests. The more complicated one used in the
8 // browser uses IPC. 8 // browser uses IPC.
9 // 9 //
10 // Because net::URLRequest only provides an asynchronous resource loading API, 10 // Because net::URLRequest only provides an asynchronous resource loading API,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 net::CookieOptions* options) OVERRIDE { 166 net::CookieOptions* options) OVERRIDE {
167 StaticCookiePolicy::Type policy_type = g_accept_all_cookies ? 167 StaticCookiePolicy::Type policy_type = g_accept_all_cookies ?
168 StaticCookiePolicy::ALLOW_ALL_COOKIES : 168 StaticCookiePolicy::ALLOW_ALL_COOKIES :
169 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; 169 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES;
170 170
171 StaticCookiePolicy policy(policy_type); 171 StaticCookiePolicy policy(policy_type);
172 int rv = policy.CanSetCookie( 172 int rv = policy.CanSetCookie(
173 request->url(), request->first_party_for_cookies()); 173 request->url(), request->first_party_for_cookies());
174 return rv == net::OK; 174 return rv == net::OK;
175 } 175 }
176 virtual bool CanAccessFile(const net::URLRequest* request,
177 const FilePath& path) OVERRIDE {
178 return true;
179 }
176 }; 180 };
177 181
178 TestShellRequestContextParams* g_request_context_params = NULL; 182 TestShellRequestContextParams* g_request_context_params = NULL;
179 TestShellRequestContext* g_request_context = NULL; 183 TestShellRequestContext* g_request_context = NULL;
180 TestShellNetworkDelegate* g_network_delegate = NULL; 184 TestShellNetworkDelegate* g_network_delegate = NULL;
181 base::Thread* g_cache_thread = NULL; 185 base::Thread* g_cache_thread = NULL;
182 186
183 struct FileOverHTTPParams { 187 struct FileOverHTTPParams {
184 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix) 188 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix)
185 : file_path_template(in_file_path_template), 189 : file_path_template(in_file_path_template),
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); 1119 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https")));
1116 g_file_over_http_params = new FileOverHTTPParams(file_path_template, 1120 g_file_over_http_params = new FileOverHTTPParams(file_path_template,
1117 http_prefix); 1121 http_prefix);
1118 } 1122 }
1119 1123
1120 // static 1124 // static
1121 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( 1125 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create(
1122 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { 1126 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
1123 return new ResourceLoaderBridgeImpl(request_info); 1127 return new ResourceLoaderBridgeImpl(request_info);
1124 } 1128 }
OLDNEW
« net/url_request/url_request.cc ('K') | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698