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

Unified Diff: chrome/browser/ui/webui/devtools_ui.cc

Issue 2556803003: Allow temporary file system for incognito DevTools. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/devtools_ui.cc
diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc
index e16afaaa3a624c4a5fe7c6870b71679a5d01e9f6..fcd2ce99c4dffd579fb0c2a8682ebcc402f48467 100644
--- a/chrome/browser/ui/webui/devtools_ui.cc
+++ b/chrome/browser/ui/webui/devtools_ui.cc
@@ -15,6 +15,8 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_frontend_host.h"
+#include "content/public/browser/site_instance.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
@@ -26,6 +28,7 @@
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_context_getter.h"
+#include "storage/browser/fileapi/file_system_context.h"
#include "third_party/WebKit/public/public_features.h"
using content::BrowserThread;
@@ -438,8 +441,15 @@ DevToolsUI::DevToolsUI(content::WebUI* web_ui)
new DevToolsDataSource(profile->GetRequestContext()));
GURL url = web_ui->GetWebContents()->GetVisibleURL();
- if (url.spec() == SanitizeFrontendURL(url).spec())
- bindings_.reset(new DevToolsUIBindings(web_ui->GetWebContents()));
+ if (url.spec() != SanitizeFrontendURL(url).spec())
+ return;
+
+ if (profile->IsOffTheRecord()) {
+ GURL site = content::SiteInstance::GetSiteForURL(profile, url);
kinuko 2016/12/09 03:37:15 Just to be extra sure, this URL is going to be dev
dgozman 2016/12/09 05:51:46 Correct. We even sanitize it in line 444.
+ content::BrowserContext::GetStoragePartitionForSite(profile, site)->
+ GetFileSystemContext()->EnableTemporaryFileSystemInIncognito();
+ }
+ bindings_.reset(new DevToolsUIBindings(web_ui->GetWebContents()));
}
DevToolsUI::~DevToolsUI() {

Powered by Google App Engine
This is Rietveld 408576698