Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/renderer/renderer_webkitclient_impl.h

Issue 2811013: Mac: Infrastructure for serialization of OS fonts over IPC. (Closed)
Patch Set: Fix more style errors. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ 5 #ifndef CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_
6 #define CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ 6 #define CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_
7 7
8 #include "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "chrome/renderer/websharedworkerrepository_impl.h" 10 #include "chrome/renderer/websharedworkerrepository_impl.h"
11 #include "webkit/glue/simple_webmimeregistry_impl.h" 11 #include "webkit/glue/simple_webmimeregistry_impl.h"
12 #include "webkit/glue/webclipboard_impl.h" 12 #include "webkit/glue/webclipboard_impl.h"
13 #include "webkit/glue/webfilesystem_impl.h" 13 #include "webkit/glue/webfilesystem_impl.h"
14 #include "webkit/glue/webkitclient_impl.h" 14 #include "webkit/glue/webkitclient_impl.h"
15 15
16 #if defined(OS_WIN) 16 #if defined(OS_WIN)
17 #include "third_party/WebKit/WebKit/chromium/public/win/WebSandboxSupport.h" 17 #include "third_party/WebKit/WebKit/chromium/public/win/WebSandboxSupport.h"
18 #elif defined(OS_LINUX) 18 #elif defined(OS_LINUX)
19 #include <string> 19 #include <string>
20 #include <map> 20 #include <map>
21 #include "base/lock.h" 21 #include "base/lock.h"
22 #include "third_party/WebKit/WebKit/chromium/public/linux/WebSandboxSupport.h" 22 #include "third_party/WebKit/WebKit/chromium/public/linux/WebSandboxSupport.h"
23 #elif defined(OS_MACOSX)
24 #include "third_party/WebKit/WebKit/chromium/public/mac/WebSandboxSupport.h"
23 #endif 25 #endif
24 26
25 namespace IPC { 27 namespace IPC {
26 class SyncMessage; 28 class SyncMessage;
27 } 29 }
28 30
29 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { 31 class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
30 public: 32 public:
31 RendererWebKitClientImpl(); 33 RendererWebKitClientImpl();
32 virtual ~RendererWebKitClientImpl(); 34 virtual ~RendererWebKitClientImpl();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out); 108 const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out);
107 109
108 private: 110 private:
109 // WebKit likes to ask us for the correct font family to use for a set of 111 // WebKit likes to ask us for the correct font family to use for a set of
110 // unicode code points. It needs this information frequently so we cache it 112 // unicode code points. It needs this information frequently so we cache it
111 // here. The key in this map is an array of 16-bit UTF16 values from WebKit. 113 // here. The key in this map is an array of 16-bit UTF16 values from WebKit.
112 // The value is a string containing the correct font family. 114 // The value is a string containing the correct font family.
113 Lock unicode_font_families_mutex_; 115 Lock unicode_font_families_mutex_;
114 std::map<std::string, std::string> unicode_font_families_; 116 std::map<std::string, std::string> unicode_font_families_;
115 }; 117 };
118 #elif defined(OS_MACOSX)
119 class SandboxSupport : public WebKit::WebSandboxSupport {
120 public:
121 virtual bool loadFont(NSFont* srcFont, ATSFontContainerRef* out);
122 };
116 #endif 123 #endif
117 124
118 // Helper function to send synchronous message from any thread. 125 // Helper function to send synchronous message from any thread.
119 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg); 126 static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg);
120 127
121 webkit_glue::WebClipboardImpl clipboard_; 128 webkit_glue::WebClipboardImpl clipboard_;
122 129
123 FileSystem file_system_; 130 FileSystem file_system_;
124 131
125 MimeRegistry mime_registry_; 132 MimeRegistry mime_registry_;
126 #if defined(OS_WIN) || defined(OS_LINUX) 133
127 SandboxSupport sandbox_support_; 134 SandboxSupport sandbox_support_;
128 #endif
129 135
130 // This counter keeps track of the number of times sudden termination is 136 // This counter keeps track of the number of times sudden termination is
131 // enabled or disabled. It starts at 0 (enabled) and for every disable 137 // enabled or disabled. It starts at 0 (enabled) and for every disable
132 // increments by 1, for every enable decrements by 1. When it reaches 0, 138 // increments by 1, for every enable decrements by 1. When it reaches 0,
133 // we tell the browser to enable fast termination. 139 // we tell the browser to enable fast termination.
134 int sudden_termination_disables_; 140 int sudden_termination_disables_;
135 141
136 // Implementation of the WebSharedWorkerRepository APIs (provides an interface 142 // Implementation of the WebSharedWorkerRepository APIs (provides an interface
137 // to WorkerService on the browser thread. 143 // to WorkerService on the browser thread.
138 WebSharedWorkerRepositoryImpl shared_worker_repository_; 144 WebSharedWorkerRepositoryImpl shared_worker_repository_;
139 145
140 scoped_ptr<WebKit::WebIndexedDatabase> web_indexed_database_; 146 scoped_ptr<WebKit::WebIndexedDatabase> web_indexed_database_;
141 }; 147 };
142 148
143 #endif // CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_ 149 #endif // CHROME_RENDERER_RENDERER_WEBKITCLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698