summaryrefslogtreecommitdiffstats
path: root/chrome/browser/file_system/browser_file_system_context.cc
blob: bbc4806afdb25d3bde493c63766ea7cbbbaf4f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/file_system/browser_file_system_context.h"

#include "base/file_path.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
#include "webkit/fileapi/file_system_quota_manager.h"

BrowserFileSystemContext::BrowserFileSystemContext(
    const FilePath& profile_path, bool is_incognito)
  : fileapi::SandboxedFileSystemContext(
        BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
        profile_path,
        is_incognito,
        CommandLine::ForCurrentProcess()->HasSwitch(
            switches::kAllowFileAccessFromFiles),
        CommandLine::ForCurrentProcess()->HasSwitch(
            switches::kUnlimitedQuotaForFiles)) {
}

void BrowserFileSystemContext::SetOriginQuotaUnlimited(const GURL& url) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
  quota_manager()->SetOriginQuotaUnlimited(url);
}

void BrowserFileSystemContext::ResetOriginQuotaUnlimited(const GURL& url) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
  quota_manager()->ResetOriginQuotaUnlimited(url);
}

BrowserFileSystemContext::~BrowserFileSystemContext() {}