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

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

Issue 11648027: Extract external file systems handling from isolated context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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) 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/file_system_url.h" 5 #include "webkit/fileapi/file_system_url.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "net/base/escape.h" 11 #include "net/base/escape.h"
12 #include "webkit/fileapi/external_mount_points.h"
12 #include "webkit/fileapi/file_system_types.h" 13 #include "webkit/fileapi/file_system_types.h"
13 #include "webkit/fileapi/file_system_util.h" 14 #include "webkit/fileapi/file_system_util.h"
14 #include "webkit/fileapi/isolated_context.h" 15 #include "webkit/fileapi/isolated_context.h"
15 16
16 namespace fileapi { 17 namespace fileapi {
17 18
18 namespace { 19 namespace {
19 20
20 bool CrackFileSystemURL( 21 bool CrackFileSystemURL(
21 const GURL& url, 22 const GURL& url,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (lhs.type_ != rhs.type_) 149 if (lhs.type_ != rhs.type_)
149 return lhs.type_ < rhs.type_; 150 return lhs.type_ < rhs.type_;
150 if (lhs.filesystem_id_ != rhs.filesystem_id_) 151 if (lhs.filesystem_id_ != rhs.filesystem_id_)
151 return lhs.filesystem_id_ < rhs.filesystem_id_; 152 return lhs.filesystem_id_ < rhs.filesystem_id_;
152 return lhs.path_ < rhs.path_; 153 return lhs.path_ < rhs.path_;
153 } 154 }
154 155
155 void FileSystemURL::MayCrackIsolatedPath() { 156 void FileSystemURL::MayCrackIsolatedPath() {
156 path_ = virtual_path_; 157 path_ = virtual_path_;
157 mount_type_ = type_; 158 mount_type_ = type_;
158 if (is_valid_ && IsolatedContext::IsIsolatedType(type_)) { 159 if (is_valid_ && IsolatedContext::IsIsolatedType(type_)) {
kinuko 2013/01/08 12:22:43 Maybe we should do like: if (!is_valid_) return
tbarzic 2013/01/09 01:26:34 I plan to do something like this in the next cl (h
159 // If the type is isolated, crack the path further to get the 'real' 160 // If the type is isolated, crack the path further to get the 'real'
160 // filesystem type and path. 161 // filesystem type and path.
162 is_valid_ = ExternalMountPoints::GetSystemInstance()->CrackExternalPath(
163 virtual_path_, &filesystem_id_, &type_, &path_);
164 if (is_valid_)
165 return;
161 is_valid_ = IsolatedContext::GetInstance()->CrackIsolatedPath( 166 is_valid_ = IsolatedContext::GetInstance()->CrackIsolatedPath(
162 virtual_path_, &filesystem_id_, &type_, &path_); 167 virtual_path_, &filesystem_id_, &type_, &path_);
163 } 168 }
164 } 169 }
165 170
166 } // namespace fileapi 171 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698