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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return; | 139 return; |
140 } | 140 } |
141 #endif | 141 #endif |
142 | 142 |
143 RenderThread::current()->Send( | 143 RenderThread::current()->Send( |
144 new ViewHostMsg_ClipboardWriteObjectsAsync(objects_)); | 144 new ViewHostMsg_ClipboardWriteObjectsAsync(objects_)); |
145 } | 145 } |
146 | 146 |
147 namespace webkit_glue { | 147 namespace webkit_glue { |
148 | 148 |
149 // Global variable set during RenderProcess::GlobalInit if video was enabled | |
150 // and our media libraries were successfully loaded. | |
151 static bool g_media_player_available = false; | |
152 | |
153 void SetMediaPlayerAvailable(bool value) { | |
154 g_media_player_available = value; | |
155 } | |
156 | |
157 bool IsMediaPlayerAvailable() { | |
158 return g_media_player_available; | |
159 } | |
160 | |
161 void PrecacheUrl(const wchar_t* url, int url_length) { | 149 void PrecacheUrl(const wchar_t* url, int url_length) { |
162 // TBD: jar: Need implementation that loads the targetted URL into our cache. | 150 // TBD: jar: Need implementation that loads the targetted URL into our cache. |
163 // For now, at least prefetch DNS lookup | 151 // For now, at least prefetch DNS lookup |
164 std::string url_string; | 152 std::string url_string; |
165 WideToUTF8(url, url_length, &url_string); | 153 WideToUTF8(url, url_length, &url_string); |
166 const std::string host = GURL(url_string).host(); | 154 const std::string host = GURL(url_string).host(); |
167 if (!host.empty()) | 155 if (!host.empty()) |
168 DnsPrefetchCString(host.data(), host.length()); | 156 DnsPrefetchCString(host.data(), host.length()); |
169 } | 157 } |
170 | 158 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void NotifyCacheStats() { | 235 void NotifyCacheStats() { |
248 // Update the browser about our cache | 236 // Update the browser about our cache |
249 // NOTE: Since this can be called from the plugin process, we might not have | 237 // NOTE: Since this can be called from the plugin process, we might not have |
250 // a RenderThread. Do nothing in that case. | 238 // a RenderThread. Do nothing in that case. |
251 if (!IsPluginProcess()) | 239 if (!IsPluginProcess()) |
252 RenderThread::current()->InformHostOfCacheStatsLater(); | 240 RenderThread::current()->InformHostOfCacheStatsLater(); |
253 } | 241 } |
254 | 242 |
255 | 243 |
256 } // namespace webkit_glue | 244 } // namespace webkit_glue |
OLD | NEW |