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

Side by Side Diff: webkit/fileapi/isolated_context.cc

Issue 10408078: Cleanup: Remove unneeded scoped_ptr.h includes from webkit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « webkit/fileapi/file_system_test_helper.h ('k') | webkit/fileapi/local_file_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/fileapi/isolated_context.h" 5 #include "webkit/fileapi/isolated_context.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 12
13 namespace fileapi { 13 namespace fileapi {
14 14
15 static base::LazyInstance<IsolatedContext>::Leaky g_isolated_context = 15 static base::LazyInstance<IsolatedContext>::Leaky g_isolated_context =
16 LAZY_INSTANCE_INITIALIZER; 16 LAZY_INSTANCE_INITIALIZER;
17 17
18 // static 18 // static
19 IsolatedContext* IsolatedContext::GetInstance() { 19 IsolatedContext* IsolatedContext::GetInstance() {
20 return &g_isolated_context.Get(); 20 return g_isolated_context.Pointer();
21 } 21 }
22 22
23 std::string IsolatedContext::RegisterIsolatedFileSystem( 23 std::string IsolatedContext::RegisterIsolatedFileSystem(
24 const std::set<FilePath>& files) { 24 const std::set<FilePath>& files) {
25 base::AutoLock locker(lock_); 25 base::AutoLock locker(lock_);
26 std::string filesystem_id = GetNewFileSystemId(); 26 std::string filesystem_id = GetNewFileSystemId();
27 // Stores basename to fullpath map, as we store the basenames as 27 // Stores basename to fullpath map, as we store the basenames as
28 // the filesystem's toplevel entries. 28 // the filesystem's toplevel entries.
29 PathMap toplevels; 29 PathMap toplevels;
30 for (std::set<FilePath>::const_iterator iter = files.begin(); 30 for (std::set<FilePath>::const_iterator iter = files.begin();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 uint32 random_data[4]; 134 uint32 random_data[4];
135 std::string id; 135 std::string id;
136 do { 136 do {
137 base::RandBytes(random_data, sizeof(random_data)); 137 base::RandBytes(random_data, sizeof(random_data));
138 id = base::HexEncode(random_data, sizeof(random_data)); 138 id = base::HexEncode(random_data, sizeof(random_data));
139 } while (toplevel_map_.find(id) != toplevel_map_.end()); 139 } while (toplevel_map_.find(id) != toplevel_map_.end());
140 return id; 140 return id;
141 } 141 }
142 142
143 } // namespace fileapi 143 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_test_helper.h ('k') | webkit/fileapi/local_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698