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

Side by Side Diff: webkit/tools/test_shell/simple_dom_storage_system.cc

Issue 9999021: Don't hardcode the "Local Storage" directory name in DomStorageContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 years, 8 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 "webkit/tools/test_shell/simple_dom_storage_system.h" 5 #include "webkit/tools/test_shell/simple_dom_storage_system.h"
6 6
7 #include "googleurl/src/gurl.h" 7 #include "googleurl/src/gurl.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h "
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 else 184 else
185 somethingCleared = false; 185 somethingCleared = false;
186 } 186 }
187 187
188 // SimpleDomStorageSystem ----------------------------- 188 // SimpleDomStorageSystem -----------------------------
189 189
190 SimpleDomStorageSystem* SimpleDomStorageSystem::g_instance_; 190 SimpleDomStorageSystem* SimpleDomStorageSystem::g_instance_;
191 191
192 SimpleDomStorageSystem::SimpleDomStorageSystem() 192 SimpleDomStorageSystem::SimpleDomStorageSystem()
193 : weak_factory_(this), 193 : weak_factory_(this),
194 context_(new DomStorageContext(FilePath(), NULL, NULL)), 194 context_(new DomStorageContext(FilePath(), FilePath(), NULL, NULL)),
195 host_(new DomStorageHost(context_)) { 195 host_(new DomStorageHost(context_)) {
196 DCHECK(!g_instance_); 196 DCHECK(!g_instance_);
197 g_instance_ = this; 197 g_instance_ = this;
198 } 198 }
199 199
200 SimpleDomStorageSystem::~SimpleDomStorageSystem() { 200 SimpleDomStorageSystem::~SimpleDomStorageSystem() {
201 g_instance_ = NULL; 201 g_instance_ = NULL;
202 host_.reset(); 202 host_.reset();
203 } 203 }
204 204
205 WebStorageNamespace* SimpleDomStorageSystem::CreateLocalStorageNamespace() { 205 WebStorageNamespace* SimpleDomStorageSystem::CreateLocalStorageNamespace() {
206 return new NamespaceImpl(weak_factory_.GetWeakPtr()); 206 return new NamespaceImpl(weak_factory_.GetWeakPtr());
207 } 207 }
208 208
209 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() { 209 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() {
210 int id = context_->AllocateSessionId(); 210 int id = context_->AllocateSessionId();
211 context_->CreateSessionNamespace(id); 211 context_->CreateSessionNamespace(id);
212 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id); 212 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id);
213 } 213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698