| OLD | NEW |
| 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 #include "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <mlang.h> | 8 #include <mlang.h> |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 static const char kDataUrlPattern[] = "data:"; | 77 static const char kDataUrlPattern[] = "data:"; |
| 78 static const std::string::size_type kDataUrlPatternSize = | 78 static const std::string::size_type kDataUrlPatternSize = |
| 79 arraysize(kDataUrlPattern) - 1; | 79 arraysize(kDataUrlPattern) - 1; |
| 80 static const char kFileTestPrefix[] = "(file test):"; | 80 static const char kFileTestPrefix[] = "(file test):"; |
| 81 | 81 |
| 82 //------------------------------------------------------------------------------ | 82 //------------------------------------------------------------------------------ |
| 83 // webkit_glue impl: | 83 // webkit_glue impl: |
| 84 | 84 |
| 85 namespace webkit_glue { | 85 namespace webkit_glue { |
| 86 | 86 |
| 87 // Global variable used by the plugin quirk "die after unload". | |
| 88 bool g_forcefully_terminate_plugin_process = false; | |
| 89 | |
| 90 void SetJavaScriptFlags(const std::string& str) { | 87 void SetJavaScriptFlags(const std::string& str) { |
| 91 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); | 88 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); |
| 92 } | 89 } |
| 93 | 90 |
| 94 void EnableWebCoreLogChannels(const std::string& channels) { | 91 void EnableWebCoreLogChannels(const std::string& channels) { |
| 95 if (channels.empty()) | 92 if (channels.empty()) |
| 96 return; | 93 return; |
| 97 base::StringTokenizer t(channels, ", "); | 94 base::StringTokenizer t(channels, ", "); |
| 98 while (t.GetNext()) { | 95 while (t.GetNext()) { |
| 99 WebKit::enableLogChannel(t.token().c_str()); | 96 WebKit::enableLogChannel(t.token().c_str()); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); | 150 web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); |
| 154 else | 151 else |
| 155 web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); | 152 web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); |
| 156 web_file_info->length = file_info.size; | 153 web_file_info->length = file_info.size; |
| 157 if (file_info.is_directory) | 154 if (file_info.is_directory) |
| 158 web_file_info->type = WebKit::WebFileInfo::TypeDirectory; | 155 web_file_info->type = WebKit::WebFileInfo::TypeDirectory; |
| 159 else | 156 else |
| 160 web_file_info->type = WebKit::WebFileInfo::TypeFile; | 157 web_file_info->type = WebKit::WebFileInfo::TypeFile; |
| 161 } | 158 } |
| 162 | 159 |
| 163 void SetForcefullyTerminatePluginProcess(bool value) { | |
| 164 g_forcefully_terminate_plugin_process = value; | |
| 165 } | |
| 166 | |
| 167 bool ShouldForcefullyTerminatePluginProcess() { | |
| 168 return g_forcefully_terminate_plugin_process; | |
| 169 } | |
| 170 | |
| 171 WebCanvas* ToWebCanvas(skia::PlatformCanvas* canvas) { | 160 WebCanvas* ToWebCanvas(skia::PlatformCanvas* canvas) { |
| 172 return canvas; | 161 return canvas; |
| 173 } | 162 } |
| 174 | 163 |
| 175 int GetGlyphPageCount() { | 164 int GetGlyphPageCount() { |
| 176 return WebGlyphCache::pageCount(); | 165 return WebGlyphCache::pageCount(); |
| 177 } | 166 } |
| 178 | 167 |
| 179 std::string GetInspectorProtocolVersion() { | 168 std::string GetInspectorProtocolVersion() { |
| 180 return WebDevToolsAgent::inspectorProtocolVersion().utf8(); | 169 return WebDevToolsAgent::inspectorProtocolVersion().utf8(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 base::GetCurrentProcessHandle())); | 228 base::GetCurrentProcessHandle())); |
| 240 return process_metrics->GetPagefileUsage() >> 10; | 229 return process_metrics->GetPagefileUsage() >> 10; |
| 241 } | 230 } |
| 242 #endif | 231 #endif |
| 243 | 232 |
| 244 double ZoomFactorToZoomLevel(double factor) { | 233 double ZoomFactorToZoomLevel(double factor) { |
| 245 return WebView::zoomFactorToZoomLevel(factor); | 234 return WebView::zoomFactorToZoomLevel(factor); |
| 246 } | 235 } |
| 247 | 236 |
| 248 } // namespace webkit_glue | 237 } // namespace webkit_glue |
| OLD | NEW |