| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #include <wininet.h> | 13 #include <wininet.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "app/clipboard/clipboard.h" | 16 #include "app/clipboard/clipboard.h" |
| 17 #include "app/clipboard/scoped_clipboard_writer.h" | 17 #include "app/clipboard/scoped_clipboard_writer.h" |
| 18 #include "app/resource_bundle.h" | 18 #include "app/resource_bundle.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
| 22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 23 #include "chrome/plugin/npobject_util.h" | 23 #include "chrome/plugin/npobject_util.h" |
| 24 #include "chrome/renderer/net/render_dns_master.h" | 24 #include "chrome/renderer/net/render_dns_master.h" |
| 25 #include "chrome/renderer/render_process.h" | 25 #include "chrome/renderer/render_process.h" |
| 26 #include "chrome/renderer/render_thread.h" | 26 #include "chrome/renderer/render_thread.h" |
| 27 #include "chrome/renderer/socket_stream_dispatcher.h" |
| 27 #include "googleurl/src/url_util.h" | 28 #include "googleurl/src/url_util.h" |
| 28 #include "third_party/skia/include/core/SkBitmap.h" | 29 #include "third_party/skia/include/core/SkBitmap.h" |
| 29 #include "webkit/api/public/WebKit.h" | 30 #include "webkit/api/public/WebKit.h" |
| 30 #include "webkit/api/public/WebKitClient.h" | 31 #include "webkit/api/public/WebKitClient.h" |
| 31 #include "webkit/api/public/WebString.h" | 32 #include "webkit/api/public/WebString.h" |
| 32 #include "webkit/glue/scoped_clipboard_writer_glue.h" | 33 #include "webkit/glue/scoped_clipboard_writer_glue.h" |
| 33 #include "webkit/glue/webkit_glue.h" | 34 #include "webkit/glue/webkit_glue.h" |
| 34 #include "webkit/glue/websocketstreamhandle_bridge.h" | 35 #include "webkit/glue/websocketstreamhandle_bridge.h" |
| 35 | 36 |
| 36 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 ResourceType::Type resource_type, | 239 ResourceType::Type resource_type, |
| 239 int appcache_host_id, | 240 int appcache_host_id, |
| 240 int routing_id) { | 241 int routing_id) { |
| 241 ResourceDispatcher* dispatch = ChildThread::current()->resource_dispatcher(); | 242 ResourceDispatcher* dispatch = ChildThread::current()->resource_dispatcher(); |
| 242 return dispatch->CreateBridge(method, url, first_party_for_cookies, referrer, | 243 return dispatch->CreateBridge(method, url, first_party_for_cookies, referrer, |
| 243 frame_origin, main_frame_origin, headers, | 244 frame_origin, main_frame_origin, headers, |
| 244 load_flags, origin_pid, resource_type, 0, | 245 load_flags, origin_pid, resource_type, 0, |
| 245 appcache_host_id, routing_id); | 246 appcache_host_id, routing_id); |
| 246 } | 247 } |
| 247 | 248 |
| 248 | |
| 249 // static factory function | 249 // static factory function |
| 250 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( | 250 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( |
| 251 WebKit::WebSocketStreamHandle* handle, | 251 WebKit::WebSocketStreamHandle* handle, |
| 252 WebSocketStreamHandleDelegate* delegate) { | 252 WebSocketStreamHandleDelegate* delegate) { |
| 253 // TODO(ukai): implement dispathcer class. | 253 SocketStreamDispatcher* dispatcher = |
| 254 NOTREACHED(); | 254 RenderThread::current()->socket_stream_dispatcher(); |
| 255 return NULL; | 255 return dispatcher->CreateBridge(handle, delegate); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void NotifyCacheStats() { | 258 void NotifyCacheStats() { |
| 259 // Update the browser about our cache | 259 // Update the browser about our cache |
| 260 // NOTE: Since this can be called from the plugin process, we might not have | 260 // NOTE: Since this can be called from the plugin process, we might not have |
| 261 // a RenderThread. Do nothing in that case. | 261 // a RenderThread. Do nothing in that case. |
| 262 if (RenderThread::current()) | 262 if (RenderThread::current()) |
| 263 RenderThread::current()->InformHostOfCacheStatsLater(); | 263 RenderThread::current()->InformHostOfCacheStatsLater(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void CloseIdleConnections() { | 266 void CloseIdleConnections() { |
| 267 RenderThread::current()->CloseIdleConnections(); | 267 RenderThread::current()->CloseIdleConnections(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SetCacheMode(bool enabled) { | 270 void SetCacheMode(bool enabled) { |
| 271 RenderThread::current()->SetCacheMode(enabled); | 271 RenderThread::current()->SetCacheMode(enabled); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace webkit_glue | 274 } // namespace webkit_glue |
| OLD | NEW |