namespace content {
namespace internal {
-net::SHA256HashValue getChainFingerprint256(const net::X509Certificate& cert) {
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- net::SHA256HashValue fingerprint =
- net::X509Certificate::CalculateChainFingerprint256(
- cert.os_cert_handle(), cert.GetIntermediateCertificates());
-#else
- net::SHA256HashValue fingerprint;
-#endif
- return fingerprint;
-}
CertPolicy::CertPolicy() {
}
// in the saved CertStatus.
bool CertPolicy::Check(const net::X509Certificate& cert,
net::CertStatus error) const {
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- net::SHA256HashValue fingerprint = getChainFingerprint256(cert);
- std::map<net::SHA256HashValue, net::CertStatus,
- net::SHA256HashValueLessThan>::const_iterator allowed_iter =
+ net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256();
+ std::map<net::SHA256HashValue, net::CertStatus>::const_iterator allowed_iter =
allowed_.find(fingerprint);
if ((allowed_iter != allowed_.end()) && (allowed_iter->second & error) &&
((allowed_iter->second & error) == error)) {
return true;
}
-#endif
return false;
}
net::CertStatus error) {
// If this same cert had already been saved with a different error status,
// this will replace it with the new error status.
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- net::SHA256HashValue fingerprint = getChainFingerprint256(cert);
+ net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256();
allowed_[fingerprint] = error;
-#endif
}
} // namespace internal
}
bool SSLHostStateDelegateEfl::HasAllowException(const std::string& host) const {
- NOTIMPLEMENTED();
return false;
}
private:
// The set of fingerprints of allowed certificates.
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
- std::map<net::SHA256HashValue, net::CertStatus, net::SHA256HashValueLessThan>
- allowed_;
-#endif
+ std::map<net::SHA256HashValue, net::CertStatus> allowed_;
};
} // namespace internal
int temp_port = 0;
std::string port_str =
command_line->GetSwitchValueASCII(switches::kRemoteDebuggingPort);
- base::StringToInt(port_str, &temp_port);
- if (temp_port > 0 && temp_port < 65535) {
+ if (base::StringToInt(port_str, &temp_port) && (temp_port > 0) &&
+ (temp_port < 65535)) {
port = temp_port;
} else {
DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
const PrintParams& print_params = params.params;
blink::WebPrintParams webkit_print_params;
ComputeWebKitPrintParamsInDesiredDpi(print_params, &webkit_print_params);
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+#if defined(EWK_BRINGUP) // FIXME: m67 bringup
+ return false;
+#else
int page_count = frame->printBegin(webkit_print_params);
gfx::Size print_canvas_size(webkit_print_params.printContentArea.width,
webkit_print_params.printContentArea.height);
bool PrintWebViewHelperEfl::PrintPagesToPdf(blink::WebFrame* frame,
int page_count, const gfx::Size& canvas_size) {
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+#if defined(EWK_BRINGUP) // FIXME: m67 bringup
+ return false;
+#else
printing::PdfMetafileSkia metafile(printing::PDF_SKIA_DOCUMENT_TYPE);
if (!metafile.Init())
return false;
PrintParams result;
double scale_factor = 1.0f;
gfx::Rect canvas_area(canvas_size);
-#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+#if defined(EWK_BRINGUP) // FIXME: m67 bringup
+ return false;
+#else
// FIXME: cannot convert ‘cc::PaintCanvas*’ to ‘skia::VectorCanvas* {aka
// SkCanvas*}’ in initialization
skia::VectorCanvas* canvas = metafile->GetVectorCanvasForNewPage(
ignore_certificate_errors_;
if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) {
int value;
- base::StringToInt(
- command_line.GetSwitchValueASCII(switches::kTestingFixedHttpPort),
- &value);
- network_session_params.testing_fixed_http_port = value;
+ if (base::StringToInt(
+ command_line.GetSwitchValueASCII(switches::kTestingFixedHttpPort),
+ &value)) {
+ network_session_params.testing_fixed_http_port = value;
+ }
}
if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) {
int value;
- base::StringToInt(
- command_line.GetSwitchValueASCII(switches::kTestingFixedHttpsPort),
- &value);
- network_session_params.testing_fixed_https_port = value;
+ if (base::StringToInt(command_line.GetSwitchValueASCII(
+ switches::kTestingFixedHttpsPort),
+ &value)) {
+ network_session_params.testing_fixed_https_port = value;
+ }
}
http_network_session_.reset(new net::HttpNetworkSession(
}
bool SendToRenderer(int renderer_id, IPC::Message* message) {
- return content::RenderProcessHost::FromID(renderer_id)->Send(message);
+ content::RenderProcessHost* host =
+ content::RenderProcessHost::FromID(renderer_id);
+ if (!host)
+ return false;
+
+ return host->Send(message);
}
}
void
log_message(MESSAGE_TYPE type, int add_newline, const char* fmt, ...) {
- char* msg_fmt = NULL;
- va_list list;
-
- if (!logger_show_trace && type == TRACE) {
+ if (!logger_show_trace && type == TRACE)
return;
- }
- msg_fmt = _make_format(type, add_newline, fmt);
+ char* msg_fmt = _make_format(type, add_newline, fmt);
+ va_list list;
va_start(list, fmt);
if (msg_fmt == NULL) {
vfprintf(stderr, fmt, list);
+ va_end(list);
+ return;
}
- if (type == ERROR) {
+ if (type == ERROR)
vfprintf(stderr, msg_fmt, list);
- } else {
+ else
vfprintf(stdout, msg_fmt, list);
- }
+
va_end(list);
free(msg_fmt);
void
vlog_message(MESSAGE_TYPE type, int add_newline, const char* fmt, va_list vl) {
- char* msg_fmt = NULL;
-
- if (!logger_show_trace && type == TRACE) {
+ if (!logger_show_trace && type == TRACE)
return;
- }
- msg_fmt = _make_format(type, add_newline, fmt);
+ char* msg_fmt = _make_format(type, add_newline, fmt);
if (msg_fmt == NULL) {
vfprintf(stderr, fmt, vl);
+ return;
}
- if (type == ERROR) {
+ if (type == ERROR)
vfprintf(stderr, msg_fmt, vl);
- } else {
+ else
vfprintf(stdout, msg_fmt, vl);
- }
free(msg_fmt);
}