Move Session_label from os to base

Session_label constructor now takes a bare string rather than a
serialized argument buffer.
Replace all instances of previous constructor with 'label_from_args'
function.

Issue #1787
This commit is contained in:
Emery Hemingway
2016-01-12 14:11:58 +01:00
committed by Norman Feske
parent 88b358c5ef
commit f8337b511b
38 changed files with 169 additions and 129 deletions

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2015 Genode Labs GmbH
* Copyright (C) 2015-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -72,7 +72,7 @@ class Fs_log::Root_component :
dir_path[0] = '/';
bool truncate = false;
Session_label session_label(args);
Session_label const session_label = label_from_args(args);
char const *label_str = session_label.string();
char const *label_prefix = "";

View File

@ -23,6 +23,7 @@
#include <util/avl_string.h>
#include <util/misc_math.h>
#include <os/attached_ram_dataspace.h>
#inlcude <base/session_label.h>
/* local includes */
#include "iso9660.h"

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2012-2013 Genode Labs GmbH
* Copyright (C) 2012-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -336,7 +336,7 @@ class File_system::Root : public Root_component<Session_component>
char root[ROOT_MAX_LEN];
root[0] = 0;
Session_label label(args);
Session_label const label = label_from_args(args);
try {
Session_policy policy(label);

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2010-2013 Genode Labs GmbH
* Copyright (C) 2010-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -198,14 +198,12 @@ class Net::Root : public Genode::Root_component<Net::Session_component>
memset(ip_addr, 0, MAX_IP_ADDR_LENGTH);
try {
Session_label label(args);
Session_label const label = label_from_args(args);
Session_policy policy(label, _config);
policy.attribute("ip_addr").value(ip_addr, sizeof(ip_addr));
} catch (Xml_node::Nonexistent_attribute) {
Genode::log("Missing \"ip_addr\" attribute in policy definition");
} catch (Session_policy::No_policy_defined) {
Genode::log("Invalid session request, no matching policy");;
}
} catch (Session_policy::No_policy_defined) { }
size_t ram_quota =
Arg_string::find_arg(args, "ram_quota" ).ulong_value(0);

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2006-2013 Genode Labs GmbH
* Copyright (C) 2006-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -30,7 +30,7 @@ struct Background : private Texture_base, Session, View
*/
Background(Area size)
:
Texture_base(Area(0, 0)), Session(Genode::Session_label("label=\"\"")),
Texture_base(Area(0, 0)), Session(Genode::Session_label()),
View(*this, View::NOT_TRANSPARENT, View::BACKGROUND, 0),
color(25, 37, 50)
{

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2006-2013 Genode Labs GmbH
* Copyright (C) 2006-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -1037,11 +1037,11 @@ class Nitpicker::Root : public Genode::Root_component<Session_component>
size_t const unused_quota = ram_quota - required_quota;
Session_label const label(args);
bool const provides_default_bg = (strcmp(label.string(), "backdrop") == 0);
Genode::Session_label const label = Genode::label_from_args(args);
bool const provides_default_bg = (label == "backdrop");
Session_component *session = new (md_alloc())
Session_component(Session_label(args), _view_stack, _mode,
Session_component(label, _view_stack, _mode,
_pointer_origin, *ep(), _framebuffer,
provides_default_bg, *md_alloc(), unused_quota,
_focus_reporter);

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2014 Genode Labs GmbH
* Copyright (C) 2014-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -21,7 +21,7 @@ struct Pointer_origin : Session, View
{
Pointer_origin()
:
Session(Genode::Session_label("")),
Session(Genode::Session_label()),
View(*this, View::TRANSPARENT, View::NOT_BACKGROUND, 0)
{ }

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2013-2015 Genode Labs GmbH
* Copyright (C) 2013-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -208,7 +208,7 @@ class Block::Root :
{
long num = -1;
Session_label label(args);
Session_label const label = label_from_args(args);
char const *label_str = label.string();
try {
Session_policy policy(label);

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2012-2013 Genode Labs GmbH
* Copyright (C) 2012-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -433,7 +433,7 @@ namespace File_system {
char root[ROOT_MAX_LEN];
root[0] = 0;
Session_label label(args);
Session_label const label = label_from_args(args);
try {
Session_policy policy(label);

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2014 Genode Labs GmbH
* Copyright (C) 2014-2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -947,7 +947,7 @@ class File_system::Root : public Root_component<Session_component>
Genode::Number_of_bytes buffer_size_max = 1 * (1 << 20); /* 1 MiB */
unsigned trace_parent_levels = 0;
Session_label label(args);
Session_label const label = label_from_args(args);
try {
Session_policy policy(label);

View File

@ -593,7 +593,7 @@ class Vfs_server::Root :
Path session_root;
bool writeable = false;
Session_label const label(args);
Session_label const label = label_from_args(args);
char tmp[MAX_PATH_LEN];
try {