OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/render_sandbox_host_linux.h" | 5 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #include <sys/uio.h> | 9 #include <sys/uio.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 // --------------------------------------------------------------------------- | 108 // --------------------------------------------------------------------------- |
109 // WebKitClient impl... | 109 // WebKitClient impl... |
110 | 110 |
111 virtual WebClipboard* clipboard() { return NULL; } | 111 virtual WebClipboard* clipboard() { return NULL; } |
112 virtual WebMimeRegistry* mimeRegistry() { return NULL; } | 112 virtual WebMimeRegistry* mimeRegistry() { return NULL; } |
113 virtual WebSandboxSupport* sandboxSupport() { return NULL; } | 113 virtual WebSandboxSupport* sandboxSupport() { return NULL; } |
| 114 virtual bool sandboxEnabled() { return true; } |
114 virtual WebThemeEngine* themeEngine() { return NULL; } | 115 virtual WebThemeEngine* themeEngine() { return NULL; } |
115 | 116 |
116 virtual WebStorageNamespace* createLocalStorageNamespace( | 117 virtual WebStorageNamespace* createLocalStorageNamespace( |
117 const WebString& path) { return 0; } | 118 const WebString& path) { return 0; } |
118 virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; } | 119 virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; } |
119 | 120 |
120 virtual bool getFileSize(const WebString& path, long long& result) { | |
121 return false; | |
122 } | |
123 | |
124 virtual unsigned long long visitedLinkHash(const char*, size_t) { return 0; } | 121 virtual unsigned long long visitedLinkHash(const char*, size_t) { return 0; } |
125 virtual bool isLinkVisited(unsigned long long) { return false; } | 122 virtual bool isLinkVisited(unsigned long long) { return false; } |
126 | 123 |
127 virtual WebKit::WebMessagePortChannel* createMessagePortChannel() { | 124 virtual WebKit::WebMessagePortChannel* createMessagePortChannel() { |
128 return NULL; | 125 return NULL; |
129 } | 126 } |
130 | 127 |
131 virtual void setCookies(const WebURL&, const WebURL&, const WebString&) { } | 128 virtual void setCookies(const WebURL&, const WebURL&, const WebString&) { } |
132 virtual WebString cookies(const WebURL&, const WebURL&) { return WebString();
} | 129 virtual WebString cookies(const WebURL&, const WebURL&) { |
| 130 return WebString(); |
| 131 } |
133 | 132 |
134 virtual void prefetchHostName(const WebString&) { } | 133 virtual void prefetchHostName(const WebString&) { } |
135 | 134 |
136 virtual WebURLLoader* createURLLoader() { return NULL; } | 135 virtual WebURLLoader* createURLLoader() { return NULL; } |
137 | 136 |
138 virtual void getPluginList(bool refresh, WebPluginListBuilder*) { } | 137 virtual void getPluginList(bool refresh, WebPluginListBuilder*) { } |
139 | 138 |
140 virtual void decrementStatsCounter(const char*) { } | 139 virtual void decrementStatsCounter(const char*) { } |
141 virtual void incrementStatsCounter(const char*) { } | 140 virtual void incrementStatsCounter(const char*) { } |
142 | 141 |
(...skipping 27 matching lines...) Expand all Loading... |
170 virtual bool databaseDeleteFile(const WebString& fileName) { | 169 virtual bool databaseDeleteFile(const WebString& fileName) { |
171 return false; | 170 return false; |
172 } | 171 } |
173 virtual long databaseGetFileAttributes(const WebString& fileName) { | 172 virtual long databaseGetFileAttributes(const WebString& fileName) { |
174 return -1; | 173 return -1; |
175 } | 174 } |
176 virtual long long databaseGetFileSize(const WebString& fileName) { | 175 virtual long long databaseGetFileSize(const WebString& fileName) { |
177 return 0; | 176 return 0; |
178 } | 177 } |
179 | 178 |
| 179 bool fileExists(const WebString& path) { return false; } |
| 180 bool deleteFile(const WebString& path) { return false; } |
| 181 bool deleteEmptyDirectory(const WebString& path) { return false; } |
| 182 bool getFileSize(const WebString& path, long long& result) { |
| 183 return false; |
| 184 } |
| 185 bool getFileModificationTime(const WebString& path, time_t& result) { |
| 186 return false; |
| 187 } |
| 188 WebString directoryName(const WebString& path) { return WebString(); } |
| 189 WebString pathByAppendingComponent(const WebString& path, |
| 190 const WebString& component) { |
| 191 return WebString(); |
| 192 } |
| 193 bool makeAllDirectories(const WebString& path) { return false; } |
| 194 |
180 private: | 195 private: |
181 // --------------------------------------------------------------------------- | 196 // --------------------------------------------------------------------------- |
182 // Requests from the renderer... | 197 // Requests from the renderer... |
183 | 198 |
184 void HandleRequestFromRenderer(int fd) { | 199 void HandleRequestFromRenderer(int fd) { |
185 std::vector<int> fds; | 200 std::vector<int> fds; |
186 static const unsigned kMaxMessageLength = 2048; | 201 static const unsigned kMaxMessageLength = 2048; |
187 char buf[kMaxMessageLength]; | 202 char buf[kMaxMessageLength]; |
188 const ssize_t len = base::RecvMsg(fd, buf, sizeof(buf), &fds); | 203 const ssize_t len = base::RecvMsg(fd, buf, sizeof(buf), &fds); |
189 if (len == -1) | 204 if (len == -1) |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 SandboxIPCProcess handler(child_lifeline_fd, browser_socket); | 404 SandboxIPCProcess handler(child_lifeline_fd, browser_socket); |
390 handler.Run(); | 405 handler.Run(); |
391 _exit(0); | 406 _exit(0); |
392 } | 407 } |
393 } | 408 } |
394 | 409 |
395 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 410 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
396 HANDLE_EINTR(close(renderer_socket_)); | 411 HANDLE_EINTR(close(renderer_socket_)); |
397 HANDLE_EINTR(close(childs_lifeline_fd_)); | 412 HANDLE_EINTR(close(childs_lifeline_fd_)); |
398 } | 413 } |
OLD | NEW |