media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.cpp

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "PhoneDetailsImpl.h"
     7 #include "csf_common.h"
     9 namespace CSF
    10 {
    12 PhoneDetailsImpl::PhoneDetailsImpl()
    13 : model(-1),
    14   state(ServiceStateType::eUnknown)
    15 {
    16 }
    18 PhoneDetailsImpl::~PhoneDetailsImpl()
    19 {
    20 }
    22 static const char * _softphoneSupportedModelNames[] = { "Cisco Unified Client Services Framework",
    23                                                         "Client Services Framework",
    24                                                         "Client Services Core" };
    26 bool PhoneDetailsImpl::isSoftPhone()
    27 {
    28 	if(model == -1 && modelDescription != "")
    29 	{
    30 		// Evaluate based on model description.
    31 		for(int i = 0; i < (int) csf_countof(_softphoneSupportedModelNames); i++)
    32 		{
    33 			if(modelDescription == _softphoneSupportedModelNames[i])
    34 				return true;
    35 		}
    36 		return false;
    37 	}
    38 	else
    39 	{
    40 	}
    41 	return false;
    42 }
    44 void PhoneDetailsImpl::setName(const std::string& name)
    45 {
    46 	this->name = name;
    47 }
    48 void PhoneDetailsImpl::setDescription(const std::string& description)
    49 {
    50 	this->description = description;
    51 }
    52 // Note that setting model and model description are mutually exclusive.
    53 void PhoneDetailsImpl::setModel(int model)
    54 {
    55 	this->model = model;
    56 	this->modelDescription = "";
    57 }
    58 void PhoneDetailsImpl::setModelDescription(const std::string& description)
    59 {
    60 	this->model = -1;
    61 	this->modelDescription = description;
    62 }
    63 void PhoneDetailsImpl::setLineDNs(const std::vector<std::string> & lineDNs)
    64 {
    65 	this->lineDNs.assign(lineDNs.begin(), lineDNs.end());
    66 }
    67 void PhoneDetailsImpl::setServiceState(ServiceStateType::ServiceState state)
    68 {
    69 	this->state = state;
    70 }
    71 void PhoneDetailsImpl::setConfig(const std::string& config)
    72 {
    73 	this->config = config;
    74 }
    76 }

mercurial