OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 306 } |
307 | 307 |
308 RenderThreadImpl* thread = RenderThreadImpl::current(); | 308 RenderThreadImpl* thread = RenderThreadImpl::current(); |
309 if (thread) // NULL in unittests. | 309 if (thread) // NULL in unittests. |
310 thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled)); | 310 thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled)); |
311 } | 311 } |
312 | 312 |
313 WebStorageNamespace* | 313 WebStorageNamespace* |
314 RendererWebKitPlatformSupportImpl::createLocalStorageNamespace( | 314 RendererWebKitPlatformSupportImpl::createLocalStorageNamespace( |
315 const WebString& path, unsigned quota) { | 315 const WebString& path, unsigned quota) { |
316 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND | |
317 return new RendererWebStorageNamespaceImpl(); | 316 return new RendererWebStorageNamespaceImpl(); |
318 #else | |
319 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | |
320 return WebStorageNamespace::createLocalStorageNamespace(path, quota); | |
321 return new RendererWebStorageNamespaceImpl(); | |
322 #endif | |
323 } | 317 } |
324 | 318 |
325 void RendererWebKitPlatformSupportImpl::dispatchStorageEvent( | |
326 const WebString& key, const WebString& old_value, | |
327 const WebString& new_value, const WebString& origin, | |
328 const WebKit::WebURL& url, bool is_local_storage) { | |
329 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND | |
330 NOTREACHED(); | |
331 #else | |
332 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); | |
333 // Inefficient, but only used in single process mode. | |
334 scoped_ptr<WebStorageEventDispatcher> event_dispatcher( | |
335 WebStorageEventDispatcher::create()); | |
336 event_dispatcher->dispatchStorageEvent(key, old_value, new_value, origin, | |
337 url, is_local_storage); | |
338 #endif | |
339 } | |
340 | 319 |
341 //------------------------------------------------------------------------------ | 320 //------------------------------------------------------------------------------ |
342 | 321 |
343 WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() { | 322 WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() { |
344 if (!web_idb_factory_.get()) { | 323 if (!web_idb_factory_.get()) { |
345 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 324 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
346 web_idb_factory_.reset(WebIDBFactory::create()); | 325 web_idb_factory_.reset(WebIDBFactory::create()); |
347 else | 326 else |
348 web_idb_factory_.reset(new RendererWebIDBFactoryImpl()); | 327 web_idb_factory_.reset(new RendererWebIDBFactoryImpl()); |
349 } | 328 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 DCHECK(render_thread); | 728 DCHECK(render_thread); |
750 if (!render_thread) | 729 if (!render_thread) |
751 return NULL; | 730 return NULL; |
752 return render_thread->CreateMediaStreamCenter(client); | 731 return render_thread->CreateMediaStreamCenter(client); |
753 } | 732 } |
754 | 733 |
755 GpuChannelHostFactory* | 734 GpuChannelHostFactory* |
756 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 735 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
757 return RenderThreadImpl::current(); | 736 return RenderThreadImpl::current(); |
758 } | 737 } |
OLD | NEW |