Merge lp:~osomon/oxide/maxCacheSize into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 1011
Proposed branch: lp:~osomon/oxide/maxCacheSize
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 382 lines (+110/-11)
10 files modified
qt/core/browser/oxide_qt_web_context.cc (+16/-1)
qt/core/browser/oxide_qt_web_context.h (+5/-1)
qt/core/glue/oxide_qt_web_context_adapter.cc (+9/-1)
qt/core/glue/oxide_qt_web_context_adapter.h (+4/-1)
qt/qmlplugin/oxide_qml_plugin.cc (+3/-1)
qt/quick/api/oxideqquickwebcontext.cc (+38/-1)
qt/quick/api/oxideqquickwebcontext_p.h (+8/-1)
qt/tests/qmltests/api/tst_WebContext_semi_construct_only_properties.qml (+2/-1)
shared/browser/oxide_browser_context.cc (+19/-2)
shared/browser/oxide_browser_context.h (+6/-1)
To merge this branch: bzr merge lp:~osomon/oxide/maxCacheSize
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+252113@code.launchpad.net

Commit message

Add WebContext.maxCacheSize property.

Description of the change

Note to the reviewer: bug #1277659 also mentions lowering the default value of 80MB. In this changeset I left it unchanged, let’s lower it in a separate branch after we agree on what a good default value would be.

To post a comment you must log in.
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

would it make sense to reflect in the name of the prop that the cache size limit is a soft limit? A few comments inline,

lp:~osomon/oxide/maxCacheSize updated
1003. By Olivier Tilloy

Default to 0 for the max cache size: chromium will pick a size based on available disk space.

1004. By Olivier Tilloy

Rename maxCacheSize to maxCacheSizeHint to reflect the fact that the limit is a soft one.

1005. By Olivier Tilloy

Do not allow setting the max cache size hint to a negative value.

Revision history for this message
Olivier Tilloy (osomon) wrote :

I renamed maxCacheSize to maxCacheSizeHint, changed the default value to 0 (which lets chromium choose a sensible value based on the available disk space), and enforced a positive value (cannot make the property a uint because net::HttpCache::DefaultBackend’s constructor takes an int).

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

This looks mostly ok - I just have one small comment on the API. Could we make the unit for WebContext.maxCacheSizeHint MB instead of bytes? The initial cache size is about 1MB when it's created anyway, and given that this is not a hard limit I don't think it makes sense to create an illusion that applications can control the cache size to the nearest byte.

Other than that, it looks fine.

review: Approve
lp:~osomon/oxide/maxCacheSize updated
1006. By Olivier Tilloy

Make the unit for maxCacheSizeHint MB instead of bytes.
The initial cache size is about 1MB when it's created anyway, and given that this is not a hard limit it doesn’t make sense to create an illusion that applications can control the cache size to the nearest byte.

1007. By Olivier Tilloy

Enforce an upper limit to avoid integer overflow.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Your suggestion makes sense, I changed the unit to MB instead of bytes.
To prevent integer overflow I enforced an upper limit. I did that in the QML API, do you think it would make sense to have the check in the shared layer?

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I think the current approach is ok - it's preferable for argument validation to go near to their API's in qt/ because we can be consistent with the logging mechanism we use (although, this could probably actually go in WebContextAdapter). I'd be tempted to just DCHECK that the passed in size isn't too big in BrowserContextIOData though, to make it clear to anyone who wanted to write a new port that they need to limit the size.

lp:~osomon/oxide/maxCacheSize updated
1008. By Olivier Tilloy

Add a DCHECK for the passed in size in BrowserContextIOData,
to make it clear to anyone who writes a new port that they need to limit the size.

Revision history for this message
Olivier Tilloy (osomon) wrote :

I added the DCHECK in BrowserContextIOData as suggested.

