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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 338353007: Implementation of shared worker code path for WebView file system permission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_sharedworker
Patch Set: Rename + changes are made. Created 6 years, 6 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
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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 for (i = render_frames.begin(); i != render_frames.end(); ++i) { 1895 for (i = render_frames.begin(); i != render_frames.end(); ++i) {
1896 BrowserThread::PostTask( 1896 BrowserThread::PostTask(
1897 BrowserThread::UI, FROM_HERE, 1897 BrowserThread::UI, FROM_HERE,
1898 base::Bind(&TabSpecificContentSettings::WebDatabaseAccessed, 1898 base::Bind(&TabSpecificContentSettings::WebDatabaseAccessed,
1899 i->first, i->second, url, name, display_name, !allow)); 1899 i->first, i->second, url, name, display_name, !allow));
1900 } 1900 }
1901 1901
1902 return allow; 1902 return allow;
1903 } 1903 }
1904 1904
1905 bool ChromeContentBrowserClient::AllowWorkerFileSystem( 1905 void ChromeContentBrowserClient::RequestWorkerFileSystemAccess(
1906 const GURL& url, 1906 const GURL& url,
1907 content::ResourceContext* context, 1907 content::ResourceContext* context,
1908 const std::vector<std::pair<int, int> >& render_frames) { 1908 const std::vector<std::pair<int, int> >& render_frames,
1909 base::Callback<void(bool)> callback) {
1909 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1910 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1910 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); 1911 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
1911 CookieSettings* cookie_settings = io_data->GetCookieSettings(); 1912 CookieSettings* cookie_settings = io_data->GetCookieSettings();
1912 bool allow = cookie_settings->IsSettingCookieAllowed(url, url); 1913 bool allow = cookie_settings->IsSettingCookieAllowed(url, url);
1913 1914
1914 // Record access to file system for potential display in UI. 1915 // Record access to file system for potential display in UI.
1915 std::vector<std::pair<int, int> >::const_iterator i; 1916 std::vector<std::pair<int, int> >::const_iterator i;
1916 for (i = render_frames.begin(); i != render_frames.end(); ++i) { 1917 for (i = render_frames.begin(); i != render_frames.end(); ++i) {
1918 #if defined(ENABLE_EXTENSIONS)
1919 bool is_web_view_guest =
1920 ExtensionRendererState::GetInstance()->IsWebViewRenderer(i->first);
1921 if (is_web_view_guest) {
1922 BrowserThread::PostTask(BrowserThread::UI,
1923 FROM_HERE,
1924 base::Bind(&WebViewGuest::FileSystemAccessed,
1925 i->first,
1926 i->second,
1927 url,
1928 !allow,
1929 callback));
1930 continue;
1931 }
1932 #endif
1933 callback.Run(allow);
1917 BrowserThread::PostTask( 1934 BrowserThread::PostTask(
1918 BrowserThread::UI, FROM_HERE, 1935 BrowserThread::UI,
1936 FROM_HERE,
1919 base::Bind(&TabSpecificContentSettings::FileSystemAccessed, 1937 base::Bind(&TabSpecificContentSettings::FileSystemAccessed,
1920 i->first, i->second, url, !allow)); 1938 i->first,
1939 i->second,
1940 url,
1941 !allow));
1921 } 1942 }
1922
1923 return allow;
1924 } 1943 }
1925 1944
1926 bool ChromeContentBrowserClient::AllowWorkerIndexedDB( 1945 bool ChromeContentBrowserClient::AllowWorkerIndexedDB(
1927 const GURL& url, 1946 const GURL& url,
1928 const base::string16& name, 1947 const base::string16& name,
1929 content::ResourceContext* context, 1948 content::ResourceContext* context,
1930 const std::vector<std::pair<int, int> >& render_frames) { 1949 const std::vector<std::pair<int, int> >& render_frames) {
1931 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1950 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1932 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); 1951 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
1933 CookieSettings* cookie_settings = io_data->GetCookieSettings(); 1952 CookieSettings* cookie_settings = io_data->GetCookieSettings();
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 switches::kDisableWebRtcEncryption, 2907 switches::kDisableWebRtcEncryption,
2889 }; 2908 };
2890 to_command_line->CopySwitchesFrom(from_command_line, 2909 to_command_line->CopySwitchesFrom(from_command_line,
2891 kWebRtcDevSwitchNames, 2910 kWebRtcDevSwitchNames,
2892 arraysize(kWebRtcDevSwitchNames)); 2911 arraysize(kWebRtcDevSwitchNames));
2893 } 2912 }
2894 } 2913 }
2895 #endif // defined(ENABLE_WEBRTC) 2914 #endif // defined(ENABLE_WEBRTC)
2896 2915
2897 } // namespace chrome 2916 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698