diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-24 22:10:20 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-24 22:10:20 +0000 |
commit | 6bd867b0c6db7782ad5afae9d990e924bfc6d311 (patch) | |
tree | 41c1d97aa4d0a262fa3105087d272c5a327dd078 /webkit/glue | |
parent | d5f52957f885b07309142180cbc6a06f2a36e25a (diff) | |
download | chromium_src-6bd867b0c6db7782ad5afae9d990e924bfc6d311.zip chromium_src-6bd867b0c6db7782ad5afae9d990e924bfc6d311.tar.gz chromium_src-6bd867b0c6db7782ad5afae9d990e924bfc6d311.tar.bz2 |
Thin out webkit_glue.{h,cc} a bit more.
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/19931009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/webkit_glue.cc | 59 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 23 |
2 files changed, 1 insertions, 81 deletions
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index 4c832f3..30b03e5 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -4,65 +4,16 @@ #include "webkit/glue/webkit_glue.h" -#if defined(OS_LINUX) -#include <malloc.h> -#endif - #include "base/logging.h" -#include "base/memory/scoped_ptr.h" -#include "base/process_util.h" -#include "base/strings/string_tokenizer.h" -#include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" -#include "net/base/escape.h" -#include "skia/ext/platform_canvas.h" #include "third_party/WebKit/public/platform/WebFileInfo.h" -#include "third_party/WebKit/public/web/WebFrame.h" -#include "third_party/WebKit/public/web/WebGlyphCache.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "v8/include/v8.h" -using WebKit::WebCanvas; -using WebKit::WebFrame; -using WebKit::WebGlyphCache; - -//------------------------------------------------------------------------------ -// webkit_glue impl: - namespace webkit_glue { void SetJavaScriptFlags(const std::string& str) { v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); } -void EnableWebCoreLogChannels(const std::string& channels) { - if (channels.empty()) - return; - base::StringTokenizer t(channels, ", "); - while (t.GetNext()) { - WebKit::enableLogChannel(t.token().c_str()); - } -} - -#ifndef NDEBUG -// The log macro was having problems due to collisions with WTF, so we just -// code here what that would have inlined. -void DumpLeakedObject(const char* file, int line, const char* object, - int count) { - std::string msg = base::StringPrintf("%s LEAKED %d TIMES", object, count); - logging::LogMessage(file, line).stream() << msg; -} -#endif - -void CheckForLeaks() { -#ifndef NDEBUG - int count = WebFrame::instanceCount(); - if (count) - DumpLeakedObject(__FILE__, __LINE__, "WebFrame", count); -#endif -} - void PlatformFileInfoToWebFileInfo( const base::PlatformFileInfo& file_info, WebKit::WebFileInfo* web_file_info) { @@ -79,14 +30,6 @@ void PlatformFileInfoToWebFileInfo( web_file_info->type = WebKit::WebFileInfo::TypeFile; } -WebCanvas* ToWebCanvas(skia::PlatformCanvas* canvas) { - return canvas; -} - -int GetGlyphPageCount() { - return WebGlyphCache::pageCount(); -} - COMPILE_ASSERT(std::numeric_limits<double>::has_quiet_NaN, has_quiet_NaN); -} // namespace webkit_glue +} // namespace webkit_glue diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index 33fed9f..c396015 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -7,14 +7,9 @@ #include <string> -#include "base/basictypes.h" #include "base/platform_file.h" -#include "base/strings/string16.h" -#include "third_party/WebKit/public/platform/WebCanvas.h" #include "webkit/glue/webkit_glue_export.h" -class SkCanvas; - namespace WebKit { struct WebFileInfo; } @@ -23,29 +18,11 @@ namespace webkit_glue { WEBKIT_GLUE_EXPORT void SetJavaScriptFlags(const std::string& flags); -// Turn on logging for flags in the provided comma delimited list. -WEBKIT_GLUE_EXPORT void EnableWebCoreLogChannels(const std::string& channels); - -#ifndef NDEBUG -// Checks various important objects to see if there are any in memory, and -// calls AppendToLog with any leaked objects. Designed to be called on -// shutdown. -WEBKIT_GLUE_EXPORT void CheckForLeaks(); -#endif - // File info conversion WEBKIT_GLUE_EXPORT void PlatformFileInfoToWebFileInfo( const base::PlatformFileInfo& file_info, WebKit::WebFileInfo* web_file_info); -// Returns a WebCanvas pointer associated with the given Skia canvas. -WEBKIT_GLUE_EXPORT WebKit::WebCanvas* ToWebCanvas(SkCanvas*); - -// Returns the number of currently-active glyph pages this process is using. -// There can be many such pages (maps of 256 character -> glyph) so this is -// used to get memory usage statistics. -WEBKIT_GLUE_EXPORT int GetGlyphPageCount(); - } // namespace webkit_glue #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ |