1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_PROPERTY_PROVIDER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_PROPERTY_PROVIDER_H_
10 #include "base/callback.h"
20 class URLRequestContextGetter
;
23 namespace extensions
{
25 // This class provides properties of messages asynchronously.
26 class MessagePropertyProvider
{
28 MessagePropertyProvider();
30 typedef base::Callback
<void(const std::string
&)> DomainBoundCertCallback
;
32 // Gets the DER-encoded public key of the domain-bound cert,
33 // aka TLS channel ID, for the given URL.
34 // Runs |reply| on the current message loop.
35 void GetDomainBoundCert(Profile
* profile
,
36 const GURL
& source_url
,
37 const DomainBoundCertCallback
& reply
);
40 struct GetDomainBoundCertOutput
;
42 static void GetDomainBoundCertOnIOThread(
43 scoped_refptr
<base::TaskRunner
> original_task_runner
,
44 scoped_refptr
<net::URLRequestContextGetter
> request_context_getter
,
45 const std::string
& host
,
46 const DomainBoundCertCallback
& reply
);
48 static void GotDomainBoundCert(
49 scoped_refptr
<base::TaskRunner
> original_task_runner
,
50 struct GetDomainBoundCertOutput
* output
,
51 const DomainBoundCertCallback
& reply
,
54 DISALLOW_COPY_AND_ASSIGN(MessagePropertyProvider
);
57 } // namespace extensions
59 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_PROPERTY_PROVIDER_H_