Merge lp:~abreu-alexandre/oxide/stub-quota-context-1-4 into lp:oxide/1.4

Proposed by Alexandre Abreu on 2014-12-03
Status: Merged
Merged at revision: 886
Proposed branch: lp:~abreu-alexandre/oxide/stub-quota-context-1-4
Merge into: lp:oxide/1.4
Diff against target: 144 lines (+90/-0)
5 files modified
shared/browser/oxide_content_browser_client.cc (+5/-0)
shared/browser/oxide_content_browser_client.h (+2/-0)
shared/browser/oxide_quota_permission_context.cc (+36/-0)
shared/browser/oxide_quota_permission_context.h (+45/-0)
shared/shared.gyp (+2/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/oxide/stub-quota-context-1-4
Reviewer Review Type Date Requested Status
Chris Coulson 2014-12-03 Approve on 2015-01-07
Review via email: mp+243477@code.launchpad.net

Commit message

Stub the quota permission context to avoid crashes when e.g. storage quota is requested.

Description of the change

Stub the quota permission context to avoid crashes when e.g. storage quota is requested.

To post a comment you must log in.
879. By Alexandre Abreu on 2014-12-03

remove header clutter

Chris Coulson (chrisccoulson) wrote :

It would probably be good to merge this in to trunk as well, at least whilst I'm reviewing the other branch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shared/browser/oxide_content_browser_client.cc'
2--- shared/browser/oxide_content_browser_client.cc 2014-11-15 17:32:48 +0000
3+++ shared/browser/oxide_content_browser_client.cc 2014-12-03 13:42:53 +0000
4@@ -50,6 +50,7 @@
5 #include "oxide_browser_process_main.h"
6 #include "oxide_devtools_manager_delegate.h"
7 #include "oxide_form_factor.h"
8+#include "oxide_quota_permission_context.h"
9 #include "oxide_resource_dispatcher_host_delegate.h"
10 #include "oxide_script_message_dispatcher_browser.h"
11 #include "oxide_user_agent_override_provider.h"
12@@ -344,4 +345,8 @@
13 platform_integration_.reset(integration);
14 }
15
16+content::QuotaPermissionContext* ContentBrowserClient::CreateQuotaPermissionContext() {
17+ return new QuotaPermissionContext();
18+}
19+
20 } // namespace oxide
21
22=== modified file 'shared/browser/oxide_content_browser_client.h'
23--- shared/browser/oxide_content_browser_client.h 2014-11-13 08:41:43 +0000
24+++ shared/browser/oxide_content_browser_client.h 2014-12-03 13:42:53 +0000
25@@ -30,6 +30,7 @@
26 }
27
28 namespace content {
29+class QuotaPermissionContext;
30 class RenderViewHost;
31 class ResourceDispatcherHostDelegate;
32 }
33@@ -127,6 +128,7 @@
34 content::LocationProvider* OverrideSystemLocationProvider() final;
35 content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() final;
36 void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) final;
37+ content::QuotaPermissionContext* CreateQuotaPermissionContext() final;
38
39 scoped_ptr<BrowserPlatformIntegration> platform_integration_;
40
41
42=== added file 'shared/browser/oxide_quota_permission_context.cc'
43--- shared/browser/oxide_quota_permission_context.cc 1970-01-01 00:00:00 +0000
44+++ shared/browser/oxide_quota_permission_context.cc 2014-12-03 13:42:53 +0000
45@@ -0,0 +1,36 @@
46+// vim:expandtab:shiftwidth=2:tabstop=2:
47+// Copyright (C) 2014 Canonical Ltd.
48+
49+// This library is free software; you can redistribute it and/or
50+// modify it under the terms of the GNU Lesser General Public
51+// License as published by the Free Software Foundation; either
52+// version 2.1 of the License, or (at your option) any later version.
53+
54+// This library is distributed in the hope that it will be useful,
55+// but WITHOUT ANY WARRANTY; without even the implied warranty of
56+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57+// Lesser General Public License for more details.
58+
59+// You should have received a copy of the GNU Lesser General Public
60+// License along with this library; if not, write to the Free Software
61+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
62+
63+#include "oxide_quota_permission_context.h"
64+
65+namespace oxide {
66+
67+QuotaPermissionContext::QuotaPermissionContext() {
68+}
69+
70+QuotaPermissionContext::~QuotaPermissionContext() {
71+}
72+
73+void QuotaPermissionContext::RequestQuotaPermission(
74+ const content::StorageQuotaParams& params,
75+ int render_process_id,
76+ const content::QuotaPermissionContext::PermissionCallback& callback) {
77+ callback.Run(QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_DISALLOW);
78+}
79+
80+} // namespace oxide
81+
82
83=== added file 'shared/browser/oxide_quota_permission_context.h'
84--- shared/browser/oxide_quota_permission_context.h 1970-01-01 00:00:00 +0000
85+++ shared/browser/oxide_quota_permission_context.h 2014-12-03 13:42:53 +0000
86@@ -0,0 +1,45 @@
87+// vim:expandtab:shiftwidth=2:tabstop=2:
88+// Copyright (C) 2014 Canonical Ltd.
89+
90+// This library is free software; you can redistribute it and/or
91+// modify it under the terms of the GNU Lesser General Public
92+// License as published by the Free Software Foundation; either
93+// version 2.1 of the License, or (at your option) any later version.
94+
95+// This library is distributed in the hope that it will be useful,
96+// but WITHOUT ANY WARRANTY; without even the implied warranty of
97+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
98+// Lesser General Public License for more details.
99+
100+// You should have received a copy of the GNU Lesser General Public
101+// License along with this library; if not, write to the Free Software
102+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
103+
104+#ifndef _OXIDE_SHARED_BROWSER_QUOTA_PERMISSION_CONTEXT_H_
105+#define _OXIDE_SHARED_BROWSER_QUOTA_PERMISSION_CONTEXT_H_
106+
107+#include "content/public/browser/quota_permission_context.h"
108+#include "storage/common/quota/quota_types.h"
109+
110+namespace oxide {
111+
112+class QuotaPermissionContext final :
113+ public content::QuotaPermissionContext {
114+ public:
115+ QuotaPermissionContext();
116+ ~QuotaPermissionContext();
117+
118+ void RequestQuotaPermission(
119+ const content::StorageQuotaParams& params,
120+ int render_process_id,
121+ const content::QuotaPermissionContext::PermissionCallback& callback) final;
122+
123+ private:
124+
125+ DISALLOW_COPY_AND_ASSIGN(QuotaPermissionContext);
126+};
127+
128+} // namespace oxide
129+
130+#endif // _OXIDE_SHARED_BROWSER_QUOTA_PERMISSION_CONTEXT_H_
131+
132
133=== modified file 'shared/shared.gyp'
134--- shared/shared.gyp 2014-11-18 08:02:53 +0000
135+++ shared/shared.gyp 2014-12-03 13:42:53 +0000
136@@ -289,6 +289,8 @@
137 'browser/oxide_permission_request.h',
138 'browser/oxide_power_save_blocker.cc',
139 'browser/oxide_power_save_blocker.h',
140+ 'browser/oxide_quota_permission_context.cc',
141+ 'browser/oxide_quota_permission_context.h',
142 'browser/oxide_renderer_frame_evictor.cc',
143 'browser/oxide_renderer_frame_evictor.h',
144 'browser/oxide_render_widget_host_view.cc',

Subscribers

People subscribed via source and target branches