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

Side by Side Diff: chrome/renderer/worker_content_settings_client_proxy.cc

Issue 968983002: Rename blink::WebWorkerPermissionProxyClient to blink::WebWorkerContentSettingsProxyClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gypi typo Created 5 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/worker_content_settings_client_proxy.h"
6
5 #include "chrome/common/render_messages.h" 7 #include "chrome/common/render_messages.h"
6 #include "chrome/renderer/worker_permission_client_proxy.h"
7 #include "content/public/renderer/render_frame.h" 8 #include "content/public/renderer/render_frame.h"
8 #include "content/public/renderer/render_thread.h" 9 #include "content/public/renderer/render_thread.h"
9 #include "ipc/ipc_sync_message_filter.h" 10 #include "ipc/ipc_sync_message_filter.h"
10 #include "third_party/WebKit/public/platform/WebPermissionCallbacks.h" 11 #include "third_party/WebKit/public/platform/WebPermissionCallbacks.h"
11 #include "third_party/WebKit/public/web/WebDocument.h" 12 #include "third_party/WebKit/public/web/WebDocument.h"
12 #include "third_party/WebKit/public/web/WebFrame.h" 13 #include "third_party/WebKit/public/web/WebFrame.h"
13 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 14 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
14 15
15 WorkerPermissionClientProxy::WorkerPermissionClientProxy( 16 WorkerContentSettingsClientProxy::WorkerContentSettingsClientProxy(
16 content::RenderFrame* render_frame, 17 content::RenderFrame* render_frame,
17 blink::WebFrame* frame) 18 blink::WebFrame* frame)
18 : routing_id_(render_frame->GetRoutingID()), 19 : routing_id_(render_frame->GetRoutingID()),
19 is_unique_origin_(false) { 20 is_unique_origin_(false) {
20 if (frame->document().securityOrigin().isUnique() || 21 if (frame->document().securityOrigin().isUnique() ||
21 frame->top()->document().securityOrigin().isUnique()) 22 frame->top()->document().securityOrigin().isUnique())
22 is_unique_origin_ = true; 23 is_unique_origin_ = true;
23 sync_message_filter_ = content::RenderThread::Get()->GetSyncMessageFilter(); 24 sync_message_filter_ = content::RenderThread::Get()->GetSyncMessageFilter();
24 document_origin_url_ = GURL(frame->document().securityOrigin().toString()); 25 document_origin_url_ = GURL(frame->document().securityOrigin().toString());
25 top_frame_origin_url_ = GURL( 26 top_frame_origin_url_ = GURL(
26 frame->top()->document().securityOrigin().toString()); 27 frame->top()->document().securityOrigin().toString());
27 } 28 }
28 29
29 WorkerPermissionClientProxy::~WorkerPermissionClientProxy() {} 30 WorkerContentSettingsClientProxy::~WorkerContentSettingsClientProxy() {}
30 31
31 bool WorkerPermissionClientProxy::allowDatabase( 32 bool WorkerContentSettingsClientProxy::allowDatabase(
32 const blink::WebString& name, 33 const blink::WebString& name,
33 const blink::WebString& display_name, 34 const blink::WebString& display_name,
34 unsigned long estimated_size) { 35 unsigned long estimated_size) {
35 if (is_unique_origin_) 36 if (is_unique_origin_)
36 return false; 37 return false;
37 38
38 bool result = false; 39 bool result = false;
39 sync_message_filter_->Send(new ChromeViewHostMsg_AllowDatabase( 40 sync_message_filter_->Send(new ChromeViewHostMsg_AllowDatabase(
40 routing_id_, document_origin_url_, top_frame_origin_url_, 41 routing_id_, document_origin_url_, top_frame_origin_url_,
41 name, display_name, &result)); 42 name, display_name, &result));
42 return result; 43 return result;
43 } 44 }
44 45
45 bool WorkerPermissionClientProxy::requestFileSystemAccessSync() { 46 bool WorkerContentSettingsClientProxy::requestFileSystemAccessSync() {
46 if (is_unique_origin_) 47 if (is_unique_origin_)
47 return false; 48 return false;
48 49
49 bool result = false; 50 bool result = false;
50 sync_message_filter_->Send(new ChromeViewHostMsg_RequestFileSystemAccessSync( 51 sync_message_filter_->Send(new ChromeViewHostMsg_RequestFileSystemAccessSync(
51 routing_id_, document_origin_url_, top_frame_origin_url_, &result)); 52 routing_id_, document_origin_url_, top_frame_origin_url_, &result));
52 return result; 53 return result;
53 } 54 }
54 55
55 bool WorkerPermissionClientProxy::allowIndexedDB( 56 bool WorkerContentSettingsClientProxy::allowIndexedDB(
56 const blink::WebString& name) { 57 const blink::WebString& name) {
57 if (is_unique_origin_) 58 if (is_unique_origin_)
58 return false; 59 return false;
59 60
60 bool result = false; 61 bool result = false;
61 sync_message_filter_->Send(new ChromeViewHostMsg_AllowIndexedDB( 62 sync_message_filter_->Send(new ChromeViewHostMsg_AllowIndexedDB(
62 routing_id_, document_origin_url_, top_frame_origin_url_, name, &result)); 63 routing_id_, document_origin_url_, top_frame_origin_url_, name, &result));
63 return result; 64 return result;
64 } 65 }
OLDNEW
« no previous file with comments | « chrome/renderer/worker_content_settings_client_proxy.h ('k') | chrome/renderer/worker_permission_client_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698