| 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 #include "chrome/renderer/renderer_webkitclient_impl.h" | 5 #include "chrome/renderer/renderer_webkitclient_impl.h" |
| 6 | 6 |
| 7 #if defined(USE_SYSTEM_SQLITE) | 7 #if defined(USE_SYSTEM_SQLITE) |
| 8 #include <sqlite3.h> | 8 #include <sqlite3.h> |
| 9 #else | 9 #else |
| 10 #include "third_party/sqlite/preprocessed/sqlite3.h" | 10 #include "third_party/sqlite/preprocessed/sqlite3.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 DnsPrefetchCString(hostname_utf8.data(), hostname_utf8.length()); | 125 DnsPrefetchCString(hostname_utf8.data(), hostname_utf8.length()); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 WebString RendererWebKitClientImpl::defaultLocale() { | 129 WebString RendererWebKitClientImpl::defaultLocale() { |
| 130 // TODO(darin): Eliminate this webkit_glue call. | 130 // TODO(darin): Eliminate this webkit_glue call. |
| 131 return WideToUTF16(webkit_glue::GetWebKitLocale()); | 131 return WideToUTF16(webkit_glue::GetWebKitLocale()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void RendererWebKitClientImpl::suddenTerminationChanged(bool enabled) { | 134 void RendererWebKitClientImpl::suddenTerminationChanged(bool enabled) { |
| 135 if (enabled) { |
| 136 // We should not get more enables than disables, but we want it to be a |
| 137 // non-fatal error if it does happen. |
| 138 DCHECK_GT(sudden_termination_disables_, 0); |
| 139 sudden_termination_disables_ = std::max(--sudden_termination_disables_, 0); |
| 140 if (sudden_termination_disables_ != 0) |
| 141 return; |
| 142 } else { |
| 143 sudden_termination_disables_++; |
| 144 if (sudden_termination_disables_ != 1) |
| 145 return; |
| 146 } |
| 147 |
| 135 RenderThread* thread = RenderThread::current(); | 148 RenderThread* thread = RenderThread::current(); |
| 136 if (thread) // NULL in unittests. | 149 if (thread) // NULL in unittests. |
| 137 thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled)); | 150 thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled)); |
| 138 } | 151 } |
| 139 | 152 |
| 140 WebStorageNamespace* RendererWebKitClientImpl::createLocalStorageNamespace( | 153 WebStorageNamespace* RendererWebKitClientImpl::createLocalStorageNamespace( |
| 141 const WebString& path) { | 154 const WebString& path) { |
| 142 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 155 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
| 143 return WebStorageNamespace::createLocalStorageNamespace(path); | 156 return WebStorageNamespace::createLocalStorageNamespace(path); |
| 144 // The browser process decides the path, so ignore that param. | 157 // The browser process decides the path, so ignore that param. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 long long RendererWebKitClientImpl::databaseGetFileSize( | 307 long long RendererWebKitClientImpl::databaseGetFileSize( |
| 295 const WebString& file_name) { | 308 const WebString& file_name) { |
| 296 DBMessageFilter* db_message_filter = DBMessageFilter::GetInstance(); | 309 DBMessageFilter* db_message_filter = DBMessageFilter::GetInstance(); |
| 297 int message_id = db_message_filter->GetUniqueID(); | 310 int message_id = db_message_filter->GetUniqueID(); |
| 298 return db_message_filter->SendAndWait( | 311 return db_message_filter->SendAndWait( |
| 299 new ViewHostMsg_DatabaseGetFileSize( | 312 new ViewHostMsg_DatabaseGetFileSize( |
| 300 FilePath(webkit_glue::WebStringToFilePathString(file_name)), | 313 FilePath(webkit_glue::WebStringToFilePathString(file_name)), |
| 301 message_id), | 314 message_id), |
| 302 message_id, 0LL); | 315 message_id, 0LL); |
| 303 } | 316 } |
| OLD | NEW |