I see two problems with moving the Qt port check to WebContextAdapter though:

 - (minor) the warning message cannot mention "WebContext.maxCacheSizeHint" as we’re not guaranteed the class and property would be called like this in a QtWidgets port

 - maxCacheSizeHintChanged() would still be emitted from the QML API even if an integer overflow (or a value < 0) was detected and the size hint was not actually changed, unless we change the signature of WebContextAdapter::setMaxCacheSizeHint(…) to return a boolean indicating success

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qt/core/browser/oxide_qt_web_context.cc'
--- qt/core/browser/oxide_qt_web_context.cc 2015-01-16 22:46:17 +0000
+++ qt/core/browser/oxide_qt_web_context.cc 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -78,6 +78,7 @@
78};78};
7979
80WebContext::ConstructProperties::ConstructProperties() :80WebContext::ConstructProperties::ConstructProperties() :
81 max_cache_size_hint(0),
81 cookie_policy(net::StaticCookiePolicy::ALLOW_ALL_COOKIES),82 cookie_policy(net::StaticCookiePolicy::ALLOW_ALL_COOKIES),
82 session_cookie_mode(content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES),83 session_cookie_mode(content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES),
83 popup_blocker_enabled(true),84 popup_blocker_enabled(true),
@@ -523,6 +524,7 @@
523 oxide::BrowserContext::Params params(524 oxide::BrowserContext::Params params(
524 construct_props_->data_path,525 construct_props_->data_path,
525 construct_props_->cache_path,526 construct_props_->cache_path,
527 construct_props_->max_cache_size_hint,
526 construct_props_->session_cookie_mode,528 construct_props_->session_cookie_mode,
527 construct_props_->devtools_enabled,529 construct_props_->devtools_enabled,
528 construct_props_->devtools_port,530 construct_props_->devtools_port,
@@ -745,5 +747,18 @@
745 construct_props_->host_mapping_rules = rules;747 construct_props_->host_mapping_rules = rules;
746}748}
747749
750int WebContext::GetMaxCacheSizeHint() const {
751 if (IsInitialized()) {
752 return context_->GetMaxCacheSizeHint();
753 }
754
755 return construct_props_->max_cache_size_hint;
756}
757
758void WebContext::SetMaxCacheSizeHint(int size) {
759 DCHECK(!IsInitialized());
760 construct_props_->max_cache_size_hint = size;
761}
762
748} // namespace qt763} // namespace qt
749} // namespace oxide764} // namespace oxide
750765
=== modified file 'qt/core/browser/oxide_qt_web_context.h'
--- qt/core/browser/oxide_qt_web_context.h 2014-11-13 09:17:40 +0000
+++ qt/core/browser/oxide_qt_web_context.h 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -110,6 +110,9 @@
110 std::vector<std::string> GetHostMappingRules() const;110 std::vector<std::string> GetHostMappingRules() const;
111 void SetHostMappingRules(const std::vector<std::string>& rules);111 void SetHostMappingRules(const std::vector<std::string>& rules);
112112
113 int GetMaxCacheSizeHint() const;
114 void SetMaxCacheSizeHint(int size);
115
113 private:116 private:
114 friend class WebContextAdapter;117 friend class WebContextAdapter;
115118
@@ -120,6 +123,7 @@
120 std::string user_agent;123 std::string user_agent;
121 base::FilePath data_path;124 base::FilePath data_path;
122 base::FilePath cache_path;125 base::FilePath cache_path;
126 int max_cache_size_hint;
123 std::string accept_langs;127 std::string accept_langs;
124 net::StaticCookiePolicy::Type cookie_policy;128 net::StaticCookiePolicy::Type cookie_policy;
125 content::CookieStoreConfig::SessionCookieMode session_cookie_mode;129 content::CookieStoreConfig::SessionCookieMode session_cookie_mode;
126130
=== modified file 'qt/core/glue/oxide_qt_web_context_adapter.cc'
--- qt/core/glue/oxide_qt_web_context_adapter.cc 2015-01-16 22:46:17 +0000
+++ qt/core/glue/oxide_qt_web_context_adapter.cc 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -276,6 +276,14 @@
276 context_->SetAllowedExtraURLSchemes(set);276 context_->SetAllowedExtraURLSchemes(set);
277}277}
278278
279int WebContextAdapter::maxCacheSizeHint() const {
280 return context_->GetMaxCacheSizeHint();
281}
282
283void WebContextAdapter::setMaxCacheSizeHint(int size) {
284 context_->SetMaxCacheSizeHint(size);
285}
286
279WebContextAdapter::WebContextAdapter(QObject* q)287WebContextAdapter::WebContextAdapter(QObject* q)
280 : AdapterBase(q),288 : AdapterBase(q),
281 context_(WebContext::Create(this)) {289 context_(WebContext::Create(this)) {
282290
=== modified file 'qt/core/glue/oxide_qt_web_context_adapter.h'
--- qt/core/glue/oxide_qt_web_context_adapter.h 2014-11-13 09:17:40 +0000
+++ qt/core/glue/oxide_qt_web_context_adapter.h 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -132,6 +132,9 @@
132132
133 void setAllowedExtraUrlSchemes(const QStringList& schemes);133 void setAllowedExtraUrlSchemes(const QStringList& schemes);
134134
135 int maxCacheSizeHint() const;
136 void setMaxCacheSizeHint(int size);
137
135 protected:138 protected:
136 WebContextAdapter(QObject* q);139 WebContextAdapter(QObject* q);
137140
138141
=== modified file 'qt/qmlplugin/oxide_qml_plugin.cc'
--- qt/qmlplugin/oxide_qml_plugin.cc 2015-01-03 19:27:04 +0000
+++ qt/qmlplugin/oxide_qml_plugin.cc 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -122,6 +122,8 @@
122 qmlRegisterType<OxideQQuickWebView, 2>(uri, 1, 4, "WebView");122 qmlRegisterType<OxideQQuickWebView, 2>(uri, 1, 4, "WebView");
123123
124 qmlRegisterType<OxideQQuickWebView, 3>(uri, 1, 5, "WebView");124 qmlRegisterType<OxideQQuickWebView, 3>(uri, 1, 5, "WebView");
125
126 qmlRegisterType<OxideQQuickWebContext, 2>(uri, 1, 6, "WebContext");
125 }127 }
126};128};
127129
128130
=== modified file 'qt/quick/api/oxideqquickwebcontext.cc'
--- qt/quick/api/oxideqquickwebcontext.cc 2015-02-19 22:56:12 +0000
+++ qt/quick/api/oxideqquickwebcontext.cc 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -18,6 +18,8 @@
18#include "oxideqquickwebcontext_p.h"18#include "oxideqquickwebcontext_p.h"
19#include "oxideqquickwebcontext_p_p.h"19#include "oxideqquickwebcontext_p_p.h"
2020
21#include <limits>
22
21#include <QMutex>23#include <QMutex>
22#include <QMutexLocker>24#include <QMutexLocker>
23#include <QQmlEngine>25#include <QQmlEngine>
@@ -896,4 +898,39 @@
896 emit allowedExtraUrlSchemesChanged();898 emit allowedExtraUrlSchemesChanged();
897}899}
898900
901int OxideQQuickWebContext::maxCacheSizeHint() const {
902 Q_D(const OxideQQuickWebContext);
903
904 return d->maxCacheSizeHint();
905}
906
907void OxideQQuickWebContext::setMaxCacheSizeHint(int size) {
908 Q_D(OxideQQuickWebContext);
909
910 if (size < 0) {
911 qWarning() << "WebContext.maxCacheSizeHint cannot have a negative value";
912 return;
913 }
914
915 static int upper_limit = std::numeric_limits<int>::max() / (1024 * 1024);
916 if (size > upper_limit) {
917 // To avoid integer overflow.
918 qWarning() << "WebContext.maxCacheSizeHint cannot exceed"
919 << upper_limit << "MB";
920 return;
921 }
922
923 if (d->isInitialized()) {
924 qWarning() << "Cannot set WebContext.maxCacheSizeHint once the context is in use";
925 return;
926 }
927
928 if (d->maxCacheSizeHint() == size) {
929 return;
930 }
931
932 d->setMaxCacheSizeHint(size);
933 emit maxCacheSizeHintChanged();
934}
935
899#include "moc_oxideqquickwebcontext_p.cpp"936#include "moc_oxideqquickwebcontext_p.cpp"
900937
=== modified file 'qt/quick/api/oxideqquickwebcontext_p.h'
--- qt/quick/api/oxideqquickwebcontext_p.h 2015-01-16 22:46:17 +0000
+++ qt/quick/api/oxideqquickwebcontext_p.h 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -64,6 +64,9 @@
6464
65 Q_PROPERTY(QStringList allowedExtraUrlSchemes READ allowedExtraUrlSchemes WRITE setAllowedExtraUrlSchemes NOTIFY allowedExtraUrlSchemesChanged REVISION 1)65 Q_PROPERTY(QStringList allowedExtraUrlSchemes READ allowedExtraUrlSchemes WRITE setAllowedExtraUrlSchemes NOTIFY allowedExtraUrlSchemesChanged REVISION 1)
6666
67 // maxCacheSizeHint is a soft limit, expressed in MB
68 Q_PROPERTY(int maxCacheSizeHint READ maxCacheSizeHint WRITE setMaxCacheSizeHint NOTIFY maxCacheSizeHintChanged REVISION 2)
69
67 Q_ENUMS(CookiePolicy)70 Q_ENUMS(CookiePolicy)
68 Q_ENUMS(SessionCookieMode)71 Q_ENUMS(SessionCookieMode)
6972
@@ -148,6 +151,9 @@
148 QStringList allowedExtraUrlSchemes() const;151 QStringList allowedExtraUrlSchemes() const;
149 void setAllowedExtraUrlSchemes(const QStringList& schemes);152 void setAllowedExtraUrlSchemes(const QStringList& schemes);
150153
154 int maxCacheSizeHint() const;
155 void setMaxCacheSizeHint(int size);
156
151 Q_SIGNALS:157 Q_SIGNALS:
152 void productChanged();158 void productChanged();
153 void userAgentChanged();159 void userAgentChanged();
@@ -166,6 +172,7 @@
166 void devtoolsBindIpChanged();172 void devtoolsBindIpChanged();
167 Q_REVISION(1) void hostMappingRulesChanged();173 Q_REVISION(1) void hostMappingRulesChanged();
168 Q_REVISION(1) void allowedExtraUrlSchemesChanged();174 Q_REVISION(1) void allowedExtraUrlSchemesChanged();
175 Q_REVISION(2) void maxCacheSizeHintChanged();
169176
170 private:177 private:
171 Q_PRIVATE_SLOT(d_func(), void userScriptUpdated());178 Q_PRIVATE_SLOT(d_func(), void userScriptUpdated());
172179
=== modified file 'qt/tests/qmltests/api/tst_WebContext_semi_construct_only_properties.qml'
--- qt/tests/qmltests/api/tst_WebContext_semi_construct_only_properties.qml 2014-11-13 19:14:40 +0000
+++ qt/tests/qmltests/api/tst_WebContext_semi_construct_only_properties.qml 2015-03-11 15:05:58 +0000
@@ -1,6 +1,6 @@
1import QtQuick 2.01import QtQuick 2.0
2import QtTest 1.02import QtTest 1.0
3import com.canonical.Oxide 1.03import com.canonical.Oxide 1.6
4import com.canonical.Oxide.Testing 1.04import com.canonical.Oxide.Testing 1.0
55
6TestCase {6TestCase {
@@ -29,6 +29,7 @@
29 var r = [29 var r = [
30 { prop: "dataPath", signal: "dataPathChanged", val: "file:///foo", dataPath: "" },30 { prop: "dataPath", signal: "dataPathChanged", val: "file:///foo", dataPath: "" },
31 { prop: "cachePath", signal: "cachePathChanged", val: "file:///foo", dataPath: "" },31 { prop: "cachePath", signal: "cachePathChanged", val: "file:///foo", dataPath: "" },
32 { prop: "maxCacheSizeHint", signal: "maxCacheSizeHintChanged", val: 1, dataPath: "" },
32 { prop: "sessionCookieMode", signal: "sessionCookieModeChanged", val: WebContext.SessionCookieModeRestored, dataPath: QMLTEST_DATADIR }33 { prop: "sessionCookieMode", signal: "sessionCookieModeChanged", val: WebContext.SessionCookieModeRestored, dataPath: QMLTEST_DATADIR }
33 ];34 ];
3435
3536
=== modified file 'shared/browser/oxide_browser_context.cc'
--- shared/browser/oxide_browser_context.cc 2015-03-10 20:34:40 +0000
+++ shared/browser/oxide_browser_context.cc 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -19,6 +19,7 @@
1919
20#include <algorithm>20#include <algorithm>
21#include <libintl.h>21#include <libintl.h>
22#include <limits>
22#include <vector>23#include <vector>
2324
24#include "base/files/file_enumerator.h"25#include "base/files/file_enumerator.h"
@@ -259,6 +260,7 @@
259 BrowserContextSharedIOData(const BrowserContext::Params& params)260 BrowserContextSharedIOData(const BrowserContext::Params& params)
260 : path(params.path),261 : path(params.path),
261 cache_path(params.cache_path),262 cache_path(params.cache_path),
263 max_cache_size_hint(params.max_cache_size_hint),
262 cookie_policy(net::StaticCookiePolicy::ALLOW_ALL_COOKIES),264 cookie_policy(net::StaticCookiePolicy::ALLOW_ALL_COOKIES),
263 session_cookie_mode(params.session_cookie_mode),265 session_cookie_mode(params.session_cookie_mode),
264 popup_blocker_enabled(true),266 popup_blocker_enabled(true),
@@ -274,6 +276,7 @@
274276
275 base::FilePath path;277 base::FilePath path;
276 base::FilePath cache_path;278 base::FilePath cache_path;
279 int max_cache_size_hint;
277280
278 std::string user_agent_string;281 std::string user_agent_string;
279 std::string accept_langs;282 std::string accept_langs;
@@ -411,6 +414,15 @@
411 return data.cache_path;414 return data.cache_path;
412}415}
413416
417int BrowserContextIOData::GetMaxCacheSizeHint() const {
418 int max_cache_size_hint = GetSharedData().max_cache_size_hint;
419 // max_cache_size_hint is expressed in MB, let’s check that
420 // converting it to bytes won’t trigger an integer overflow
421 static int upper_limit = std::numeric_limits<int>::max() / (1024 * 1024);
422 DCHECK_LE(max_cache_size_hint, upper_limit);
423 return max_cache_size_hint;
424}
425
414std::string BrowserContextIOData::GetAcceptLangs() const {426std::string BrowserContextIOData::GetAcceptLangs() const {
415 const BrowserContextSharedIOData& data = GetSharedData();427 const BrowserContextSharedIOData& data = GetSharedData();
416 base::AutoLock lock(data.lock);428 base::AutoLock lock(data.lock);
@@ -491,7 +503,7 @@
491 net::DISK_CACHE,503 net::DISK_CACHE,
492 net::CACHE_BACKEND_DEFAULT,504 net::CACHE_BACKEND_DEFAULT,
493 GetCachePath().Append(kCacheDirname),505 GetCachePath().Append(kCacheDirname),
494 83886080, // XXX: 80MB - Make this configurable506 GetMaxCacheSizeHint() * 1024 * 1024, // MB -> bytes
495 content::BrowserThread::GetMessageLoopProxyForThread(507 content::BrowserThread::GetMessageLoopProxyForThread(
496 content::BrowserThread::CACHE));508 content::BrowserThread::CACHE));
497 }509 }
@@ -914,6 +926,11 @@
914 return io_data()->GetCachePath();926 return io_data()->GetCachePath();
915}927}
916928
929int BrowserContext::GetMaxCacheSizeHint() const {
930 DCHECK(CalledOnValidThread());
931 return io_data()->GetMaxCacheSizeHint();
932}
933
917std::string BrowserContext::GetAcceptLangs() const {934std::string BrowserContext::GetAcceptLangs() const {
918 DCHECK(CalledOnValidThread());935 DCHECK(CalledOnValidThread());
919 return io_data()->GetAcceptLangs();936 return io_data()->GetAcceptLangs();
920937
=== modified file 'shared/browser/oxide_browser_context.h'
--- shared/browser/oxide_browser_context.h 2014-12-03 07:22:41 +0000
+++ shared/browser/oxide_browser_context.h 2015-03-11 15:05:58 +0000
@@ -1,5 +1,5 @@
1// vim:expandtab:shiftwidth=2:tabstop=2:1// vim:expandtab:shiftwidth=2:tabstop=2:
2// Copyright (C) 2013 Canonical Ltd.2// Copyright (C) 2013-2015 Canonical Ltd.
33
4// This library is free software; you can redistribute it and/or4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public5// modify it under the terms of the GNU Lesser General Public
@@ -80,6 +80,7 @@
8080
81 base::FilePath GetPath() const;81 base::FilePath GetPath() const;
82 base::FilePath GetCachePath() const;82 base::FilePath GetCachePath() const;
83 int GetMaxCacheSizeHint() const;
8384
84 std::string GetAcceptLangs() const;85 std::string GetAcceptLangs() const;
85 std::string GetUserAgent() const;86 std::string GetUserAgent() const;
@@ -132,12 +133,14 @@
132 struct Params {133 struct Params {
133 Params(const base::FilePath& path,134 Params(const base::FilePath& path,
134 const base::FilePath& cache_path,135 const base::FilePath& cache_path,
136 int max_cache_size_hint,
135 content::CookieStoreConfig::SessionCookieMode session_cookie_mode,137 content::CookieStoreConfig::SessionCookieMode session_cookie_mode,
136 bool devtools_enabled,138 bool devtools_enabled,
137 int devtools_port,139 int devtools_port,
138 const std::string& devtools_ip)140 const std::string& devtools_ip)
139 : path(path),141 : path(path),
140 cache_path(cache_path),142 cache_path(cache_path),
143 max_cache_size_hint(max_cache_size_hint),
141 session_cookie_mode(session_cookie_mode),144 session_cookie_mode(session_cookie_mode),
142 devtools_enabled(devtools_enabled),145 devtools_enabled(devtools_enabled),
143 devtools_port(devtools_port),146 devtools_port(devtools_port),
@@ -145,6 +148,7 @@
145148
146 base::FilePath path;149 base::FilePath path;
147 base::FilePath cache_path;150 base::FilePath cache_path;
151 int max_cache_size_hint;
148 content::CookieStoreConfig::SessionCookieMode session_cookie_mode;152 content::CookieStoreConfig::SessionCookieMode session_cookie_mode;
149 bool devtools_enabled;153 bool devtools_enabled;
150 int devtools_port;154 int devtools_port;
@@ -183,6 +187,7 @@
183187
184 base::FilePath GetPath() const final;188 base::FilePath GetPath() const final;
185 base::FilePath GetCachePath() const;189 base::FilePath GetCachePath() const;
190 int GetMaxCacheSizeHint() const;
186191
187 std::string GetAcceptLangs() const;192 std::string GetAcceptLangs() const;
188 void SetAcceptLangs(const std::string& langs);193 void SetAcceptLangs(const std::string& langs);

Subscribers

People subscribed via source and target branches