| 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 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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 "googleurl/src/url_util.h" | 27 #include "googleurl/src/url_util.h" |
| 28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
| 29 #include "webkit/api/public/WebKit.h" | 29 #include "webkit/api/public/WebKit.h" |
| 30 #include "webkit/api/public/WebKitClient.h" | 30 #include "webkit/api/public/WebKitClient.h" |
| 31 #include "webkit/api/public/WebString.h" | 31 #include "webkit/api/public/WebString.h" |
| 32 #include "webkit/glue/scoped_clipboard_writer_glue.h" | 32 #include "webkit/glue/scoped_clipboard_writer_glue.h" |
| 33 #include "webkit/glue/webkit_glue.h" | 33 #include "webkit/glue/webkit_glue.h" |
| 34 #include "webkit/glue/websocketstreamhandle_bridge.h" |
| 34 | 35 |
| 35 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
| 36 #include <strsafe.h> // note: per msdn docs, this must *follow* other includes | 37 #include <strsafe.h> // note: per msdn docs, this must *follow* other includes |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 template <typename T, size_t stack_capacity> | 40 template <typename T, size_t stack_capacity> |
| 40 class ResizableStackArray { | 41 class ResizableStackArray { |
| 41 public: | 42 public: |
| 42 ResizableStackArray() | 43 ResizableStackArray() |
| 43 : cur_buffer_(stack_buffer_), cur_capacity_(stack_capacity) { | 44 : cur_buffer_(stack_buffer_), cur_capacity_(stack_capacity) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 ResourceType::Type resource_type, | 237 ResourceType::Type resource_type, |
| 237 int appcache_host_id, | 238 int appcache_host_id, |
| 238 int routing_id) { | 239 int routing_id) { |
| 239 ResourceDispatcher* dispatch = ChildThread::current()->resource_dispatcher(); | 240 ResourceDispatcher* dispatch = ChildThread::current()->resource_dispatcher(); |
| 240 return dispatch->CreateBridge(method, url, first_party_for_cookies, referrer, | 241 return dispatch->CreateBridge(method, url, first_party_for_cookies, referrer, |
| 241 frame_origin, main_frame_origin, headers, | 242 frame_origin, main_frame_origin, headers, |
| 242 load_flags, origin_pid, resource_type, 0, | 243 load_flags, origin_pid, resource_type, 0, |
| 243 appcache_host_id, routing_id); | 244 appcache_host_id, routing_id); |
| 244 } | 245 } |
| 245 | 246 |
| 247 |
| 248 // static factory function |
| 249 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( |
| 250 WebKit::WebSocketStreamHandle* handle, |
| 251 WebSocketStreamHandleDelegate* delegate) { |
| 252 // TODO(ukai): implement dispathcer class. |
| 253 NOTREACHED(); |
| 254 return NULL; |
| 255 } |
| 256 |
| 246 void NotifyCacheStats() { | 257 void NotifyCacheStats() { |
| 247 // Update the browser about our cache | 258 // Update the browser about our cache |
| 248 // NOTE: Since this can be called from the plugin process, we might not have | 259 // NOTE: Since this can be called from the plugin process, we might not have |
| 249 // a RenderThread. Do nothing in that case. | 260 // a RenderThread. Do nothing in that case. |
| 250 if (RenderThread::current()) | 261 if (RenderThread::current()) |
| 251 RenderThread::current()->InformHostOfCacheStatsLater(); | 262 RenderThread::current()->InformHostOfCacheStatsLater(); |
| 252 } | 263 } |
| 253 | 264 |
| 254 void CloseIdleConnections() { | 265 void CloseIdleConnections() { |
| 255 RenderThread::current()->CloseIdleConnections(); | 266 RenderThread::current()->CloseIdleConnections(); |
| 256 } | 267 } |
| 257 | 268 |
| 258 void SetCacheMode(bool enabled) { | 269 void SetCacheMode(bool enabled) { |
| 259 RenderThread::current()->SetCacheMode(enabled); | 270 RenderThread::current()->SetCacheMode(enabled); |
| 260 } | 271 } |
| 261 | 272 |
| 262 } // namespace webkit_glue | 273 } // namespace webkit_glue |
| OLD | NEW |