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

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

Issue 10440119: Introduce a delegate to avoid hardcoding "chrome-extension" in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review nit and merge to LKGR for commit. Created 8 years, 6 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
« no previous file with comments | « net/url_request/url_request_throttler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 OnCanAccessFile(const net::URLRequest& request, 176 virtual bool OnCanAccessFile(const net::URLRequest& request,
177 const FilePath& path) const OVERRIDE { 177 const FilePath& path) const OVERRIDE {
178 return true; 178 return true;
179 } 179 }
180 virtual bool OnCanThrottleRequest(
181 const net::URLRequest& request) const OVERRIDE {
182 return false;
183 }
184
180 }; 185 };
181 186
182 TestShellRequestContextParams* g_request_context_params = NULL; 187 TestShellRequestContextParams* g_request_context_params = NULL;
183 TestShellRequestContext* g_request_context = NULL; 188 TestShellRequestContext* g_request_context = NULL;
184 TestShellNetworkDelegate* g_network_delegate = NULL; 189 TestShellNetworkDelegate* g_network_delegate = NULL;
185 base::Thread* g_cache_thread = NULL; 190 base::Thread* g_cache_thread = NULL;
186 191
187 struct FileOverHTTPParams { 192 struct FileOverHTTPParams {
188 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix) 193 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix)
189 : file_path_template(in_file_path_template), 194 : file_path_template(in_file_path_template),
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); 1128 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https")));
1124 g_file_over_http_params = new FileOverHTTPParams(file_path_template, 1129 g_file_over_http_params = new FileOverHTTPParams(file_path_template,
1125 http_prefix); 1130 http_prefix);
1126 } 1131 }
1127 1132
1128 // static 1133 // static
1129 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( 1134 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create(
1130 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { 1135 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
1131 return new ResourceLoaderBridgeImpl(request_info); 1136 return new ResourceLoaderBridgeImpl(request_info);
1132 } 1137 }
OLDNEW
« no previous file with comments | « net/url_request/url_request_throttler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698