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

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 9826040: Hook up new DomStorage backing for for single-process chromium too. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 304 }
305 305
306 RenderThreadImpl* thread = RenderThreadImpl::current(); 306 RenderThreadImpl* thread = RenderThreadImpl::current();
307 if (thread) // NULL in unittests. 307 if (thread) // NULL in unittests.
308 thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled)); 308 thread->Send(new ViewHostMsg_SuddenTerminationChanged(enabled));
309 } 309 }
310 310
311 WebStorageNamespace* 311 WebStorageNamespace*
312 RendererWebKitPlatformSupportImpl::createLocalStorageNamespace( 312 RendererWebKitPlatformSupportImpl::createLocalStorageNamespace(
313 const WebString& path, unsigned quota) { 313 const WebString& path, unsigned quota) {
314 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
315 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_LOCAL);
316 #else
314 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) 317 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess))
315 return WebStorageNamespace::createLocalStorageNamespace(path, quota); 318 return WebStorageNamespace::createLocalStorageNamespace(path, quota);
316 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_LOCAL); 319 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_LOCAL);
320 #endif
317 } 321 }
318 322
319 void RendererWebKitPlatformSupportImpl::dispatchStorageEvent( 323 void RendererWebKitPlatformSupportImpl::dispatchStorageEvent(
320 const WebString& key, const WebString& old_value, 324 const WebString& key, const WebString& old_value,
321 const WebString& new_value, const WebString& origin, 325 const WebString& new_value, const WebString& origin,
322 const WebKit::WebURL& url, bool is_local_storage) { 326 const WebKit::WebURL& url, bool is_local_storage) {
327 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
328 NOTREACHED();
329 #else
323 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); 330 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess));
324 // Inefficient, but only used in single process mode. 331 // Inefficient, but only used in single process mode.
325 scoped_ptr<WebStorageEventDispatcher> event_dispatcher( 332 scoped_ptr<WebStorageEventDispatcher> event_dispatcher(
326 WebStorageEventDispatcher::create()); 333 WebStorageEventDispatcher::create());
327 event_dispatcher->dispatchStorageEvent(key, old_value, new_value, origin, 334 event_dispatcher->dispatchStorageEvent(key, old_value, new_value, origin,
328 url, is_local_storage); 335 url, is_local_storage);
336 #endif
329 } 337 }
330 338
331 //------------------------------------------------------------------------------ 339 //------------------------------------------------------------------------------
332 340
333 WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() { 341 WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() {
334 if (!web_idb_factory_.get()) { 342 if (!web_idb_factory_.get()) {
335 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) 343 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess))
336 web_idb_factory_.reset(WebIDBFactory::create()); 344 web_idb_factory_.reset(WebIDBFactory::create());
337 else 345 else
338 web_idb_factory_.reset(new RendererWebIDBFactoryImpl()); 346 web_idb_factory_.reset(new RendererWebIDBFactoryImpl());
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 DCHECK(render_thread); 698 DCHECK(render_thread);
691 if (!render_thread) 699 if (!render_thread)
692 return NULL; 700 return NULL;
693 return render_thread->CreateMediaStreamCenter(client); 701 return render_thread->CreateMediaStreamCenter(client);
694 } 702 }
695 703
696 GpuChannelHostFactory* 704 GpuChannelHostFactory*
697 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { 705 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() {
698 return RenderThreadImpl::current(); 706 return RenderThreadImpl::current();
699 } 707 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/renderer_webstoragenamespace_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698