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 <objidl.h> | 9 #include <objidl.h> |
9 #include <mlang.h> | |
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
11 #include <sys/utsname.h> | 11 #include <sys/utsname.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #if defined(OS_LINUX) | 14 #if defined(OS_LINUX) |
15 #include <malloc.h> | 15 #include <malloc.h> |
16 #endif | 16 #endif |
17 | 17 |
18 #include <limits> | 18 #include <limits> |
19 | 19 |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
22 #include "base/path_service.h" | 22 #include "base/path_service.h" |
23 #include "base/process_util.h" | 23 #include "base/process_util.h" |
24 #include "base/string_piece.h" | 24 #include "base/string_piece.h" |
25 #include "base/string_tokenizer.h" | |
26 #include "base/string_util.h" | 25 #include "base/string_util.h" |
27 #include "base/stringprintf.h" | 26 #include "base/stringprintf.h" |
| 27 #include "base/strings/string_tokenizer.h" |
28 #include "base/sys_info.h" | 28 #include "base/sys_info.h" |
29 #include "base/utf_string_conversions.h" | 29 #include "base/utf_string_conversions.h" |
30 #include "net/base/escape.h" | 30 #include "net/base/escape.h" |
31 #include "net/url_request/url_request.h" | 31 #include "net/url_request/url_request.h" |
32 #include "skia/ext/platform_canvas.h" | 32 #include "skia/ext/platform_canvas.h" |
33 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
34 #include "skia/ext/skia_utils_mac.h" | 34 #include "skia/ext/skia_utils_mac.h" |
35 #endif | 35 #endif |
36 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" | 36 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
37 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" | 37 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 void SetJavaScriptFlags(const std::string& str) { | 91 void SetJavaScriptFlags(const std::string& str) { |
92 #if WEBKIT_USING_V8 | 92 #if WEBKIT_USING_V8 |
93 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); | 93 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); |
94 #endif | 94 #endif |
95 } | 95 } |
96 | 96 |
97 void EnableWebCoreLogChannels(const std::string& channels) { | 97 void EnableWebCoreLogChannels(const std::string& channels) { |
98 if (channels.empty()) | 98 if (channels.empty()) |
99 return; | 99 return; |
100 StringTokenizer t(channels, ", "); | 100 base::StringTokenizer t(channels, ", "); |
101 while (t.GetNext()) { | 101 while (t.GetNext()) { |
102 WebKit::enableLogChannel(t.token().c_str()); | 102 WebKit::enableLogChannel(t.token().c_str()); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 string16 DumpDocumentText(WebFrame* web_frame) { | 106 string16 DumpDocumentText(WebFrame* web_frame) { |
107 // We use the document element's text instead of the body text here because | 107 // We use the document element's text instead of the body text here because |
108 // not all documents have a body, such as XML documents. | 108 // not all documents have a body, such as XML documents. |
109 WebElement document_element = web_frame->document().documentElement(); | 109 WebElement document_element = web_frame->document().documentElement(); |
110 if (document_element.isNull()) | 110 if (document_element.isNull()) |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 #else | 366 #else |
367 size_t MemoryUsageKB() { | 367 size_t MemoryUsageKB() { |
368 scoped_ptr<base::ProcessMetrics> process_metrics( | 368 scoped_ptr<base::ProcessMetrics> process_metrics( |
369 base::ProcessMetrics::CreateProcessMetrics( | 369 base::ProcessMetrics::CreateProcessMetrics( |
370 base::GetCurrentProcessHandle())); | 370 base::GetCurrentProcessHandle())); |
371 return process_metrics->GetPagefileUsage() >> 10; | 371 return process_metrics->GetPagefileUsage() >> 10; |
372 } | 372 } |
373 #endif | 373 #endif |
374 | 374 |
375 } // namespace webkit_glue | 375 } // namespace webkit_glue |
OLD | NEW |