| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ | 5 #ifndef CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ |
| 6 #define CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ | 6 #define CHROME_RENDERER_RENDERER_WEBKIT_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
| 9 #include "webkit/glue/simple_webmimeregistry_impl.h" | 9 #include "webkit/glue/simple_webmimeregistry_impl.h" |
| 10 #include "webkit/glue/webclipboard_impl.h" | 10 #include "webkit/glue/webclipboard_impl.h" |
| 11 #include "webkit/glue/webkitclient_impl.h" | 11 #include "webkit/glue/webkitclient_impl.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include "webkit/api/public/win/WebSandboxSupport.h" | 14 #include "webkit/api/public/win/WebSandboxSupport.h" |
| 15 #elif defined(OS_LINUX) | 15 #elif defined(OS_LINUX) |
| 16 #include <string> | 16 #include <string> |
| 17 #include <map> | 17 #include <map> |
| 18 #include "base/lock.h" | 18 #include "base/lock.h" |
| 19 #include "webkit/api/public/linux/WebSandboxSupport.h" | 19 #include "webkit/api/public/linux/WebSandboxSupport.h" |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { | 22 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { |
| 23 public: | 23 public: |
| 24 RendererWebKitClientImpl() : sudden_termination_disables_(0) {} |
| 25 |
| 24 // WebKitClient methods: | 26 // WebKitClient methods: |
| 25 virtual WebKit::WebClipboard* clipboard(); | 27 virtual WebKit::WebClipboard* clipboard(); |
| 26 virtual WebKit::WebMimeRegistry* mimeRegistry(); | 28 virtual WebKit::WebMimeRegistry* mimeRegistry(); |
| 27 virtual WebKit::WebSandboxSupport* sandboxSupport(); | 29 virtual WebKit::WebSandboxSupport* sandboxSupport(); |
| 28 virtual bool sandboxEnabled(); | 30 virtual bool sandboxEnabled(); |
| 29 virtual bool getFileSize(const WebKit::WebString& path, long long& result); | 31 virtual bool getFileSize(const WebKit::WebString& path, long long& result); |
| 30 virtual unsigned long long visitedLinkHash( | 32 virtual unsigned long long visitedLinkHash( |
| 31 const char* canonicalURL, size_t length); | 33 const char* canonicalURL, size_t length); |
| 32 virtual bool isLinkVisited(unsigned long long linkHash); | 34 virtual bool isLinkVisited(unsigned long long linkHash); |
| 33 virtual WebKit::WebMessagePortChannel* createMessagePortChannel(); | 35 virtual WebKit::WebMessagePortChannel* createMessagePortChannel(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 std::map<std::string, std::string> unicode_font_families_; | 84 std::map<std::string, std::string> unicode_font_families_; |
| 83 }; | 85 }; |
| 84 #endif | 86 #endif |
| 85 | 87 |
| 86 webkit_glue::WebClipboardImpl clipboard_; | 88 webkit_glue::WebClipboardImpl clipboard_; |
| 87 | 89 |
| 88 MimeRegistry mime_registry_; | 90 MimeRegistry mime_registry_; |
| 89 #if defined(OS_WIN) || defined(OS_LINUX) | 91 #if defined(OS_WIN) || defined(OS_LINUX) |
| 90 SandboxSupport sandbox_support_; | 92 SandboxSupport sandbox_support_; |
| 91 #endif | 93 #endif |
| 94 |
| 95 // This counter keeps track of the number of times sudden termination is |
| 96 // enabled or disabled. It starts at 0 (enabled) and for every disable |
| 97 // increments by 1, for every enable decrements by 1. When it reaches 0, |
| 98 // we tell the browser to enable fast termination. |
| 99 int sudden_termination_disables_; |
| 92 }; | 100 }; |
| 93 | 101 |
| 94 #endif // CHROME_RENDERER_WEBKIT_CLIENT_IMPL_H_ | 102 #endif // CHROME_RENDERER_WEBKIT_CLIENT_IMPL_H_ |
| OLD | NEW |