Commit b27231d3 authored by timvolodine's avatar timvolodine Committed by Commit Bot

Always create safe browsing specific directory in WebView.

We need to create the safe browsing directory for storing
safe browsing related cookies. This should happen in any case
as the safe browsing functionality can be enabled on a
per webview basis at runtime.

BUG=700351, 688629

Review-Url: https://codereview.chromium.org/2969693002
Cr-Commit-Position: refs/heads/master@{#485595}
parent f7fa8b08
......@@ -9,7 +9,6 @@
#include "android_webview/browser/aw_content_browser_client.h"
#include "android_webview/browser/aw_metrics_service_client.h"
#include "android_webview/browser/aw_result_codes.h"
#include "android_webview/browser/aw_safe_browsing_config_helper.h"
#include "android_webview/browser/deferred_gpu_command_service.h"
#include "android_webview/browser/net/aw_network_change_notifier_factory.h"
#include "android_webview/common/aw_descriptors.h"
......@@ -135,13 +134,15 @@ int AwBrowserMainParts::PreCreateThreads() {
}
}
if (AwSafeBrowsingConfigHelper::GetSafeBrowsingEnabled()) {
base::FilePath safe_browsing_dir;
if (PathService::Get(android_webview::DIR_SAFE_BROWSING,
&safe_browsing_dir)) {
if (!base::PathExists(safe_browsing_dir))
base::CreateDirectory(safe_browsing_dir);
}
// We need to create the safe browsing specific directory even if the
// AwSafeBrowsingConfigHelper::GetSafeBrowsingEnabled() is false
// initially, because safe browsing can be enabled later at runtime
// on a per-webview basis.
base::FilePath safe_browsing_dir;
if (PathService::Get(android_webview::DIR_SAFE_BROWSING,
&safe_browsing_dir)) {
if (!base::PathExists(safe_browsing_dir))
base::CreateDirectory(safe_browsing_dir);
}
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment