| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 provides the embedder's side of random webkit glue functions. | 5 // This file provides the embedder's side of random webkit glue functions. |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // static factory function | 231 // static factory function |
| 232 ResourceLoaderBridge* ResourceLoaderBridge::Create( | 232 ResourceLoaderBridge* ResourceLoaderBridge::Create( |
| 233 WebFrame* webframe, | 233 WebFrame* webframe, |
| 234 const std::string& method, | 234 const std::string& method, |
| 235 const GURL& url, | 235 const GURL& url, |
| 236 const GURL& policy_url, | 236 const GURL& policy_url, |
| 237 const GURL& referrer, | 237 const GURL& referrer, |
| 238 const std::string& headers, | 238 const std::string& headers, |
| 239 int load_flags, | 239 int load_flags, |
| 240 int origin_pid, | 240 int origin_pid, |
| 241 ResourceType::Type resource_type, | 241 ResourceType::Type resource_type) { |
| 242 bool mixed_content) { | |
| 243 // TODO(darin): we need to eliminate the webframe parameter because webkit | 242 // TODO(darin): we need to eliminate the webframe parameter because webkit |
| 244 // does not always supply it (see ResourceHandle::loadResourceSynchronously). | 243 // does not always supply it (see ResourceHandle::loadResourceSynchronously). |
| 245 // Instead we should add context to ResourceRequest, which will be easy to do | 244 // Instead we should add context to ResourceRequest, which will be easy to do |
| 246 // once we merge to the latest WebKit (r23806 at least). | 245 // once we merge to the latest WebKit (r23806 at least). |
| 247 if (!webframe) { | 246 if (!webframe) { |
| 248 NOTREACHED() << "no webframe"; | 247 NOTREACHED() << "no webframe"; |
| 249 return NULL; | 248 return NULL; |
| 250 } | 249 } |
| 251 | 250 |
| 252 if (!webframe->GetView()->GetDelegate()) | 251 if (!webframe->GetView()->GetDelegate()) |
| 253 return NULL; | 252 return NULL; |
| 254 | 253 |
| 254 std::string frame_origin = webframe->GetSecurityOrigin(); |
| 255 std::string main_frame_origin = webframe->GetTop()->GetSecurityOrigin(); |
| 256 |
| 255 RenderView* rv = static_cast<RenderView*>(webframe->GetView()->GetDelegate()); | 257 RenderView* rv = static_cast<RenderView*>(webframe->GetView()->GetDelegate()); |
| 256 int route_id = rv->routing_id(); | 258 int route_id = rv->routing_id(); |
| 257 ResourceDispatcher* dispatch = RenderThread::current()->resource_dispatcher(); | 259 ResourceDispatcher* dispatch = RenderThread::current()->resource_dispatcher(); |
| 258 return dispatch->CreateBridge(method, url, policy_url, referrer, headers, | 260 return dispatch->CreateBridge(method, url, policy_url, referrer, |
| 259 load_flags, origin_pid, resource_type, | 261 frame_origin, main_frame_origin, headers, |
| 260 mixed_content, 0, route_id); | 262 load_flags, origin_pid, resource_type, 0, |
| 263 route_id); |
| 261 } | 264 } |
| 262 | 265 |
| 263 void NotifyCacheStats() { | 266 void NotifyCacheStats() { |
| 264 // Update the browser about our cache | 267 // Update the browser about our cache |
| 265 // NOTE: Since this can be called from the plugin process, we might not have | 268 // NOTE: Since this can be called from the plugin process, we might not have |
| 266 // a RenderThread. Do nothing in that case. | 269 // a RenderThread. Do nothing in that case. |
| 267 if (!IsPluginProcess()) | 270 if (!IsPluginProcess()) |
| 268 RenderThread::current()->InformHostOfCacheStatsLater(); | 271 RenderThread::current()->InformHostOfCacheStatsLater(); |
| 269 } | 272 } |
| 270 | 273 |
| 271 | 274 |
| 272 } // namespace webkit_glue | 275 } // namespace webkit_glue |
| OLD | NEW |