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

Side by Side Diff: content/browser/in_process_webkit/dom_storage_area.cc

Issue 8929007: Restore sessionStorage when chrome restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix: cloning storage areas. Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/in_process_webkit/dom_storage_area.h" 5 #include "content/browser/in_process_webkit/dom_storage_area.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/in_process_webkit/dom_storage_context.h" 8 #include "content/browser/in_process_webkit/dom_storage_context.h"
9 #include "content/browser/in_process_webkit/dom_storage_namespace.h" 9 #include "content/browser/in_process_webkit/dom_storage_namespace.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 CreateWebStorageAreaIfNecessary(); 67 CreateWebStorageAreaIfNecessary();
68 bool somethingCleared; 68 bool somethingCleared;
69 storage_area_->clear(WebURL(), somethingCleared); 69 storage_area_->clear(WebURL(), somethingCleared);
70 return somethingCleared; 70 return somethingCleared;
71 } 71 }
72 72
73 void DOMStorageArea::PurgeMemory() { 73 void DOMStorageArea::PurgeMemory() {
74 storage_area_.reset(); 74 storage_area_.reset();
75 } 75 }
76 76
77 void DOMStorageArea::CopyDataTo(DOMStorageArea* other) {
78 for (unsigned i = 0; i < Length(); ++i) {
79 string16 key = Key(i).string();
80 WebStorageArea::Result result;
81 other->SetItem(key, GetItem(key).string(), &result);
82 }
83 }
84
77 void DOMStorageArea::CreateWebStorageAreaIfNecessary() { 85 void DOMStorageArea::CreateWebStorageAreaIfNecessary() {
78 if (!storage_area_.get()) 86 if (!storage_area_.get())
79 storage_area_.reset(owner_->CreateWebStorageArea(origin_)); 87 storage_area_.reset(owner_->CreateWebStorageArea(origin_));
80 } 88 }
OLDNEW
« no previous file with comments | « content/browser/in_process_webkit/dom_storage_area.h ('k') | content/browser/in_process_webkit/dom_storage_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698